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

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.

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