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

GET /v2/roles_entities
200
[
  {
    "id": 20,
    "entity_id": 7,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-11-22T13:43:11.431Z",
    "expires_at": null,
    "entity": {
      "id": 7,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": true,
      "scopes": [],
      "created_at": "2017-11-22T13:43:11.377Z",
      "updated_at": "2017-11-22T13:43:11.434Z",
      "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": 19,
    "entity_id": 7,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-11-22T13:43:11.413Z",
    "expires_at": null,
    "entity": {
      "id": 7,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": true,
      "scopes": [],
      "created_at": "2017-11-22T13:43:11.377Z",
      "updated_at": "2017-11-22T13:43:11.434Z",
      "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": 18,
    "entity_id": 7,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-11-22T13:43:11.399Z",
    "expires_at": null,
    "entity": {
      "id": 7,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": true,
      "scopes": [],
      "created_at": "2017-11-22T13:43:11.377Z",
      "updated_at": "2017-11-22T13:43:11.434Z",
      "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": 20,
    "entity_id": 7,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-11-22T13:43:11.431Z",
    "expires_at": null,
    "entity": {
      "id": 7,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": true,
      "scopes": [],
      "created_at": "2017-11-22T13:43:11.377Z",
      "updated_at": "2017-11-22T13:43:11.434Z",
      "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": 19,
    "entity_id": 7,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-11-22T13:43:11.413Z",
    "expires_at": null,
    "entity": {
      "id": 7,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": true,
      "scopes": [],
      "created_at": "2017-11-22T13:43:11.377Z",
      "updated_at": "2017-11-22T13:43:11.434Z",
      "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": 18,
    "entity_id": 7,
    "entity_type": "Doorkeeper::Application",
    "created_at": "2017-11-22T13:43:11.399Z",
    "expires_at": null,
    "entity": {
      "id": 7,
      "name": "test intrateam staff oauth application",
      "description": null,
      "image": null,
      "website": null,
      "public": true,
      "scopes": [],
      "created_at": "2017-11-22T13:43:11.377Z",
      "updated_at": "2017-11-22T13:43:11.434Z",
      "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"=>20, "entity_id"=>7, "entity_type"=>"Doorkeeper::Application", "created_at"=>"2017-11-22T13:43:11.431Z", "expires_at"=>nil, "entity"=>{"id"=>7, "name"=>"test intrateam staff oauth application", "description"=>nil, "image"=>nil, "website"=>nil, "public"=>true, "scopes"=>[], "created_at"=>"2017-11-22T13:43:11.377Z", "updated_at"=>"2017-11-22T13:43:11.434Z", "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"=>19, "entity_id"=>7, "entity_type"=>"Doorkeeper::Application", "created_at"=>"2017-11-22T13:43:11.413Z", "expires_at"=>nil, "entity"=>{"id"=>7, "name"=>"test intrateam staff oauth application", "description"=>nil, "image"=>nil, "website"=>nil, "public"=>true, "scopes"=>[], "created_at"=>"2017-11-22T13:43:11.377Z", "updated_at"=>"2017-11-22T13:43:11.434Z", "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"=>18, "entity_id"=>7, "entity_type"=>"Doorkeeper::Application", "created_at"=>"2017-11-22T13:43:11.399Z", "expires_at"=>nil, "entity"=>{"id"=>7, "name"=>"test intrateam staff oauth application", "description"=>nil, "image"=>nil, "website"=>nil, "public"=>true, "scopes"=>[], "created_at"=>"2017-11-22T13:43:11.377Z", "updated_at"=>"2017-11-22T13:43:11.434Z", "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"}}]