GET /v2/anti_grav_units_users
Return all the anti grav units users
GET /v2/users/:user_id/anti_grav_units_users
Return all the anti grav units users of the given User
GET /v2/campus/:campus_id/anti_grav_units_users
Return all the anti grav units users of the given Campus
live_help Notes
assignment
This action requires one of theses roles:
Advanced staff
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 |
campus_id |
optional
. Must be String
The campus id or slug |
sort |
optional
. Must be one of: id , user_id , created_at , updated_at , close_id , is_free , reason , end_date , expected_end_date , begin_date , anti_grav_unit_id , internship_id .
The sort field. Sorted by id desc by default. MoreExample:To sort on anti grav units users on the fields anti_grav_unit_id on a descending order and internship_id on a ascending order: ...&sort=-anti_grav_unit_id,internship_id |
filter |
optional
. Must be one of: id , user_id , created_at , updated_at , close_id , is_free , reason , end_date , expected_end_date , begin_date , anti_grav_unit_id , internship_id , cursus_id , active .
Filtering on one or more fields MoreExample:
To filter on anti grav units users with the
...&filter[id]=a_value,another_value Filterable fields:
|
range |
optional
. Must be one of: id , user_id , created_at , updated_at , close_id , is_free , reason , end_date , expected_end_date , begin_date , anti_grav_unit_id , internship_id .
Select on a particular range MoreExample:
To range on anti grav units users with the
...&range[internship_id]=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/anti_grav_units_users
200
[
{
"anti_grav_units_user": {
"id": 64,
"expected_end_date": "2020-02-10",
"begin_date": "2019-12-09",
"user_id": 18763,
"is_free": true,
"created_at": "2019-12-09T14:17:15.986Z",
"updated_at": "2019-12-09T14:17:15.986Z",
"anti_grav_unit_id": 1,
"reason": "I secured a job/internship",
"close_id": 65822
}
}
]
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/anti_grav_units_users"
[
{
"anti_grav_units_user": {
"id": 64,
"expected_end_date": "2020-02-10",
"begin_date": "2019-12-09",
"user_id": 18763,
"is_free": true,
"created_at": "2019-12-09T14:17:15.986Z",
"updated_at": "2019-12-09T14:17:15.986Z",
"anti_grav_unit_id": 1,
"reason": "I secured a job/internship",
"close_id": 65822
}
}
]
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/anti_grav_units_users")
response.status
# => 200
response.parsed
# => [{"anti_grav_units_user"=>{"id"=>64, "expected_end_date"=>"2020-02-10", "begin_date"=>"2019-12-09", "user_id"=>18763, "is_free"=>true, "created_at"=>"2019-12-09T14:17:15.986Z", "updated_at"=>"2019-12-09T14:17:15.986Z", "anti_grav_unit_id"=>1, "reason"=>"I secured a job/internship", "close_id"=>65822}}]