live_help Notes

assignment This action requires one of theses roles: Basic staff

settings Params

Param name Description
note optional , nil allowed . Must be a Hash
note[user_id] optional , nil allowed . Must be Fixnum

The user id.

note[from] optional , nil allowed . Must be String

The from.

note[subject] optional , nil allowed . Must be String

The subject.

note[content] optional , nil allowed . Must be String

The content.

comments powered by <span class='logo-disqus'>Disqus</span>
POST /v2/notes
{
  "note": {
    "content": "gentrify roof beard keffiyeh squid franzen cold-pressed farm-to-table retro fingerstache hoodie health",
    "from": "andre@42.fr",
    "subject": "quinoa",
    "user_id": "10"
  }
}
201
{
  "id": 11,
  "from": "andre@42.fr",
  "subject": "quinoa",
  "content": "gentrify roof beard keffiyeh squid franzen cold-pressed farm-to-table retro fingerstache hoodie health",
  "created_at": "2017-11-22T13:43:47.322Z",
  "user": {
    "id": 10,
    "login": "ssebulba",
    "url": "https://api.intra.42.fr/v2/users/ssebulba"
  }
}
curl  -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"note":{"content":"gentrify roof beard keffiyeh squid franzen cold-pressed farm-to-table retro fingerstache hoodie health","from":"andre@42.fr","subject":"quinoa","user_id":"10"}}' "https://api.intra.42.fr/v2/notes"

{
  "id": 11,
  "from": "andre@42.fr",
  "subject": "quinoa",
  "content": "gentrify roof beard keffiyeh squid franzen cold-pressed farm-to-table retro fingerstache hoodie health",
  "created_at": "2017-11-22T13:43:47.322Z",
  "user": {
    "id": 10,
    "login": "ssebulba",
    "url": "https://api.intra.42.fr/v2/users/ssebulba"
  }
}
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 = {note: {content: "gentrify roof beard keffiyeh squid franzen cold-pressed farm-to-table retro fingerstache hoodie health", from: "andre@42.fr", subject: "quinoa", user_id: "10"}}
response = token.post("/v2/notes", params: params)
response.status
# => 201
response.parsed
# => {"id"=>11, "from"=>"andre@42.fr", "subject"=>"quinoa", "content"=>"gentrify roof beard keffiyeh squid franzen cold-pressed farm-to-table retro fingerstache hoodie health", "created_at"=>"2017-11-22T13:43:47.322Z", "user"=>{"id"=>10, "login"=>"ssebulba", "url"=>"https://api.intra.42.fr/v2/users/ssebulba"}}