live_help Notes

assignment This action requires one of theses roles: Advanced tutor
chrome_reader_mode This resource is paginated by 30 items

settings Params

Param name Description
cursus_id optional . Must be String

The cursus id or slug

campus_id optional . Must be String

The campus id or slug

user_id optional . Must be String

The user id or slug

sort optional . Must be one of: id, name, slug, kind, internal_name, duration, ancestry, description, guild_size, guild_prct, cursus_id, campus_id, created_at, updated_at, grade_id, position, mails, certificate_id, unlock_all_projects, tries_number, success_number, close_on_fail, mails_from.

The sort field. Sorted by id asc by default.

Example:

To sort on quests on the fields close_on_fail on a descending order and mails_from on a ascending order:

...&sort=-close_on_fail,mails_from

filter optional . Must be one of: id, name, slug, kind, internal_name, description, cursus_id, campus_id, created_at, updated_at, grade_id, position.

Filtering on one or more fields

Example:

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

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

Filterable fields:
  • id (standard field)
  • name (standard field)
  • slug (standard field)
  • kind (standard field)
  • internal_name (standard field)
  • description (standard field)
  • cursus_id (standard field)
  • campus_id (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • grade_id (standard field)
  • position (standard field)
range optional . Must be one of: id, name, slug, kind, internal_name, description, cursus_id, campus_id, created_at, updated_at, grade_id, position.

Select on a particular range

Example:

To range on quests with the position field between min_value and max_value:

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

Rangeable fields:
  • id
  • name
  • slug
  • kind
  • internal_name
  • description
  • cursus_id
  • campus_id
  • created_at
  • updated_at
  • grade_id
  • position
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

comments powered by <span class='logo-disqus'>Disqus</span>
GET /v2/quests
200
[
  {
    "id": 1,
    "name": "Level 14",
    "slug": "level-14",
    "kind": "main",
    "internal_name": null,
    "description": "Reach the level 14.",
    "cursus_id": 1,
    "campus_id": null,
    "created_at": "2017-03-06T14:59:36.606Z",
    "updated_at": "2017-03-06T14:59:36.606Z",
    "grade_id": null,
    "position": 1,
    "grade": null,
    "cursus": {
      "id": 1,
      "created_at": "2017-03-06T14:58:43.965Z",
      "name": "Piscine C",
      "slug": "piscine-c"
    },
    "campus": null
  },
  {
    "id": 2,
    "name": "Level 7",
    "slug": "level-7",
    "kind": "mandatory",
    "internal_name": null,
    "description": "Reach the level 7.",
    "cursus_id": 1,
    "campus_id": null,
    "created_at": "2017-03-06T14:59:36.694Z",
    "updated_at": "2017-03-06T14:59:36.694Z",
    "grade_id": null,
    "position": 2,
    "grade": null,
    "cursus": {
      "id": 1,
      "created_at": "2017-03-06T14:58:43.965Z",
      "name": "Piscine C",
      "slug": "piscine-c"
    },
    "campus": null
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/quests"

[
  {
    "id": 1,
    "name": "Level 14",
    "slug": "level-14",
    "kind": "main",
    "internal_name": null,
    "description": "Reach the level 14.",
    "cursus_id": 1,
    "campus_id": null,
    "created_at": "2017-03-06T14:59:36.606Z",
    "updated_at": "2017-03-06T14:59:36.606Z",
    "grade_id": null,
    "position": 1,
    "grade": null,
    "cursus": {
      "id": 1,
      "created_at": "2017-03-06T14:58:43.965Z",
      "name": "Piscine C",
      "slug": "piscine-c"
    },
    "campus": null
  },
  {
    "id": 2,
    "name": "Level 7",
    "slug": "level-7",
    "kind": "mandatory",
    "internal_name": null,
    "description": "Reach the level 7.",
    "cursus_id": 1,
    "campus_id": null,
    "created_at": "2017-03-06T14:59:36.694Z",
    "updated_at": "2017-03-06T14:59:36.694Z",
    "grade_id": null,
    "position": 2,
    "grade": null,
    "cursus": {
      "id": 1,
      "created_at": "2017-03-06T14:58:43.965Z",
      "name": "Piscine C",
      "slug": "piscine-c"
    },
    "campus": null
  }
]
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/quests")
response.status
# => 200
response.parsed
# => [{"id"=>1, "name"=>"Level 14", "slug"=>"level-14", "kind"=>"main", "internal_name"=>nil, "description"=>"Reach the level 14.", "cursus_id"=>1, "campus_id"=>nil, "created_at"=>"2017-03-06T14:59:36.606Z", "updated_at"=>"2017-03-06T14:59:36.606Z", "grade_id"=>nil, "position"=>1, "grade"=>nil, "cursus"=>{"id"=>1, "created_at"=>"2017-03-06T14:58:43.965Z", "name"=>"Piscine C", "slug"=>"piscine-c"}, "campus"=>nil}, {"id"=>2, "name"=>"Level 7", "slug"=>"level-7", "kind"=>"mandatory", "internal_name"=>nil, "description"=>"Reach the level 7.", "cursus_id"=>1, "campus_id"=>nil, "created_at"=>"2017-03-06T14:59:36.694Z", "updated_at"=>"2017-03-06T14:59:36.694Z", "grade_id"=>nil, "position"=>2, "grade"=>nil, "cursus"=>{"id"=>1, "created_at"=>"2017-03-06T14:58:43.965Z", "name"=>"Piscine C", "slug"=>"piscine-c"}, "campus"=>nil}]