PATCH /v2/roles/:id
Update a role
PUT /v2/roles/:id
Update a role
live_help Notes
assignment
This action requires one of theses roles:
Advanced tutor
, Advanced staff
settings Params
Param name | Description |
---|---|
id |
required
. Must be String
The requested id |
role | optional , nil allowed . Must be a Hash |
role[name] |
optional
, nil allowed
. Must be String
The name. Must be unique. |
role[description] |
optional
. Must be String
The description. |
Examples
PUT /v2/roles/13
{
"role": {
"description": "Synchronised uniform parallelism",
"name": "astronomer"
}
}
204
curl -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"role":{"description":"Synchronised uniform parallelism","name":"astronomer"}}' "https://api.intra.42.fr/v2/roles/13"
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 = {role: {description: "Synchronised uniform parallelism", name: "astronomer"}}
response = token.put("/v2/roles/13", params: params)
response.status
# => 204
response.parsed
# =>