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.

Example:

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

Example:

To filter on anti grav units users with the id field matching a_value or another_value:

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

Filterable fields:
  • id (standard field)
  • user_id (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • close_id (standard field)
  • is_free (standard field)
  • reason (standard field)
  • end_date (standard field)
  • expected_end_date (standard field)
  • begin_date (standard field)
  • anti_grav_unit_id (standard field)
  • internship_id (standard field)
  • cursus_id : Only return agu users with users in the given cursus. Can be one of: 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 73, 74, 75, 76
  • active : .
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

Example:

To range on anti grav units users with the internship_id field between min_value and max_value:

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

Rangeable fields:
  • 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
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

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}}]