live_help Notes

assignment This action requires one of theses roles: Tutor

settings Params

Param name Description
id required . Must be String

The requested id

teams_user optional , nil allowed . Must be a Hash
teams_user[team_id] optional . Must be Fixnum

The team id.

teams_user[user_id] optional . Must be Fixnum

The user id. Must be unique in the scope of a given team.

teams_user[leader] optional , nil allowed . Must be one of: true, false.

Is it leader ? Default to false.

teams_user[validated] optional , nil allowed . Must be one of: true, false.

Is it validated ? Default to false.

teams_user[occurrence] optional , nil allowed . Must be Fixnum

The occurrence. Default to 0.

comments powered by <span class='logo-disqus'>Disqus</span>
PUT /v2/teams_users/21
{
  "teams_user": {
    "leader": "false",
    "occurrence": "1",
    "team_id": "34",
    "user_id": "64",
    "validated": "false"
  }
}
204
curl  -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"teams_user":{"leader":"false","occurrence":"1","team_id":"34","user_id":"64","validated":"false"}}' "https://api.intra.42.fr/v2/teams_users/21"
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 = {teams_user: {leader: "false", occurrence: "1", team_id: "34", user_id: "64", validated: "false"}}
response = token.put("/v2/teams_users/21", params: params)
response.status
# => 204
response.parsed
# =>