live_help Notes

assignment This action requires one of theses roles: Admin

settings Params

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

The user id.

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

The content.

changelog[version] optional , nil allowed . Must be String

The version.

changelog[released] optional , nil allowed . Must be one of: true, false.

Is it released ? Default to false.

comments powered by <span class='logo-disqus'>Disqus</span>
POST /v2/changelogs
{
  "changelog": {
    "content": "A *test* changelog \\o/",
    "released": "true",
    "user_id": "1",
    "version": "2.0.0"
  }
}
201
{
  "id": 16,
  "content": "A *test* changelog \\o/",
  "version": "2.0.0",
  "created_at": "2017-03-06T15:20:08.090Z",
  "updated_at": "2017-03-06T15:20:08.090Z",
  "released": true,
  "user": {
    "id": 1,
    "login": "jeanne",
    "url": "https://api.intra.42.fr/v2/users/jeanne"
  }
}
curl  -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"changelog":{"content":"A *test* changelog \\o/","released":"true","user_id":"1","version":"2.0.0"}}' "https://api.intra.42.fr/v2/changelogs"

{
  "id": 16,
  "content": "A *test* changelog \\o/",
  "version": "2.0.0",
  "created_at": "2017-03-06T15:20:08.090Z",
  "updated_at": "2017-03-06T15:20:08.090Z",
  "released": true,
  "user": {
    "id": 1,
    "login": "jeanne",
    "url": "https://api.intra.42.fr/v2/users/jeanne"
  }
}
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 = {changelog: {content: "A *test* changelog \o/", released: "true", user_id: "1", version: "2.0.0"}}
response = token.post("/v2/changelogs", params: params)
response.status
# => 201
response.parsed
# => {"id"=>16, "content"=>"A *test* changelog \\o/", "version"=>"2.0.0", "created_at"=>"2017-03-06T15:20:08.090Z", "updated_at"=>"2017-03-06T15:20:08.090Z", "released"=>true, "user"=>{"id"=>1, "login"=>"jeanne", "url"=>"https://api.intra.42.fr/v2/users/jeanne"}}