live_help Notes

assignment This action requires one of theses roles: Advanced staff, Events manager
chrome_reader_mode This resource is paginated by 30 items

settings Params

Param name Description
sort optional . Must be one of: id, waitlistable_id, waitlistable_type, created_at, updated_at.

The sort field. Sorted by created_at asc by default.

Example:

To sort on waitlists on the fields created_at on a descending order and updated_at on a ascending order:

...&sort=-created_at,updated_at

filter optional . Must be one of: id, waitlistable_id, waitlistable_type, created_at, updated_at.

Filtering on one or more fields

Example:

To filter on waitlists with the id field matching a_value or another_value:

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

Filterable fields:
  • id (standard field)
  • waitlistable_id (standard field)
  • waitlistable_type (standard field)
  • created_at (standard field)
  • updated_at (standard field)
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/waitlists
200
[
  {
    "created_at": "2018-09-13T18:55:37.552Z",
    "id": 1,
    "waitlistable_id": 1669,
    "waitlistable_type": "Exam"
  },
  {
    "created_at": "2018-09-13T18:56:36.902Z",
    "id": 2,
    "waitlistable_id": 1670,
    "waitlistable_type": "Exam"
  },
  {
    "created_at": "2018-09-13T18:57:13.021Z",
    "id": 3,
    "waitlistable_id": 1671,
    "waitlistable_type": "Exam"
  },
  {
    "created_at": "2018-09-13T18:58:01.760Z",
    "id": 4,
    "waitlistable_id": 1672,
    "waitlistable_type": "Exam"
  },
  {
    "created_at": "2018-09-14T08:16:14.076Z",
    "id": 5,
    "waitlistable_id": 1673,
    "waitlistable_type": "Exam"
  },
  {
    "created_at": "2018-09-14T10:01:19.094Z",
    "id": 8,
    "waitlistable_id": 1676,
    "waitlistable_type": "Exam"
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/waitlists"

[
  {
    "created_at": "2018-09-13T18:55:37.552Z",
    "id": 1,
    "waitlistable_id": 1669,
    "waitlistable_type": "Exam"
  },
  {
    "created_at": "2018-09-13T18:56:36.902Z",
    "id": 2,
    "waitlistable_id": 1670,
    "waitlistable_type": "Exam"
  },
  {
    "created_at": "2018-09-13T18:57:13.021Z",
    "id": 3,
    "waitlistable_id": 1671,
    "waitlistable_type": "Exam"
  },
  {
    "created_at": "2018-09-13T18:58:01.760Z",
    "id": 4,
    "waitlistable_id": 1672,
    "waitlistable_type": "Exam"
  },
  {
    "created_at": "2018-09-14T08:16:14.076Z",
    "id": 5,
    "waitlistable_id": 1673,
    "waitlistable_type": "Exam"
  },
  {
    "created_at": "2018-09-14T10:01:19.094Z",
    "id": 8,
    "waitlistable_id": 1676,
    "waitlistable_type": "Exam"
  }
]
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/waitlists")
response.status
# => 200
response.parsed
# => [{"created_at"=>"2018-09-13T18:55:37.552Z", "id"=>1, "waitlistable_id"=>1669, "waitlistable_type"=>"Exam"}, {"created_at"=>"2018-09-13T18:56:36.902Z", "id"=>2, "waitlistable_id"=>1670, "waitlistable_type"=>"Exam"}, {"created_at"=>"2018-09-13T18:57:13.021Z", "id"=>3, "waitlistable_id"=>1671, "waitlistable_type"=>"Exam"}, {"created_at"=>"2018-09-13T18:58:01.760Z", "id"=>4, "waitlistable_id"=>1672, "waitlistable_type"=>"Exam"}, {"created_at"=>"2018-09-14T08:16:14.076Z", "id"=>5, "waitlistable_id"=>1673, "waitlistable_type"=>"Exam"}, {"created_at"=>"2018-09-14T10:01:19.094Z", "id"=>8, "waitlistable_id"=>1676, "waitlistable_type"=>"Exam"}]