PATCH /v2/groups_users/:id
Update a groups user
PUT /v2/groups_users/:id
Update a groups 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 |
groups_user | optional , nil allowed . Must be a Hash |
groups_user[group_id] |
optional
. Must be Fixnum
The group id. Must be unique in the scope of a given user. |
groups_user[user_id] |
optional
. Must be Fixnum
The user id. |
Examples
PUT /v2/groups_users/4
{
"groups_user": {
"group_id": "1",
"user_id": "97"
}
}
204
curl -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"groups_user":{"group_id":"1","user_id":"97"}}' "https://api.intra.42.fr/v2/groups_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 = {groups_user: {group_id: "1", user_id: "97"}}
response = token.put("/v2/groups_users/4", params: params)
response.status
# => 204
response.parsed
# =>