GET /v2/cursus/:cursus_id/exams
Return all the exams of the given Cursus
GET /v2/campus/:campus_id/exams
Return all the exams of the given Campus
GET /v2/campus/:campus_id/cursus/:cursus_id/exams
Return all the exams of the given Cursus, associated with the given Campus
GET /v2/users/:user_id/exams
Return all the exams of the given User
GET /v2/projects/:project_id/exams
Return all the exams of the given Project
GET /v2/exams
Return all the exams
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 , campus_id .
The sort field. Sorted by begin_at desc, id desc by default. MoreExample:To sort on exams on the fields name on a descending order and campus_id on a ascending order: ...&sort=-name,campus_id |
filter |
optional
. Must be one of: id , begin_at , end_at , location , ip_range , max_people , created_at , updated_at , visible , name , campus_id , future , end .
Filtering on one or more fields MoreExample:
To filter on exams with the
...&filter[id]=a_value,another_value Filterable fields:
|
range |
optional
. Must be one of: id , begin_at , end_at , location , ip_range , max_people , created_at , updated_at , visible , name , campus_id .
Select on a particular range MoreExample:
To range on exams with the
...&range[campus_id]=min_value,max_value Rangeable fields:
|
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 |
Examples
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-11-24T13:42:10.134Z",
"end_at": "2017-11-24T15:42:10.134Z",
"location": "Crona University",
"max_people": 59,
"nbr_subscribers": 0,
"name": "Ordinary Wizarding Levels Exam",
"campus": [
{
"id": 1,
"name": "Cluj",
"time_zone": "Europe/Bucharest",
"language": {
"id": 3,
"name": "Romanian",
"identifier": "ro",
"created_at": "2017-11-22T13:40:59.468Z",
"updated_at": "2017-11-22T13:41:26.139Z"
},
"users_count": 28,
"vogsphere_id": 1
}
],
"cursus": [
{
"id": 1,
"created_at": "2017-11-22T13:41:00.750Z",
"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-11-22T13:41:26.356Z",
"updated_at": "2017-11-22T13:41:26.441Z",
"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-11-24T13:42:10.134Z",
"end_at": "2017-11-24T15:42:10.134Z",
"location": "Crona University",
"max_people": 59,
"nbr_subscribers": 0,
"name": "Ordinary Wizarding Levels Exam",
"campus": [
{
"id": 1,
"name": "Cluj",
"time_zone": "Europe/Bucharest",
"language": {
"id": 3,
"name": "Romanian",
"identifier": "ro",
"created_at": "2017-11-22T13:40:59.468Z",
"updated_at": "2017-11-22T13:41:26.139Z"
},
"users_count": 28,
"vogsphere_id": 1
}
],
"cursus": [
{
"id": 1,
"created_at": "2017-11-22T13:41:00.750Z",
"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-11-22T13:41:26.356Z",
"updated_at": "2017-11-22T13:41:26.441Z",
"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-11-24T13:42:10.134Z", "end_at"=>"2017-11-24T15:42:10.134Z", "location"=>"Crona University", "max_people"=>59, "nbr_subscribers"=>0, "name"=>"Ordinary Wizarding Levels Exam", "campus"=>[{"id"=>1, "name"=>"Cluj", "time_zone"=>"Europe/Bucharest", "language"=>{"id"=>3, "name"=>"Romanian", "identifier"=>"ro", "created_at"=>"2017-11-22T13:40:59.468Z", "updated_at"=>"2017-11-22T13:41:26.139Z"}, "users_count"=>28, "vogsphere_id"=>1}], "cursus"=>[{"id"=>1, "created_at"=>"2017-11-22T13:41:00.750Z", "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-11-22T13:41:26.356Z", "updated_at"=>"2017-11-22T13:41:26.441Z", "exam"=>true}]}]