live_help Notes

assignment This action requires one of theses roles: Basic staff

settings Params

Param name Description
id required . Must be String

The requested id

location optional , nil allowed . Must be a Hash
location[user_id] optional . Must be Fixnum

The user id.

location[begin_at] optional . Must be DateTime

The begin at.

location[end_at] optional , nil allowed . Must be DateTime

The end at.

location[floor] optional , nil allowed . Must be Fixnum

The floor.

location[row] optional , nil allowed . Must be Fixnum

The row.

location[post] optional , nil allowed . Must be Fixnum

The post.

location[primary] optional , nil allowed . Must be one of: true, false.

Is it primary ?

location[host] optional . Must be String

The host. Must be unique in the scope of a given campus id and end at.

location[campus_id] optional . Must be Fixnum

The campus id.

comments powered by <span class='logo-disqus'>Disqus</span>
PUT /v2/locations/10
{
  "location": {
    "begin_at": "2017-11-21 15:31:33 UTC",
    "campus_id": "4",
    "host": "burrito",
    "user_id": "94"
  }
}
204
curl  -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"location":{"begin_at":"2017-11-21 15:31:33 UTC","campus_id":"4","host":"burrito","user_id":"94"}}' "https://api.intra.42.fr/v2/locations/10"
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 = {location: {begin_at: "2017-11-21 15:31:33 UTC", campus_id: "4", host: "burrito", user_id: "94"}}
response = token.put("/v2/locations/10", params: params)
response.status
# => 204
response.parsed
# =>