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

roles_entity optional , nil allowed . Must be a Hash
roles_entity[role_id] optional . Must be Fixnum

The role id.

roles_entity[entity_id] optional . Must be Fixnum

The entity id.

roles_entity[expires_at] optional , nil allowed . Must be DateTime

The expires at.

roles_entity[entity_type] optional . Must be String

The entity type.

comments powered by <span class='logo-disqus'>Disqus</span>
PUT /v2/roles_entities/1
{
  "roles_entity": {
    "entity_id": "35",
    "entity_type": "Doorkeeper::Application",
    "role_id": "15"
  }
}
204
curl  -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"roles_entity":{"entity_id":"35","entity_type":"Doorkeeper::Application","role_id":"15"}}' "https://api.intra.42.fr/v2/roles_entities/1"
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 = {roles_entity: {entity_id: "35", entity_type: "Doorkeeper::Application", role_id: "15"}}
response = token.put("/v2/roles_entities/1", params: params)
response.status
# => 204
response.parsed
# =>