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

cursus_user optional , nil allowed . Must be a Hash
cursus_user[cursus_id] optional . Must be Fixnum

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

cursus_user[user_id] optional . Must be Fixnum

The user id.

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

The end at.

cursus_user[begin_at] optional . Must be DateTime

The begin at.

comments powered by <span class='logo-disqus'>Disqus</span>
PUT /v2/cursus_users/48
{
  "cursus_user": {
    "begin_at": "2016-11-06 15:19:52 UTC",
    "cursus_id": "2",
    "end_at": "2017-07-06 15:19:52 UTC",
    "user_id": "3"
  }
}
204
curl  -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"cursus_user":{"begin_at":"2016-11-06 15:19:52 UTC","cursus_id":"2","end_at":"2017-07-06 15:19:52 UTC","user_id":"3"}}' "https://api.intra.42.fr/v2/cursus_users/48"
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 = {cursus_user: {begin_at: "2016-11-06 15:19:52 UTC", cursus_id: "2", end_at: "2017-07-06 15:19:52 UTC", user_id: "3"}}
response = token.put("/v2/cursus_users/48", params: params)
response.status
# => 204
response.parsed
# =>