GET /v2/anti_grav_units_users/:id
Get an anti grav units user
live_help Notes
assignment
This action requires one of theses roles:
Advanced staff
settings Params
Param name | Description |
---|---|
id |
required
. Must be String
The requested id |
Examples
GET /v2/anti_grav_units_users/64
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/64"
{
"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/64")
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}}