live_help Notes

chrome_reader_mode This resource is paginated by 30 items

settings Params

Param name Description
user_id optional . Must be String

The user id or slug

cursus_id optional . Must be String

The cursus id or slug

sort optional . Must be one of: id, cursus_id, user_id, created_at, updated_at, end_at, begin_at, has_coalition.

The sort field. Sorted by created_at desc by default.

Example:

To sort on cursus users on the fields begin_at on a descending order and has_coalition on a ascending order:

...&sort=-begin_at,has_coalition

filter optional . Must be one of: id, cursus_id, user_id, created_at, updated_at, end_at, begin_at, has_coalition, active, end, future.

Filtering on one or more fields

Example:

To filter on cursus users with the id field matching a_value or another_value:

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

Filterable fields:
  • id (standard field)
  • cursus_id (standard field)
  • user_id (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • end_at (standard field)
  • begin_at (standard field)
  • has_coalition (standard field)
  • active : Only return active cursus_users. Can be one of: true, false
  • end (standard field)
  • future : Return only cursus users which begins in the future. Can be one of: true, false
range optional . Must be one of: id, cursus_id, user_id, created_at, updated_at, end_at, begin_at, has_coalition.

Select on a particular range

Example:

To range on cursus users with the has_coalition field between min_value and max_value:

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

Rangeable fields:
  • id
  • cursus_id
  • user_id
  • created_at
  • updated_at
  • end_at
  • begin_at
  • has_coalition
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/cursus_users
200
[
  {
    "id": 66,
    "begin_at": "2017-02-23T16:29:35.898Z",
    "end_at": null,
    "grade": "Cadet",
    "level": 0.0,
    "skills": [],
    "cursus_id": 1,
    "user": {
      "id": 66,
      "login": "cdooku",
      "url": "https://api.intra.42.fr/v2/users/cdooku"
    },
    "cursus": {
      "id": 1,
      "created_at": "2017-03-06T14:58:43.965Z",
      "name": "Piscine C",
      "slug": "piscine-c"
    }
  },
  {
    "id": 65,
    "begin_at": "2016-10-19T18:43:44.182Z",
    "end_at": null,
    "grade": "Cadet",
    "level": 0.0,
    "skills": [],
    "cursus_id": 1,
    "user": {
      "id": 65,
      "login": "jabinks",
      "url": "https://api.intra.42.fr/v2/users/jabinks"
    },
    "cursus": {
      "id": 1,
      "created_at": "2017-03-06T14:58:43.965Z",
      "name": "Piscine C",
      "slug": "piscine-c"
    }
  },
  {
    "id": 64,
    "begin_at": "2016-09-09T22:27:34.843Z",
    "end_at": null,
    "grade": "Cadet",
    "level": 0.0,
    "skills": [],
    "cursus_id": 2,
    "user": {
      "id": 64,
      "login": "ruhaako",
      "url": "https://api.intra.42.fr/v2/users/ruhaako"
    },
    "cursus": {
      "id": 2,
      "created_at": "2017-03-06T14:58:44.047Z",
      "name": "42",
      "slug": "42"
    }
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/cursus_users"

[
  {
    "id": 66,
    "begin_at": "2017-02-23T16:29:35.898Z",
    "end_at": null,
    "grade": "Cadet",
    "level": 0.0,
    "skills": [],
    "cursus_id": 1,
    "user": {
      "id": 66,
      "login": "cdooku",
      "url": "https://api.intra.42.fr/v2/users/cdooku"
    },
    "cursus": {
      "id": 1,
      "created_at": "2017-03-06T14:58:43.965Z",
      "name": "Piscine C",
      "slug": "piscine-c"
    }
  },
  {
    "id": 65,
    "begin_at": "2016-10-19T18:43:44.182Z",
    "end_at": null,
    "grade": "Cadet",
    "level": 0.0,
    "skills": [],
    "cursus_id": 1,
    "user": {
      "id": 65,
      "login": "jabinks",
      "url": "https://api.intra.42.fr/v2/users/jabinks"
    },
    "cursus": {
      "id": 1,
      "created_at": "2017-03-06T14:58:43.965Z",
      "name": "Piscine C",
      "slug": "piscine-c"
    }
  },
  {
    "id": 64,
    "begin_at": "2016-09-09T22:27:34.843Z",
    "end_at": null,
    "grade": "Cadet",
    "level": 0.0,
    "skills": [],
    "cursus_id": 2,
    "user": {
      "id": 64,
      "login": "ruhaako",
      "url": "https://api.intra.42.fr/v2/users/ruhaako"
    },
    "cursus": {
      "id": 2,
      "created_at": "2017-03-06T14:58:44.047Z",
      "name": "42",
      "slug": "42"
    }
  }
]
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/cursus_users")
response.status
# => 200
response.parsed
# => [{"id"=>66, "begin_at"=>"2017-02-23T16:29:35.898Z", "end_at"=>nil, "grade"=>"Cadet", "level"=>0.0, "skills"=>[], "cursus_id"=>1, "user"=>{"id"=>66, "login"=>"cdooku", "url"=>"https://api.intra.42.fr/v2/users/cdooku"}, "cursus"=>{"id"=>1, "created_at"=>"2017-03-06T14:58:43.965Z", "name"=>"Piscine C", "slug"=>"piscine-c"}}, {"id"=>65, "begin_at"=>"2016-10-19T18:43:44.182Z", "end_at"=>nil, "grade"=>"Cadet", "level"=>0.0, "skills"=>[], "cursus_id"=>1, "user"=>{"id"=>65, "login"=>"jabinks", "url"=>"https://api.intra.42.fr/v2/users/jabinks"}, "cursus"=>{"id"=>1, "created_at"=>"2017-03-06T14:58:43.965Z", "name"=>"Piscine C", "slug"=>"piscine-c"}}, {"id"=>64, "begin_at"=>"2016-09-09T22:27:34.843Z", "end_at"=>nil, "grade"=>"Cadet", "level"=>0.0, "skills"=>[], "cursus_id"=>2, "user"=>{"id"=>64, "login"=>"ruhaako", "url"=>"https://api.intra.42.fr/v2/users/ruhaako"}, "cursus"=>{"id"=>2, "created_at"=>"2017-03-06T14:58:44.047Z", "name"=>"42", "slug"=>"42"}}]