PATCH /v2/quests_users/:id
Update a quests user
PUT /v2/quests_users/:id
Update a quests 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 |
quests_user | optional , nil allowed . Must be a Hash |
quests_user[quest_id] |
optional
. Must be Fixnum
The quest id. Must be unique in the scope of a given user. |
quests_user[user_id] |
optional
. Must be Fixnum
The user id. |
quests_user[end_at] |
optional
, nil allowed
. Must be DateTime
The end at. |
quests_user[validated_at] |
optional
, nil allowed
. Must be DateTime
The validated at. |
quests_user[prct] |
optional
, nil allowed
. Must be Fixnum
The prct. |
quests_user[advancement] |
optional
, nil allowed
. Must be String
The advancement. |
Examples
PUT /v2/quests_users/3
{
"quests_user": {
"end_at": "2017-11-24 13:43:10 UTC",
"prct": "42",
"quest_id": "5",
"user_id": "31"
}
}
204
curl -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"quests_user":{"end_at":"2017-11-24 13:43:10 UTC","prct":"42","quest_id":"5","user_id":"31"}}' "https://api.intra.42.fr/v2/quests_users/3"
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 = {quests_user: {end_at: "2017-11-24 13:43:10 UTC", prct: "42", quest_id: "5", user_id: "31"}}
response = token.put("/v2/quests_users/3", params: params)
response.status
# => 204
response.parsed
# =>