PATCH /v2/cursus_users/:id
Update a cursus user
PUT /v2/cursus_users/:id
Update a cursus user
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. |
cursus_user[has_coalition] |
optional
. Must be one of: true , false .
Is it has coalition ? Default to true. |
cursus_user[skip_begin_validation] |
optional
, nil allowed
. Must be String
The skip begin validation. |
Examples
PUT /v2/cursus_users/7
{
"cursus_user": {
"begin_at": "2017-07-22 13:43:10 UTC",
"cursus_id": "2",
"end_at": "2018-03-22 13:43:10 UTC",
"user_id": "1"
}
}
204
curl -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"cursus_user":{"begin_at":"2017-07-22 13:43:10 UTC","cursus_id":"2","end_at":"2018-03-22 13:43:10 UTC","user_id":"1"}}' "https://api.intra.42.fr/v2/cursus_users/7"
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: "2017-07-22 13:43:10 UTC", cursus_id: "2", end_at: "2018-03-22 13:43:10 UTC", user_id: "1"}}
response = token.put("/v2/cursus_users/7", params: params)
response.status
# => 204
response.parsed
# =>