PATCH /v2/coalitions_users/:id
Update a coalitions user
PUT /v2/coalitions_users/:id
Update a coalitions 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 |
coalitions_user | optional , nil allowed . Must be a Hash |
coalitions_user[coalition_id] |
optional
. Must be Fixnum
The coalition id. |
coalitions_user[user_id] |
optional
. Must be Fixnum
The user id. Must be unique in the scope of a given coalition. |
coalitions_user[this_year_score] |
optional
. Must be Fixnum
The this year score. |
coalitions_user[this_year_score_updated_at] |
optional
, nil allowed
. Must be DateTime
The this year score updated at. |
Examples
PUT /v2/coalitions_users/4
{
"coalitions_user": {
"coalition_id": "2",
"user_id": "24"
}
}
204
curl -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"coalitions_user":{"coalition_id":"2","user_id":"24"}}' "https://api.intra.42.fr/v2/coalitions_users/4"
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 = {coalitions_user: {coalition_id: "2", user_id: "24"}}
response = token.put("/v2/coalitions_users/4", params: params)
response.status
# => 204
response.parsed
# =>