GET /v2/roles_entities/:id
Get a roles entity
settings Params
Param name | Description |
---|---|
id |
required
. Must be String
The requested id |
Examples
GET /v2/roles_entities/9
200
{
"id": 9,
"entity_id": 4,
"entity_type": "Doorkeeper::Application",
"created_at": "2017-11-22T13:43:11.249Z",
"expires_at": null,
"entity": {
"id": 4,
"name": "test shop staff oauth application",
"description": null,
"image": null,
"website": null,
"public": true,
"scopes": [],
"created_at": "2017-11-22T13:43:11.203Z",
"updated_at": "2017-11-22T13:43:11.253Z",
"owner": {},
"rate_limit": 1800
},
"role": {
"id": 10,
"name": "Shop Manager",
"description": "je suis un super manager"
}
}
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/roles_entities/9"
{
"id": 9,
"entity_id": 4,
"entity_type": "Doorkeeper::Application",
"created_at": "2017-11-22T13:43:11.249Z",
"expires_at": null,
"entity": {
"id": 4,
"name": "test shop staff oauth application",
"description": null,
"image": null,
"website": null,
"public": true,
"scopes": [],
"created_at": "2017-11-22T13:43:11.203Z",
"updated_at": "2017-11-22T13:43:11.253Z",
"owner": {},
"rate_limit": 1800
},
"role": {
"id": 10,
"name": "Shop Manager",
"description": "je suis un super manager"
}
}
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
response = token.get("/v2/roles_entities/9")
response.status
# => 200
response.parsed
# => {"id"=>9, "entity_id"=>4, "entity_type"=>"Doorkeeper::Application", "created_at"=>"2017-11-22T13:43:11.249Z", "expires_at"=>nil, "entity"=>{"id"=>4, "name"=>"test shop staff oauth application", "description"=>nil, "image"=>nil, "website"=>nil, "public"=>true, "scopes"=>[], "created_at"=>"2017-11-22T13:43:11.203Z", "updated_at"=>"2017-11-22T13:43:11.253Z", "owner"=>{}, "rate_limit"=>1800}, "role"=>{"id"=>10, "name"=>"Shop Manager", "description"=>"je suis un super manager"}}