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": 126,
    "begin_at": "2016-12-16T07:41:39.516Z",
    "end_at": null,
    "grade": "Cadet",
    "level": 0.0,
    "skills": [],
    "cursus_id": 2,
    "has_coalition": true,
    "user": {
      "id": 126,
      "login": "darthcae",
      "url": "https://api.intra.42.fr/v2/users/darthcae"
    },
    "cursus": {
      "id": 2,
      "created_at": "2017-11-22T13:41:00.825Z",
      "name": "42",
      "slug": "42"
    }
  },
  {
    "id": 125,
    "begin_at": "2017-11-10T21:38:19.158Z",
    "end_at": null,
    "grade": "Cadet",
    "level": 0.0,
    "skills": [],
    "cursus_id": 1,
    "has_coalition": true,
    "user": {
      "id": 125,
      "login": "sebulseb",
      "url": "https://api.intra.42.fr/v2/users/sebulseb"
    },
    "cursus": {
      "id": 1,
      "created_at": "2017-11-22T13:41:00.750Z",
      "name": "Piscine C",
      "slug": "piscine-c"
    }
  },
  {
    "id": 124,
    "begin_at": "2017-07-22T03:48:20.016Z",
    "end_at": null,
    "grade": "Cadet",
    "level": 0.0,
    "skills": [],
    "cursus_id": 2,
    "has_coalition": true,
    "user": {
      "id": 124,
      "login": "hsolo2",
      "url": "https://api.intra.42.fr/v2/users/hsolo2"
    },
    "cursus": {
      "id": 2,
      "created_at": "2017-11-22T13:41:00.825Z",
      "name": "42",
      "slug": "42"
    }
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/cursus_users"

[
  {
    "id": 126,
    "begin_at": "2016-12-16T07:41:39.516Z",
    "end_at": null,
    "grade": "Cadet",
    "level": 0.0,
    "skills": [],
    "cursus_id": 2,
    "has_coalition": true,
    "user": {
      "id": 126,
      "login": "darthcae",
      "url": "https://api.intra.42.fr/v2/users/darthcae"
    },
    "cursus": {
      "id": 2,
      "created_at": "2017-11-22T13:41:00.825Z",
      "name": "42",
      "slug": "42"
    }
  },
  {
    "id": 125,
    "begin_at": "2017-11-10T21:38:19.158Z",
    "end_at": null,
    "grade": "Cadet",
    "level": 0.0,
    "skills": [],
    "cursus_id": 1,
    "has_coalition": true,
    "user": {
      "id": 125,
      "login": "sebulseb",
      "url": "https://api.intra.42.fr/v2/users/sebulseb"
    },
    "cursus": {
      "id": 1,
      "created_at": "2017-11-22T13:41:00.750Z",
      "name": "Piscine C",
      "slug": "piscine-c"
    }
  },
  {
    "id": 124,
    "begin_at": "2017-07-22T03:48:20.016Z",
    "end_at": null,
    "grade": "Cadet",
    "level": 0.0,
    "skills": [],
    "cursus_id": 2,
    "has_coalition": true,
    "user": {
      "id": 124,
      "login": "hsolo2",
      "url": "https://api.intra.42.fr/v2/users/hsolo2"
    },
    "cursus": {
      "id": 2,
      "created_at": "2017-11-22T13:41:00.825Z",
      "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"=>126, "begin_at"=>"2016-12-16T07:41:39.516Z", "end_at"=>nil, "grade"=>"Cadet", "level"=>0.0, "skills"=>[], "cursus_id"=>2, "has_coalition"=>true, "user"=>{"id"=>126, "login"=>"darthcae", "url"=>"https://api.intra.42.fr/v2/users/darthcae"}, "cursus"=>{"id"=>2, "created_at"=>"2017-11-22T13:41:00.825Z", "name"=>"42", "slug"=>"42"}}, {"id"=>125, "begin_at"=>"2017-11-10T21:38:19.158Z", "end_at"=>nil, "grade"=>"Cadet", "level"=>0.0, "skills"=>[], "cursus_id"=>1, "has_coalition"=>true, "user"=>{"id"=>125, "login"=>"sebulseb", "url"=>"https://api.intra.42.fr/v2/users/sebulseb"}, "cursus"=>{"id"=>1, "created_at"=>"2017-11-22T13:41:00.750Z", "name"=>"Piscine C", "slug"=>"piscine-c"}}, {"id"=>124, "begin_at"=>"2017-07-22T03:48:20.016Z", "end_at"=>nil, "grade"=>"Cadet", "level"=>0.0, "skills"=>[], "cursus_id"=>2, "has_coalition"=>true, "user"=>{"id"=>124, "login"=>"hsolo2", "url"=>"https://api.intra.42.fr/v2/users/hsolo2"}, "cursus"=>{"id"=>2, "created_at"=>"2017-11-22T13:41:00.825Z", "name"=>"42", "slug"=>"42"}}]