live_help Notes

assignment This action requires one of theses roles: Advanced tutor

settings Params

Param name Description
id required . Must be String

The requested id

exam optional , nil allowed . Must be a Hash
exam[name] optional . Must be String

The name.

exam[begin_at] optional . Must be DateTime

The begin at.

exam[end_at] optional . Must be Fixnum

The end at. Beginning must be after ending.

exam[location] optional . Must be String

The location.

exam[ip_range] optional . Must be String

The ip range.

exam[visible] optional , nil allowed . Must be one of: true, false.

Is it visible ? Default to true.

exam[max_people] optional , nil allowed . Must be Fixnum

The max people.

exam[project_ids] optional , nil allowed . Must be an array of Integer

The project ids.

exam[campus_ids] optional , nil allowed . Must be an array of Integer

The campus ids.

comments powered by <span class='logo-disqus'>Disqus</span>
PUT /v2/exams/1
{
  "exam": {
    "begin_at": "2017-03-09 15:19:52 UTC",
    "campus_ids": [
      "1"
    ],
    "end_at": "2017-03-13 15:19:52 UTC",
    "ip_range": "10.20.0.0/16",
    "location": "Cluj",
    "max_people": "70",
    "name": "Rainbowcat Exam 🌈",
    "project_ids": [
      "3"
    ],
    "visible": "true"
  }
}
204
curl  -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"exam":{"begin_at":"2017-03-09 15:19:52 UTC","campus_ids":["1"],"end_at":"2017-03-13 15:19:52 UTC","ip_range":"10.20.0.0/16","location":"Cluj","max_people":"70","name":"Rainbowcat Exam 🌈","project_ids":["3"],"visible":"true"}}' "https://api.intra.42.fr/v2/exams/1"
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

params = {exam: {begin_at: "2017-03-09 15:19:52 UTC", campus_ids: ["1"], end_at: "2017-03-13 15:19:52 UTC", ip_range: "10.20.0.0/16", location: "Cluj", max_people: "70", name: "Rainbowcat Exam 🌈", project_ids: ["3"], visible: "true"}}
response = token.put("/v2/exams/1", params: params)
response.status
# => 204
response.parsed
# =>