GET /v2/cursus_users
Return all the cursus users
GET /v2/users/:user_id/cursus_users
Return all the cursus users of the given User
GET /v2/cursus/:cursus_id/cursus_users
Return all the cursus users of the given Cursus
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 , blackholed_at , level .
The sort field. Sorted by created_at desc, id desc by default. MoreExample:To sort on cursus users on the fields blackholed_at on a descending order and level on a ascending order: ...&sort=-blackholed_at,level |
filter |
optional
. Must be one of: id , cursus_id , user_id , created_at , updated_at , end_at , begin_at , has_coalition , blackholed_at , level , active , campus_id , end , future , blackholed .
Filtering on one or more fields MoreExample:
To filter on cursus users with the
...&filter[id]=a_value,another_value Filterable fields:
|
range |
optional
. Must be one of: id , cursus_id , user_id , created_at , updated_at , end_at , begin_at , has_coalition , blackholed_at , level , level .
Select on a particular range MoreExample:
To range on cursus users with the
...&range[level]=min_value,max_value Rangeable fields:
|
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 |
Examples
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"}}]