live_help Notes

assignment This action requires one of theses roles: Advanced tutor

settings Params

Param name Description
dashes_user optional , nil allowed . Must be a Hash
dashes_user[dash_id] required . Must be Fixnum

The dash id. Must be unique in the scope of a given user.

dashes_user[user_id] required . Must be Fixnum

The user id.

dashes_user[repo_url] optional , nil allowed . Must be String

The repo url.

dashes_user[repo_uuid] optional , nil allowed . Must be String

The repo uuid.

dashes_user[final_mark] optional , nil allowed . Must be Fixnum

The final mark.

comments powered by <span class='logo-disqus'>Disqus</span>
POST /v2/dashes_users
{
  "dashes_user": {
    "dash_id": "1",
    "user_id": "1"
  }
}
201
{
  "id": 2,
  "dash_id": 1,
  "user_id": 1,
  "repo_url": null,
  "repo_uuid": null,
  "final_mark": null
}
curl  -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"dashes_user":{"dash_id":"1","user_id":"1"}}' "https://api.intra.42.fr/v2/dashes_users"

{
  "id": 2,
  "dash_id": 1,
  "user_id": 1,
  "repo_url": null,
  "repo_uuid": null,
  "final_mark": null
}
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 = {dashes_user: {dash_id: "1", user_id: "1"}}
response = token.post("/v2/dashes_users", params: params)
response.status
# => 201
response.parsed
# => {"id"=>2, "dash_id"=>1, "user_id"=>1, "repo_url"=>nil, "repo_uuid"=>nil, "final_mark"=>nil}