List all visibles exams. Invisibles exams need at least the basic_staff role.

live_help Notes

chrome_reader_mode This resource is paginated by 30 items
assignment_ind This action have additional content with a token resource owner or an application with one of theses role(s): Basic staff .

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

project_id optional . Must be String

The project id or slug

sort optional . Must be one of: id, begin_at, end_at, location, ip_range, max_people, created_at, updated_at, visible, name.

The sort field. Sorted by begin_at desc by default.

Example:

To sort on exams on the fields visible on a descending order and name on a ascending order:

...&sort=-visible,name

filter optional . Must be one of: id, begin_at, end_at, location, ip_range, max_people, created_at, updated_at, visible, name, future, end.

Filtering on one or more fields

Example:

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

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

Filterable fields:
  • id (standard field)
  • begin_at (standard field)
  • end_at (standard field)
  • location (standard field)
  • ip_range (standard field)
  • max_people (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • visible (standard field)
  • name (standard field)
  • future : Return only exams which begins in the future. Can be one of: true, false
  • end (standard field)
range optional . Must be one of: id, begin_at, end_at, location, ip_range, max_people, created_at, updated_at, visible, name.

Select on a particular range

Example:

To range on exams with the name field between min_value and max_value:

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

Rangeable fields:
  • id
  • begin_at
  • end_at
  • location
  • ip_range
  • max_people
  • created_at
  • updated_at
  • visible
  • name
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/exams
200
[
  {
    "id": 1,
    "ip_range": "10.11.0.0/16,10.12.0.0/16,10.13.0.0/16",
    "begin_at": "2017-03-08T14:59:35.218Z",
    "end_at": "2017-03-08T16:59:35.218Z",
    "location": "North Dicki",
    "max_people": 68,
    "nbr_subscribers": 0,
    "name": "Ordinary Wizarding Levels Exam",
    "campus": [
      {
        "id": 1,
        "name": "Cluj",
        "time_zone": "Bucharest",
        "language": {
          "id": 3,
          "name": "Romanian",
          "identifier": "ro",
          "created_at": "2017-03-06T14:58:43.176Z",
          "updated_at": "2017-03-06T14:58:43.176Z"
        },
        "users_count": 16,
        "vogsphere_id": 1
      }
    ],
    "cursus": [
      {
        "id": 1,
        "created_at": "2017-03-06T14:58:43.965Z",
        "name": "Piscine C",
        "slug": "piscine-c"
      }
    ],
    "projects": [
      {
        "id": 2,
        "name": "Ordinary Wizarding Levels",
        "slug": "ordinary-wizarding-levels",
        "description": "Ordinary Wizarding Level (often abbreviated O.W.L.) is a subject-specific test taken during Hogwarts School of Witchcraft and Wizardry students' fifth year, administrated by the Wizarding Examinations Authority. The score made by a student on a particular O.W.L. determines whether or not he or she will be allowed to continue taking that subject in subsequent school years.",
        "parent": null,
        "children": [],
        "objectives": [
          "Wizarding"
        ],
        "tier": 1,
        "attachments": [],
        "created_at": "2017-03-06T14:59:04.501Z",
        "updated_at": "2017-03-06T14:59:04.573Z",
        "exam": true
      }
    ]
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/exams"

[
  {
    "id": 1,
    "ip_range": "10.11.0.0/16,10.12.0.0/16,10.13.0.0/16",
    "begin_at": "2017-03-08T14:59:35.218Z",
    "end_at": "2017-03-08T16:59:35.218Z",
    "location": "North Dicki",
    "max_people": 68,
    "nbr_subscribers": 0,
    "name": "Ordinary Wizarding Levels Exam",
    "campus": [
      {
        "id": 1,
        "name": "Cluj",
        "time_zone": "Bucharest",
        "language": {
          "id": 3,
          "name": "Romanian",
          "identifier": "ro",
          "created_at": "2017-03-06T14:58:43.176Z",
          "updated_at": "2017-03-06T14:58:43.176Z"
        },
        "users_count": 16,
        "vogsphere_id": 1
      }
    ],
    "cursus": [
      {
        "id": 1,
        "created_at": "2017-03-06T14:58:43.965Z",
        "name": "Piscine C",
        "slug": "piscine-c"
      }
    ],
    "projects": [
      {
        "id": 2,
        "name": "Ordinary Wizarding Levels",
        "slug": "ordinary-wizarding-levels",
        "description": "Ordinary Wizarding Level (often abbreviated O.W.L.) is a subject-specific test taken during Hogwarts School of Witchcraft and Wizardry students' fifth year, administrated by the Wizarding Examinations Authority. The score made by a student on a particular O.W.L. determines whether or not he or she will be allowed to continue taking that subject in subsequent school years.",
        "parent": null,
        "children": [],
        "objectives": [
          "Wizarding"
        ],
        "tier": 1,
        "attachments": [],
        "created_at": "2017-03-06T14:59:04.501Z",
        "updated_at": "2017-03-06T14:59:04.573Z",
        "exam": true
      }
    ]
  }
]
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/exams")
response.status
# => 200
response.parsed
# => [{"id"=>1, "ip_range"=>"10.11.0.0/16,10.12.0.0/16,10.13.0.0/16", "begin_at"=>"2017-03-08T14:59:35.218Z", "end_at"=>"2017-03-08T16:59:35.218Z", "location"=>"North Dicki", "max_people"=>68, "nbr_subscribers"=>0, "name"=>"Ordinary Wizarding Levels Exam", "campus"=>[{"id"=>1, "name"=>"Cluj", "time_zone"=>"Bucharest", "language"=>{"id"=>3, "name"=>"Romanian", "identifier"=>"ro", "created_at"=>"2017-03-06T14:58:43.176Z", "updated_at"=>"2017-03-06T14:58:43.176Z"}, "users_count"=>16, "vogsphere_id"=>1}], "cursus"=>[{"id"=>1, "created_at"=>"2017-03-06T14:58:43.965Z", "name"=>"Piscine C", "slug"=>"piscine-c"}], "projects"=>[{"id"=>2, "name"=>"Ordinary Wizarding Levels", "slug"=>"ordinary-wizarding-levels", "description"=>"Ordinary Wizarding Level (often abbreviated O.W.L.) is a subject-specific test taken during Hogwarts School of Witchcraft and Wizardry students' fifth year, administrated by the Wizarding Examinations Authority. The score made by a student on a particular O.W.L. determines whether or not he or she will be allowed to continue taking that subject in subsequent school years.", "parent"=>nil, "children"=>[], "objectives"=>["Wizarding"], "tier"=>1, "attachments"=>[], "created_at"=>"2017-03-06T14:59:04.501Z", "updated_at"=>"2017-03-06T14:59:04.573Z", "exam"=>true}]}]