live_help Notes

assignment This action requires one of theses roles: Student tutor, Advanced tutor, Advanced staff
group_work Requires following application scopes: projects

settings Params

Param name Description
partnership_id optional . Must be String

The partnership id or slug

partnerships_user optional , nil allowed . Must be a Hash
partnerships_user[partnership_id] required . Must be Fixnum

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

partnerships_user[user_id] required . Must be Fixnum

The user id.

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

The final mark.

comments powered by <span class='logo-disqus'>Disqus</span>
POST /v2/partnerships_users
{
  "partnerships_user": {
    "partnership_id": "1",
    "user_id": "59"
  }
}
201
{
  "id": 8,
  "partnership_id": 1,
  "final_mark": null,
  "user": {
    "id": 59,
    "login": "jabinks",
    "url": "https://api.intra.42.fr/v2/users/jabinks"
  }
}
curl  -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"partnerships_user":{"partnership_id":"1","user_id":"59"}}' "https://api.intra.42.fr/v2/partnerships_users"

{
  "id": 8,
  "partnership_id": 1,
  "final_mark": null,
  "user": {
    "id": 59,
    "login": "jabinks",
    "url": "https://api.intra.42.fr/v2/users/jabinks"
  }
}
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 = {partnerships_user: {partnership_id: "1", user_id: "59"}}
response = token.post("/v2/partnerships_users", params: params)
response.status
# => 201
response.parsed
# => {"id"=>8, "partnership_id"=>1, "final_mark"=>nil, "user"=>{"id"=>59, "login"=>"jabinks", "url"=>"https://api.intra.42.fr/v2/users/jabinks"}}