PATCH /v2/patronages_reports/:id
Update a patronages report
PUT /v2/patronages_reports/:id
Update a patronages report
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 |
patronages_report | optional , nil allowed . Must be a Hash |
patronages_report[user_id] |
optional
, nil allowed
. Must be Fixnum
The user id. |
patronages_report[begin_at] |
optional
, nil allowed
. Must be DateTime
The begin at. |
patronages_report[patronage_id] |
optional
. Must be Fixnum
The patronage id. |
patronages_report[report_id] |
optional
. Must be Fixnum
The report id. |
patronages_report[validated_at] |
optional
, nil allowed
. Must be DateTime
The validated at. |
patronages_report[comment] |
optional
, nil allowed
. Must be String
The comment. |
patronages_report[answers_attributes] |
optional
, nil allowed
. Must be an Array of nested elements
The answers attributes. |
patronages_report[answers_attributes][question_id] |
optional
. Must be Fixnum
The question id. Must be unique in the scope of a given scalable entity. |
patronages_report[answers_attributes][value] |
optional
, nil allowed
. Must be Fixnum
The value. |
patronages_report[answers_attributes][answer] |
optional
, nil allowed
. Must be String
The answer. |
patronages_report[answers_attributes][id] |
optional
, nil allowed
. Must be Fixnum
The id. |
Examples
PUT /v2/patronages_reports/67
{
"patronages_report": {
"begin_at": "2017-11-22 13:43:10 UTC",
"patronage_id": "112",
"report_id": "0",
"user_id": "53"
}
}
204
curl -X PUT -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"patronages_report":{"begin_at":"2017-11-22 13:43:10 UTC","patronage_id":"112","report_id":"0","user_id":"53"}}' "https://api.intra.42.fr/v2/patronages_reports/67"
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 = {patronages_report: {begin_at: "2017-11-22 13:43:10 UTC", patronage_id: "112", report_id: "0", user_id: "53"}}
response = token.put("/v2/patronages_reports/67", params: params)
response.status
# => 204
response.parsed
# =>