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": 60,
    "entity_id": 22,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-11-21T17:31:34.012Z",
    "expires_at": null,
    "entity": {
      "id": 22,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": true,
      "scopes": [],
      "created_at": "2017-11-21T17:31:33.963Z",
      "updated_at": "2017-11-21T17:31:34.015Z",
      "owner": {
        "id": 74,
        "login": "pamidala",
        "url": "https://api.intra.42.fr/v2/users/pamidala"
      },
      "rate_limit": 1800
    },
    "role": {
      "id": 1,
      "name": "Intrateam",
      "description": "manage all"
    }
  },
  {
    "id": 59,
    "entity_id": 22,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-11-21T17:31:33.998Z",
    "expires_at": null,
    "entity": {
      "id": 22,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": true,
      "scopes": [],
      "created_at": "2017-11-21T17:31:33.963Z",
      "updated_at": "2017-11-21T17:31:34.015Z",
      "owner": {
        "id": 74,
        "login": "pamidala",
        "url": "https://api.intra.42.fr/v2/users/pamidala"
      },
      "rate_limit": 1800
    },
    "role": {
      "id": 11,
      "name": "Advanced Staff",
      "description": "Member of the staff, with higher privileges"
    }
  },
  {
    "id": 58,
    "entity_id": 22,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-11-21T17:31:33.985Z",
    "expires_at": null,
    "entity": {
      "id": 22,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": true,
      "scopes": [],
      "created_at": "2017-11-21T17:31:33.963Z",
      "updated_at": "2017-11-21T17:31:34.015Z",
      "owner": {
        "id": 74,
        "login": "pamidala",
        "url": "https://api.intra.42.fr/v2/users/pamidala"
      },
      "rate_limit": 1800
    },
    "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": 60,
    "entity_id": 22,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-11-21T17:31:34.012Z",
    "expires_at": null,
    "entity": {
      "id": 22,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": true,
      "scopes": [],
      "created_at": "2017-11-21T17:31:33.963Z",
      "updated_at": "2017-11-21T17:31:34.015Z",
      "owner": {
        "id": 74,
        "login": "pamidala",
        "url": "https://api.intra.42.fr/v2/users/pamidala"
      },
      "rate_limit": 1800
    },
    "role": {
      "id": 1,
      "name": "Intrateam",
      "description": "manage all"
    }
  },
  {
    "id": 59,
    "entity_id": 22,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-11-21T17:31:33.998Z",
    "expires_at": null,
    "entity": {
      "id": 22,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": true,
      "scopes": [],
      "created_at": "2017-11-21T17:31:33.963Z",
      "updated_at": "2017-11-21T17:31:34.015Z",
      "owner": {
        "id": 74,
        "login": "pamidala",
        "url": "https://api.intra.42.fr/v2/users/pamidala"
      },
      "rate_limit": 1800
    },
    "role": {
      "id": 11,
      "name": "Advanced Staff",
      "description": "Member of the staff, with higher privileges"
    }
  },
  {
    "id": 58,
    "entity_id": 22,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-11-21T17:31:33.985Z",
    "expires_at": null,
    "entity": {
      "id": 22,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": true,
      "scopes": [],
      "created_at": "2017-11-21T17:31:33.963Z",
      "updated_at": "2017-11-21T17:31:34.015Z",
      "owner": {
        "id": 74,
        "login": "pamidala",
        "url": "https://api.intra.42.fr/v2/users/pamidala"
      },
      "rate_limit": 1800
    },
    "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"=>60, "entity_id"=>22, "entity_type"=>"Doorkeeper::Application", "created_at"=>"2017-11-21T17:31:34.012Z", "expires_at"=>nil, "entity"=>{"id"=>22, "name"=>"test intrateam staff oauth application", "description"=>nil, "image"=>nil, "website"=>nil, "public"=>true, "scopes"=>[], "created_at"=>"2017-11-21T17:31:33.963Z", "updated_at"=>"2017-11-21T17:31:34.015Z", "owner"=>{"id"=>74, "login"=>"pamidala", "url"=>"https://api.intra.42.fr/v2/users/pamidala"}, "rate_limit"=>1800}, "role"=>{"id"=>1, "name"=>"Intrateam", "description"=>"manage all"}}, {"id"=>59, "entity_id"=>22, "entity_type"=>"Doorkeeper::Application", "created_at"=>"2017-11-21T17:31:33.998Z", "expires_at"=>nil, "entity"=>{"id"=>22, "name"=>"test intrateam staff oauth application", "description"=>nil, "image"=>nil, "website"=>nil, "public"=>true, "scopes"=>[], "created_at"=>"2017-11-21T17:31:33.963Z", "updated_at"=>"2017-11-21T17:31:34.015Z", "owner"=>{"id"=>74, "login"=>"pamidala", "url"=>"https://api.intra.42.fr/v2/users/pamidala"}, "rate_limit"=>1800}, "role"=>{"id"=>11, "name"=>"Advanced Staff", "description"=>"Member of the staff, with higher privileges"}}, {"id"=>58, "entity_id"=>22, "entity_type"=>"Doorkeeper::Application", "created_at"=>"2017-11-21T17:31:33.985Z", "expires_at"=>nil, "entity"=>{"id"=>22, "name"=>"test intrateam staff oauth application", "description"=>nil, "image"=>nil, "website"=>nil, "public"=>true, "scopes"=>[], "created_at"=>"2017-11-21T17:31:33.963Z", "updated_at"=>"2017-11-21T17:31:34.015Z", "owner"=>{"id"=>74, "login"=>"pamidala", "url"=>"https://api.intra.42.fr/v2/users/pamidala"}, "rate_limit"=>1800}, "role"=>{"id"=>7, "name"=>"Basic Staff", "description"=>"Member of the staff, can manage community services, closes, exams and access advanced student data"}}]