PATCH /v2/community_services/:id
Update a community service
PUT /v2/community_services/:id
Update a community service
Warning: When you use this call, we suggest that you know what you do.
live_help Notes
assignment
This action requires one of theses roles:
Basic staff
group_work
Requires following application scopes:
tig
settings Params
Param name | Description |
---|---|
id |
required
. Must be String
The requested id |
community_service | optional , nil allowed . Must be a Hash |
community_service[duration] |
optional
. Must be Fixnum
The duration. |
community_service[occupation] |
optional
, nil allowed
. Must be String
The occupation. Maximum length is 255. Allow blank length is true. |
community_service[schedule_at] |
optional
, nil allowed
. Must be Fixnum
The schedule at. Must be after today. Must be before 2 weeks from now. |
community_service[close_id] |
optional
, nil allowed
. Must be Fixnum
The close id. |
community_service[tiger_id] |
optional
, nil allowed
. Must be Fixnum
The tiger id. |
Examples
PUT /v2/community_services/1.json
{
"community_service": {
"close_id": "2",
"duration": "14400",
"occupation": "Regarder Shrek, en entier, avec Mathieu Trentin",
"schedule_at": "2017-11-27 09:00:00 UTC",
"tiger_id": "2"
}
}
204
curl -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"community_service":{"close_id":"2","duration":"14400","occupation":"Regarder Shrek, en entier, avec Mathieu Trentin","schedule_at":"2017-11-27 09:00:00 UTC","tiger_id":"2"}}' "https://api.intra.42.fr/v2/community_services/1.json"
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 = {community_service: {close_id: "2", duration: "14400", occupation: "Regarder Shrek, en entier, avec Mathieu Trentin", schedule_at: "2017-11-27 09:00:00 UTC", tiger_id: "2"}}
response = token.put("/v2/community_services/1.json", params: params)
response.status
# => 204
response.parsed
# =>