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": "kickstarter distillery fingerstache yr austin +1 goth williamsburg schlitz mlkshk viral shoreditch",
    "from": "andre@42.fr",
    "subject": "flexitarian",
    "user_id": "60"
  }
}
201
{
  "id": 15,
  "from": "andre@42.fr",
  "subject": "flexitarian",
  "content": "kickstarter distillery fingerstache yr austin +1 goth williamsburg schlitz mlkshk viral shoreditch",
  "created_at": "2017-03-06T15:20:21.486Z",
  "user": {
    "id": 60,
    "login": "leiorgan",
    "url": "https://api.intra.42.fr/v2/users/leiorgan"
  }
}
curl  -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"note":{"content":"kickstarter distillery fingerstache yr austin +1 goth williamsburg schlitz mlkshk viral shoreditch","from":"andre@42.fr","subject":"flexitarian","user_id":"60"}}' "https://api.intra.42.fr/v2/notes"

{
  "id": 15,
  "from": "andre@42.fr",
  "subject": "flexitarian",
  "content": "kickstarter distillery fingerstache yr austin +1 goth williamsburg schlitz mlkshk viral shoreditch",
  "created_at": "2017-03-06T15:20:21.486Z",
  "user": {
    "id": 60,
    "login": "leiorgan",
    "url": "https://api.intra.42.fr/v2/users/leiorgan"
  }
}
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: "kickstarter distillery fingerstache yr austin +1 goth williamsburg schlitz mlkshk viral shoreditch", from: "andre@42.fr", subject: "flexitarian", user_id: "60"}}
response = token.post("/v2/notes", params: params)
response.status
# => 201
response.parsed
# => {"id"=>15, "from"=>"andre@42.fr", "subject"=>"flexitarian", "content"=>"kickstarter distillery fingerstache yr austin +1 goth williamsburg schlitz mlkshk viral shoreditch", "created_at"=>"2017-03-06T15:20:21.486Z", "user"=>{"id"=>60, "login"=>"leiorgan", "url"=>"https://api.intra.42.fr/v2/users/leiorgan"}}