PATCH /v2/projects_users/:id
Update a projects user
PUT /v2/projects_users/:id
Update a projects user
live_help Notes
assignment
This action requires one of theses roles:
Advanced tutor
, Advanced staff
group_work
Requires following application scopes:
projects
settings Params
Param name | Description |
---|---|
id |
required
. Must be String
The requested id |
projects_user | optional , nil allowed . Must be a Hash |
projects_user[id] |
optional
, nil allowed
. Must be Fixnum
The id. |
projects_user[project_id] |
optional
. Must be Fixnum
The project id. |
projects_user[user_id] |
optional
. Must be Fixnum
The user id. Must be unique in the scope of a given project. |
projects_user[created_at] |
optional
, nil allowed
. Must be DateTime
The created at. |
projects_user[updated_at] |
optional
, nil allowed
. Must be DateTime
The updated at. |
projects_user[occurrence] |
optional
, nil allowed
. Must be Fixnum
The occurrence. Default to 0. |
projects_user[final_mark] |
optional
, nil allowed
. Must be Fixnum
The final mark. |
projects_user[retriable_at] |
optional
, nil allowed
. Must be DateTime
The retriable at. |
projects_user[marked_at] |
optional
, nil allowed
. Must be DateTime
The marked at. |
projects_user[status] |
optional
, nil allowed
. Must be String
The status. Default to unknown. |
projects_user[skip_check_permission] |
optional
, nil allowed
. Must be String
The skip check permission. |
Examples
PUT /v2/projects_users/18
{
"projects_user": {
"project_id": "1",
"user_id": "1"
}
}
204
curl -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"projects_user":{"project_id":"1","user_id":"1"}}' "https://api.intra.42.fr/v2/projects_users/18"
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 = {projects_user: {project_id: "1", user_id: "1"}}
response = token.put("/v2/projects_users/18", params: params)
response.status
# => 204
response.parsed
# =>