live_help Notes

assignment This action requires one of theses roles: Advanced tutor

settings Params

Param name Description
dash optional , nil allowed . Must be a Hash
dash[name] required . Must be String

The name. Must be unique in the scope of a given cursus.

dash[description] required . Must be String

The description.

dash[slug] optional , nil allowed . Must be String

The slug.

dash[cursus_id] required . Must be Fixnum

The cursus id.

dash[campus_id] required . Must be Fixnum

The campus id.

dash[skill_id] required . Must be Fixnum

The skill id.

dash[nbr_xp] required . Must be String

The nbr xp.

dash[begin_at] required . Must be Fixnum

The begin at. Must be after today.

dash[duration] required . Must be Fixnum

The duration.

comments powered by <span class='logo-disqus'>Disqus</span>
POST /v2/dashes
{
  "dash": {
    "begin_at": "2017-11-24 17:31:56 UTC",
    "campus_id": "3",
    "cursus_id": "2",
    "description": "Le sujet dbon courage!",
    "duration": "20",
    "name": "Dashname",
    "nbr_xp": "20",
    "skill_id": "2",
    "slug": "dashname"
  }
}
201
{
  "id": 3,
  "name": "Dashname",
  "description": "Le sujet dbon courage!",
  "slug": "dashname",
  "cursus_id": 2,
  "campus_id": 3,
  "skill_id": 2,
  "nbr_xp": "20",
  "begin_at": "2017-11-24T17:31:56.000Z",
  "end_at": "2017-11-24T17:51:56.000Z"
}
curl  -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"dash":{"begin_at":"2017-11-24 17:31:56 UTC","campus_id":"3","cursus_id":"2","description":"Le sujet dbon courage!","duration":"20","name":"Dashname","nbr_xp":"20","skill_id":"2","slug":"dashname"}}' "https://api.intra.42.fr/v2/dashes"

{
  "id": 3,
  "name": "Dashname",
  "description": "Le sujet dbon courage!",
  "slug": "dashname",
  "cursus_id": 2,
  "campus_id": 3,
  "skill_id": 2,
  "nbr_xp": "20",
  "begin_at": "2017-11-24T17:31:56.000Z",
  "end_at": "2017-11-24T17:51:56.000Z"
}
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 = {dash: {begin_at: "2017-11-24 17:31:56 UTC", campus_id: "3", cursus_id: "2", description: "Le sujet dbon courage!", duration: "20", name: "Dashname", nbr_xp: "20", skill_id: "2", slug: "dashname"}}
response = token.post("/v2/dashes", params: params)
response.status
# => 201
response.parsed
# => {"id"=>3, "name"=>"Dashname", "description"=>"Le sujet dbon courage!", "slug"=>"dashname", "cursus_id"=>2, "campus_id"=>3, "skill_id"=>2, "nbr_xp"=>"20", "begin_at"=>"2017-11-24T17:31:56.000Z", "end_at"=>"2017-11-24T17:51:56.000Z"}