live_help Notes

assignment This action requires one of theses roles: Tutor

settings Params

Param name Description
user_id optional . Must be String

The user id or slug

patronage_id optional . Must be String

The patronage id

report_id optional . Must be String

The report id or slug

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] required . Must be Fixnum

The patronage id.

patronages_report[report_id] required . 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] required . 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.

comments powered by <span class='logo-disqus'>Disqus</span>
POST /v2/patronages_reports
{
  "patronages_report": {
    "begin_at": "2017-03-06 15:19:52 UTC",
    "patronage_id": "14",
    "report_id": "0",
    "user_id": "50"
  }
}
201
{
  "id": 71,
  "user_id": 50,
  "begin_at": "2017-03-06T15:19:52.000Z",
  "created_at": "2017-03-06T15:20:25.442Z",
  "updated_at": "2017-03-06T15:20:25.442Z",
  "patronage_id": 14,
  "report_id": 0,
  "validated_at": null,
  "patronage": {
    "id": 14,
    "user_id": 7,
    "godfather_id": 11,
    "ongoing": true,
    "created_at": "2017-03-06T14:59:36.898Z",
    "updated_at": "2017-03-06T15:20:25.445Z"
  },
  "report": {
    "id": 0,
    "name": "Final Debriefing",
    "comment": "",
    "introduction_md": "",
    "disclaimer_md": "",
    "guidelines_md": "Franzen letterpress ennui intelligentsia cliche. Sriracha cronut asymmetrical five dollar toast squid goth vinyl. Thundercats tilde synth. Sustainable narwhal williamsburg echo.\n3 wolf moon post-ironic wes anderson you probably haven't heard of them neutra williamsburg butcher. Put a bird on it pbr&b drinking microdosing vhs occupy green juice. Pitchfork blue bottle photo booth. Fap raw denim cornhole yr franzen church-key.\nTofu yolo deep v beard disrupt. Helvetica +1 goth everyday truffaut. Banjo everyday small batch dreamcatcher yuccie deep v art party scenester. Carry 8-bit roof pinterest bicycle rights franzen organic. Gastropub pop-up occupy.",
    "created_at": "2017-03-06T14:59:36.513Z",
    "updated_at": "2017-03-06T14:59:36.551Z",
    "slug": "final-debriefing",
    "delay_days": 210
  },
  "user": {
    "id": 50,
    "login": "padmeami",
    "url": "https://api.intra.42.fr/v2/users/padmeami"
  },
  "answers": []
}
curl  -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"patronages_report":{"begin_at":"2017-03-06 15:19:52 UTC","patronage_id":"14","report_id":"0","user_id":"50"}}' "https://api.intra.42.fr/v2/patronages_reports"

{
  "id": 71,
  "user_id": 50,
  "begin_at": "2017-03-06T15:19:52.000Z",
  "created_at": "2017-03-06T15:20:25.442Z",
  "updated_at": "2017-03-06T15:20:25.442Z",
  "patronage_id": 14,
  "report_id": 0,
  "validated_at": null,
  "patronage": {
    "id": 14,
    "user_id": 7,
    "godfather_id": 11,
    "ongoing": true,
    "created_at": "2017-03-06T14:59:36.898Z",
    "updated_at": "2017-03-06T15:20:25.445Z"
  },
  "report": {
    "id": 0,
    "name": "Final Debriefing",
    "comment": "",
    "introduction_md": "",
    "disclaimer_md": "",
    "guidelines_md": "Franzen letterpress ennui intelligentsia cliche. Sriracha cronut asymmetrical five dollar toast squid goth vinyl. Thundercats tilde synth. Sustainable narwhal williamsburg echo.\n3 wolf moon post-ironic wes anderson you probably haven't heard of them neutra williamsburg butcher. Put a bird on it pbr&b drinking microdosing vhs occupy green juice. Pitchfork blue bottle photo booth. Fap raw denim cornhole yr franzen church-key.\nTofu yolo deep v beard disrupt. Helvetica +1 goth everyday truffaut. Banjo everyday small batch dreamcatcher yuccie deep v art party scenester. Carry 8-bit roof pinterest bicycle rights franzen organic. Gastropub pop-up occupy.",
    "created_at": "2017-03-06T14:59:36.513Z",
    "updated_at": "2017-03-06T14:59:36.551Z",
    "slug": "final-debriefing",
    "delay_days": 210
  },
  "user": {
    "id": 50,
    "login": "padmeami",
    "url": "https://api.intra.42.fr/v2/users/padmeami"
  },
  "answers": []
}
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-03-06 15:19:52 UTC", patronage_id: "14", report_id: "0", user_id: "50"}}
response = token.post("/v2/patronages_reports", params: params)
response.status
# => 201
response.parsed
# => {"id"=>71, "user_id"=>50, "begin_at"=>"2017-03-06T15:19:52.000Z", "created_at"=>"2017-03-06T15:20:25.442Z", "updated_at"=>"2017-03-06T15:20:25.442Z", "patronage_id"=>14, "report_id"=>0, "validated_at"=>nil, "patronage"=>{"id"=>14, "user_id"=>7, "godfather_id"=>11, "ongoing"=>true, "created_at"=>"2017-03-06T14:59:36.898Z", "updated_at"=>"2017-03-06T15:20:25.445Z"}, "report"=>{"id"=>0, "name"=>"Final Debriefing", "comment"=>"", "introduction_md"=>"", "disclaimer_md"=>"", "guidelines_md"=>"Franzen letterpress ennui intelligentsia cliche. Sriracha cronut asymmetrical five dollar toast squid goth vinyl. Thundercats tilde synth. Sustainable narwhal williamsburg echo.\n3 wolf moon post-ironic wes anderson you probably haven't heard of them neutra williamsburg butcher. Put a bird on it pbr&b drinking microdosing vhs occupy green juice. Pitchfork blue bottle photo booth. Fap raw denim cornhole yr franzen church-key.\nTofu yolo deep v beard disrupt. Helvetica +1 goth everyday truffaut. Banjo everyday small batch dreamcatcher yuccie deep v art party scenester. Carry 8-bit roof pinterest bicycle rights franzen organic. Gastropub pop-up occupy.", "created_at"=>"2017-03-06T14:59:36.513Z", "updated_at"=>"2017-03-06T14:59:36.551Z", "slug"=>"final-debriefing", "delay_days"=>210}, "user"=>{"id"=>50, "login"=>"padmeami", "url"=>"https://api.intra.42.fr/v2/users/padmeami"}, "answers"=>[]}