GET /v2/exams/:id
Get an exam
Return the exam specified by the :id
parameter. Invisibles exams need at least the basic_staff
role.
settings Params
Param name | Description |
---|---|
id |
required
. Must be String
The requested id |
Examples
GET /v2/exams/1
200
{
"id": 42,
"ip_range": "10.11.0.0/16,10.12.0.0/16,10.13.0.0/16,10.42.0.0/16",
"begin_at": "2015-07-17T15:00:00.000Z",
"end_at": "2015-07-17T19:00:00.000Z",
"location": "e1,e2,e3",
"max_people": 780,
"nbr_subscribers": 594,
"name": "Piscine C - Exam 01",
"created_at": "2015-07-15T13:05:26.006Z",
"updated_at": "2018-08-27T16:56:15.032Z",
"campus": {
"id": 1,
"name": "Paris",
"time_zone": "Europe/Paris",
"language": {
"id": 1,
"name": "Français",
"identifier": "fr",
"created_at": "2014-11-02T16:43:38.466Z",
"updated_at": "2021-10-08T16:28:44.040Z"
},
"users_count": 22319,
"vogsphere_id": 1,
"country": "France",
"address": "96, boulevard Bessières",
"zip": "75017",
"city": "Paris",
"website": "http://www.42.fr/",
"facebook": "https://facebook.com/42born2code",
"twitter": "https://twitter.com/42born2code",
"active": true,
"email_extension": "42.fr",
"default_hidden_phone": false
},
"cursus": [
{
"id": 4,
"created_at": "2015-05-01T17:46:08.433Z",
"name": "Piscine C",
"slug": "piscine-c"
},
{
"id": 6,
"created_at": "2015-09-21T12:36:09.128Z",
"name": "Piscine C décloisonnée",
"slug": "piscine-c-decloisonnee"
},
{
"id": 13,
"created_at": "2017-02-01T14:25:42.300Z",
"name": "42 Labs",
"slug": "42-labs"
}
],
"projects": [
{
"id": 405,
"name": "Exam01",
"slug": "piscine-c-exam01",
"parent": null,
"children": [],
"attachments": [],
"created_at": "2015-06-29T13:14:31.702Z",
"updated_at": "2021-09-01T08:35:01.074Z",
"exam": true,
"git_id": null,
"repository": null
}
]
}
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/exams/1"
{
"id": 42,
"ip_range": "10.11.0.0/16,10.12.0.0/16,10.13.0.0/16,10.42.0.0/16",
"begin_at": "2015-07-17T15:00:00.000Z",
"end_at": "2015-07-17T19:00:00.000Z",
"location": "e1,e2,e3",
"max_people": 780,
"nbr_subscribers": 594,
"name": "Piscine C - Exam 01",
"created_at": "2015-07-15T13:05:26.006Z",
"updated_at": "2018-08-27T16:56:15.032Z",
"campus": {
"id": 1,
"name": "Paris",
"time_zone": "Europe/Paris",
"language": {
"id": 1,
"name": "Français",
"identifier": "fr",
"created_at": "2014-11-02T16:43:38.466Z",
"updated_at": "2021-10-08T16:28:44.040Z"
},
"users_count": 22319,
"vogsphere_id": 1,
"country": "France",
"address": "96, boulevard Bessières",
"zip": "75017",
"city": "Paris",
"website": "http://www.42.fr/",
"facebook": "https://facebook.com/42born2code",
"twitter": "https://twitter.com/42born2code",
"active": true,
"email_extension": "42.fr",
"default_hidden_phone": false
},
"cursus": [
{
"id": 4,
"created_at": "2015-05-01T17:46:08.433Z",
"name": "Piscine C",
"slug": "piscine-c"
},
{
"id": 6,
"created_at": "2015-09-21T12:36:09.128Z",
"name": "Piscine C décloisonnée",
"slug": "piscine-c-decloisonnee"
},
{
"id": 13,
"created_at": "2017-02-01T14:25:42.300Z",
"name": "42 Labs",
"slug": "42-labs"
}
],
"projects": [
{
"id": 405,
"name": "Exam01",
"slug": "piscine-c-exam01",
"parent": null,
"children": [],
"attachments": [],
"created_at": "2015-06-29T13:14:31.702Z",
"updated_at": "2021-09-01T08:35:01.074Z",
"exam": true,
"git_id": null,
"repository": 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/exams/1")
response.status
# => 200
response.parsed
# => {"id"=>42, "ip_range"=>"10.11.0.0/16,10.12.0.0/16,10.13.0.0/16,10.42.0.0/16", "begin_at"=>"2015-07-17T15:00:00.000Z", "end_at"=>"2015-07-17T19:00:00.000Z", "location"=>"e1,e2,e3", "max_people"=>780, "nbr_subscribers"=>594, "name"=>"Piscine C - Exam 01", "created_at"=>"2015-07-15T13:05:26.006Z", "updated_at"=>"2018-08-27T16:56:15.032Z", "campus"=>{"id"=>1, "name"=>"Paris", "time_zone"=>"Europe/Paris", "language"=>{"id"=>1, "name"=>"Français", "identifier"=>"fr", "created_at"=>"2014-11-02T16:43:38.466Z", "updated_at"=>"2021-10-08T16:28:44.040Z"}, "users_count"=>22319, "vogsphere_id"=>1, "country"=>"France", "address"=>"96, boulevard Bessières", "zip"=>"75017", "city"=>"Paris", "website"=>"http://www.42.fr/", "facebook"=>"https://facebook.com/42born2code", "twitter"=>"https://twitter.com/42born2code", "active"=>true, "email_extension"=>"42.fr", "default_hidden_phone"=>false}, "cursus"=>[{"id"=>4, "created_at"=>"2015-05-01T17:46:08.433Z", "name"=>"Piscine C", "slug"=>"piscine-c"}, {"id"=>6, "created_at"=>"2015-09-21T12:36:09.128Z", "name"=>"Piscine C décloisonnée", "slug"=>"piscine-c-decloisonnee"}, {"id"=>13, "created_at"=>"2017-02-01T14:25:42.300Z", "name"=>"42 Labs", "slug"=>"42-labs"}], "projects"=>[{"id"=>405, "name"=>"Exam01", "slug"=>"piscine-c-exam01", "parent"=>nil, "children"=>[], "attachments"=>[], "created_at"=>"2015-06-29T13:14:31.702Z", "updated_at"=>"2021-09-01T08:35:01.074Z", "exam"=>true, "git_id"=>nil, "repository"=>nil}]}