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

campus_user optional , nil allowed . Must be a Hash
campus_user[campus_id] optional , nil allowed . Must be Fixnum

The campus id. Must be unique in the scope of a given user.

campus_user[user_id] optional , nil allowed . Must be Fixnum

The user id.

campus_user[end_at] optional , nil allowed . Must be String

The end at.

campus_user[begin_at] optional , nil allowed . Must be String

The begin at.

campus_user[is_primary] optional , nil allowed . Must be one of: true, false.

Is it is primary ? Default to false.

comments powered by <span class='logo-disqus'>Disqus</span>
PUT /v2/campus_users/65
{
  "campus_user": {
    "campus_id": "6",
    "user_id": "1"
  }
}
204
curl  -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"campus_user":{"campus_id":"6","user_id":"1"}}' "https://api.intra.42.fr/v2/campus_users/65"
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 = {campus_user: {campus_id: "6", user_id: "1"}}
response = token.put("/v2/campus_users/65", params: params)
response.status
# => 204
response.parsed
# =>