live_help Notes

chrome_reader_mode This resource is paginated by 30 items

settings Params

Param name Description
role_id optional . Must be String

The role id

sort optional . Must be one of: id, role_id, entity_id, expires_at, created_at, updated_at, entity_type.

The sort field. Sorted by id desc by default.

Example:

To sort on roles entities on the fields updated_at on a descending order and entity_type on a ascending order:

...&sort=-updated_at,entity_type

filter optional . Must be one of: id, role_id, entity_id, expires_at, created_at, updated_at, entity_type, expires.

Filtering on one or more fields

Example:

To filter on roles entities with the id field matching a_value or another_value:

...&filter[id]=a_value,another_value

Filterable fields:
  • id (standard field)
  • role_id (standard field)
  • entity_id (standard field)
  • expires_at (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • entity_type (standard field)
  • expires (standard field)
range optional . Must be one of: id, role_id, entity_id, expires_at, created_at, updated_at, entity_type.

Select on a particular range

Example:

To range on roles entities with the entity_type field between min_value and max_value:

...&range[entity_type]=min_value,max_value

Rangeable fields:
  • id
  • role_id
  • entity_id
  • expires_at
  • created_at
  • updated_at
  • entity_type
page optional . Must be a Hash

The pagination params, as a hash

page[number] optional . Must be Fixnum

The current page

page[size] optional . Must be Fixnum

The number of items per page, defaults to 30, maximum 100

comments powered by <span class='logo-disqus'>Disqus</span>
GET /v2/roles_entities
200
[
  {
    "id": 56,
    "entity_id": 36,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-03-06T15:19:52.922Z",
    "expires_at": null,
    "entity": {
      "id": 36,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": false,
      "scopes": [],
      "created_at": "2017-03-06T15:19:52.869Z",
      "updated_at": "2017-03-06T15:19:52.926Z",
      "owner": {},
      "rate_limit": 500
    },
    "role": {
      "id": 1,
      "name": "Intrateam",
      "description": "manage all"
    }
  },
  {
    "id": 55,
    "entity_id": 36,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-03-06T15:19:52.908Z",
    "expires_at": null,
    "entity": {
      "id": 36,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": false,
      "scopes": [],
      "created_at": "2017-03-06T15:19:52.869Z",
      "updated_at": "2017-03-06T15:19:52.926Z",
      "owner": {},
      "rate_limit": 500
    },
    "role": {
      "id": 11,
      "name": "Advanced Staff",
      "description": "Member of the staff, with higher privileges"
    }
  },
  {
    "id": 54,
    "entity_id": 36,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-03-06T15:19:52.894Z",
    "expires_at": null,
    "entity": {
      "id": 36,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": false,
      "scopes": [],
      "created_at": "2017-03-06T15:19:52.869Z",
      "updated_at": "2017-03-06T15:19:52.926Z",
      "owner": {},
      "rate_limit": 500
    },
    "role": {
      "id": 7,
      "name": "Basic Staff",
      "description": "Member of the staff, can manage community services, closes, exams and access advanced student data"
    }
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/roles_entities"

[
  {
    "id": 56,
    "entity_id": 36,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-03-06T15:19:52.922Z",
    "expires_at": null,
    "entity": {
      "id": 36,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": false,
      "scopes": [],
      "created_at": "2017-03-06T15:19:52.869Z",
      "updated_at": "2017-03-06T15:19:52.926Z",
      "owner": {},
      "rate_limit": 500
    },
    "role": {
      "id": 1,
      "name": "Intrateam",
      "description": "manage all"
    }
  },
  {
    "id": 55,
    "entity_id": 36,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-03-06T15:19:52.908Z",
    "expires_at": null,
    "entity": {
      "id": 36,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": false,
      "scopes": [],
      "created_at": "2017-03-06T15:19:52.869Z",
      "updated_at": "2017-03-06T15:19:52.926Z",
      "owner": {},
      "rate_limit": 500
    },
    "role": {
      "id": 11,
      "name": "Advanced Staff",
      "description": "Member of the staff, with higher privileges"
    }
  },
  {
    "id": 54,
    "entity_id": 36,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-03-06T15:19:52.894Z",
    "expires_at": null,
    "entity": {
      "id": 36,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": false,
      "scopes": [],
      "created_at": "2017-03-06T15:19:52.869Z",
      "updated_at": "2017-03-06T15:19:52.926Z",
      "owner": {},
      "rate_limit": 500
    },
    "role": {
      "id": 7,
      "name": "Basic Staff",
      "description": "Member of the staff, can manage community services, closes, exams and access advanced student data"
    }
  }
]
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")
response.status
# => 200
response.parsed
# => [{"id"=>56, "entity_id"=>36, "entity_type"=>"Doorkeeper::Application", "created_at"=>"2017-03-06T15:19:52.922Z", "expires_at"=>nil, "entity"=>{"id"=>36, "name"=>"test intrateam staff oauth application", "description"=>nil, "image"=>nil, "website"=>nil, "public"=>false, "scopes"=>[], "created_at"=>"2017-03-06T15:19:52.869Z", "updated_at"=>"2017-03-06T15:19:52.926Z", "owner"=>{}, "rate_limit"=>500}, "role"=>{"id"=>1, "name"=>"Intrateam", "description"=>"manage all"}}, {"id"=>55, "entity_id"=>36, "entity_type"=>"Doorkeeper::Application", "created_at"=>"2017-03-06T15:19:52.908Z", "expires_at"=>nil, "entity"=>{"id"=>36, "name"=>"test intrateam staff oauth application", "description"=>nil, "image"=>nil, "website"=>nil, "public"=>false, "scopes"=>[], "created_at"=>"2017-03-06T15:19:52.869Z", "updated_at"=>"2017-03-06T15:19:52.926Z", "owner"=>{}, "rate_limit"=>500}, "role"=>{"id"=>11, "name"=>"Advanced Staff", "description"=>"Member of the staff, with higher privileges"}}, {"id"=>54, "entity_id"=>36, "entity_type"=>"Doorkeeper::Application", "created_at"=>"2017-03-06T15:19:52.894Z", "expires_at"=>nil, "entity"=>{"id"=>36, "name"=>"test intrateam staff oauth application", "description"=>nil, "image"=>nil, "website"=>nil, "public"=>false, "scopes"=>[], "created_at"=>"2017-03-06T15:19:52.869Z", "updated_at"=>"2017-03-06T15:19:52.926Z", "owner"=>{}, "rate_limit"=>500}, "role"=>{"id"=>7, "name"=>"Basic Staff", "description"=>"Member of the staff, can manage community services, closes, exams and access advanced student data"}}]