PATCH /v2/teams/:id
Update a team
PUT /v2/teams/:id
Update a team
live_help Notes
This action requires a token resource owner
scoped on projects with enough privileges
or an application with one of theses role(s):
assignment_ind
Advanced tutor
.
settings Params
Param name | Description |
---|---|
id |
required
. Must be String
The requested id |
team | optional , nil allowed . Must be a Hash |
team[project_id] |
optional
. Must be Fixnum
The project id. |
team[name] |
optional
, nil allowed
. Must be String
The name. Maximum length is 255. |
team[created_at] |
optional
, nil allowed
. Must be DateTime
The created at. |
team[updated_at] |
optional
, nil allowed
. Must be DateTime
The updated at. |
team[locked_at] |
optional
, nil allowed
. Must be DateTime
The locked at. |
team[closed_at] |
optional
, nil allowed
. Must be DateTime
The closed at. |
team[final_mark] |
optional
, nil allowed
. Must be Fixnum
The final mark. |
team[repo_url] |
optional
, nil allowed
. Must be String
The repo url. |
team[repo_uuid] |
optional
, nil allowed
. Must be String
The repo uuid. |
team[deadline_at] |
optional
, nil allowed
. Must be Fixnum
The deadline at. Must be after today. |
team[terminating_at] |
optional
, nil allowed
. Must be DateTime
The terminating at. |
team[project_session_id] |
optional
, nil allowed
. Must be Fixnum
The project session id. |
team[teams_users_attributes] |
optional
, nil allowed
. Must be an Array of nested elements
The teams users attributes. |
team[teams_users_attributes][user_id] |
optional
. Must be Fixnum
The user id. Must be unique in the scope of a given team. |
team[teams_users_attributes][leader] |
optional
, nil allowed
. Must be one of: true , false .
Is it leader ? Default to false. |
team[teams_users_attributes][validated] |
optional
, nil allowed
. Must be one of: true , false .
Is it validated ? Default to false. |
team[teams_users_attributes][occurrence] |
optional
, nil allowed
. Must be Fixnum
The occurrence. Default to 0. |
Examples
PUT /v2/teams/58
{
"team": {
"origin_user_id": "125",
"project_id": "5"
}
}
204
curl -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"team":{"origin_user_id":"125","project_id":"5"}}' "https://api.intra.42.fr/v2/teams/58"
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 = {team: {origin_user_id: "125", project_id: "5"}}
response = token.put("/v2/teams/58", params: params)
response.status
# => 204
response.parsed
# =>