PATCH /v2/patronages/:id
Update a patronage
PUT /v2/patronages/:id
Update a patronage
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 |
patronage | optional , nil allowed . Must be a Hash |
patronage[user_id] |
optional
. Must be Fixnum
The user id. |
patronage[godfather_id] |
optional
. Must be Fixnum
The godfather id. |
patronage[ongoing] |
optional
, nil allowed
. Must be one of: true , false .
Is it ongoing ? Default to true. |
Examples
PUT /v2/patronages/113
{
"patronage": {
"godfather_id": "4",
"user_id": "3"
}
}
204
curl -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"patronage":{"godfather_id":"4","user_id":"3"}}' "https://api.intra.42.fr/v2/patronages/113"
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 = {patronage: {godfather_id: "4", user_id: "3"}}
response = token.put("/v2/patronages/113", params: params)
response.status
# => 204
response.parsed
# =>