PATCH /v2/achievements_users/:id
Update an achievements user
PUT /v2/achievements_users/:id
Update an achievements user
live_help Notes
assignment
This action requires one of theses roles:
Achievements manager
settings Params
Param name | Description |
---|---|
id |
required
. Must be String
The requested id |
achievements_user | optional , nil allowed . Must be a Hash |
achievements_user[user_id] |
optional
. Must be Fixnum
The user id. Must be unique in the scope of a given achievement. |
achievements_user[achievement_id] |
optional
. Must be Fixnum
The achievement id. |
achievements_user[nbr_of_success] |
optional
, nil allowed
. Must be Fixnum
The nbr of success. |
achievements_user[rewarded] |
optional
, nil allowed
. Must be one of: true , false .
Is it rewarded ? Default to false. |
Examples
PUT /v2/achievements_users/105
{
"achievements_user": {
"achievement_id": "5",
"user_id": "30"
}
}
204
curl -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"achievements_user":{"achievement_id":"5","user_id":"30"}}' "https://api.intra.42.fr/v2/achievements_users/105"
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 = {achievements_user: {achievement_id: "5", user_id: "30"}}
response = token.put("/v2/achievements_users/105", params: params)
response.status
# => 204
response.parsed
# =>