PATCH /v2/subnotions/:id
Update a subnotion
PUT /v2/subnotions/:id
Update a subnotion
live_help Notes
assignment
This action requires one of theses roles:
Advanced tutor
, Video manager
settings Params
Param name | Description |
---|---|
id |
required
. Must be String
The requested id |
subnotion | optional , nil allowed . Must be a Hash |
subnotion[id] |
optional
, nil allowed
. Must be Fixnum
The id. |
subnotion[name] |
optional
. Must be String
The name. Must be unique in the scope of a given notion. |
subnotion[notion_id] |
optional
, nil allowed
. Must be Fixnum
The notion id. |
subnotion[attachments_attributes] |
optional
, nil allowed
. Must be an Array of nested elements
The attachments attributes. |
subnotion[attachments_attributes][id] |
optional
, nil allowed
. Must be Fixnum
The id. |
subnotion[attachments_attributes][kind] |
optional
, nil allowed
. Must be one of: code , pdf , link , document , video .
The kind. |
subnotion[attachments_attributes][_destroy] |
optional
, nil allowed
. Must be String
The destroy. |
subnotion[attachments_attributes][language_id] |
optional
. Must be Fixnum
The language id. |
subnotion[attachments_attributes][untranslatable] |
optional
, nil allowed
. Must be one of: true , false .
Is it untranslatable ? Default to false. |
subnotion[attachments_attributes][attachable_attributes] |
optional
, nil allowed
. Must be an Array of nested elements
The attachable attributes. |
Examples
PUT /v2/subnotions/6
{
"subnotion": {
"name": "By Grand Central Station I Sat Down and Wept",
"notion_id": "2"
}
}
204
curl -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"subnotion":{"name":"By Grand Central Station I Sat Down and Wept","notion_id":"2"}}' "https://api.intra.42.fr/v2/subnotions/6"
require "oauth2"
UID = "Your application uid"
SECRET = "Your application secret"
client = OAuth2::Client.new(UID, SECRET, site: "https://api.intra.42.fr")
token = client.client_credentials.get_token
params = {subnotion: {name: "By Grand Central Station I Sat Down and Wept", notion_id: "2"}}
response = token.put("/v2/subnotions/6", params: params)
response.status
# => 204
response.parsed
# =>