live_help Notes

assignment_ind This action requires a token resource owner scoped on profile with enough privileges or an application with one of theses role(s): Advanced tutor .

settings Params

Param name Description
expertise_id optional . Must be String

The expertise id or slug

user_id optional . Must be String

The user id or slug

expertises_user optional , nil allowed . Must be a Hash
expertises_user[expertise_id] required . Must be Fixnum

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

expertises_user[user_id] required . Must be Fixnum

The user id.

expertises_user[interested] optional , nil allowed . Must be one of: true, false.

Is it interested ? Default to false.

expertises_user[value] required . Must be Fixnum

The value.

expertises_user[contact_me] optional , nil allowed . Must be one of: true, false.

Is it contact me ? Default to false.

comments powered by <span class='logo-disqus'>Disqus</span>
POST /v2/expertises_users
{
  "expertises_user": {
    "expertise_id": "1",
    "user_id": "61",
    "value": "1"
  }
}
201
{
  "id": 68,
  "expertise_id": 1,
  "interested": false,
  "value": 1,
  "contact_me": false,
  "created_at": "2017-03-06T15:20:16.671Z",
  "user_id": 61,
  "expertise": {
    "id": 1,
    "name": ".NET",
    "slug": "net",
    "url": "https://api.intra.42.fr/v2/expertises/net",
    "kind": "languages",
    "created_at": "2017-03-06T14:58:45.058Z",
    "expertises_users_url": "https://api.intra.42.fr/v2/expertises/net/expertises_users"
  },
  "user": {
    "id": 61,
    "login": "dartcaed",
    "url": "https://api.intra.42.fr/v2/users/dartcaed"
  }
}
curl  -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"expertises_user":{"expertise_id":"1","user_id":"61","value":"1"}}' "https://api.intra.42.fr/v2/expertises_users"

{
  "id": 68,
  "expertise_id": 1,
  "interested": false,
  "value": 1,
  "contact_me": false,
  "created_at": "2017-03-06T15:20:16.671Z",
  "user_id": 61,
  "expertise": {
    "id": 1,
    "name": ".NET",
    "slug": "net",
    "url": "https://api.intra.42.fr/v2/expertises/net",
    "kind": "languages",
    "created_at": "2017-03-06T14:58:45.058Z",
    "expertises_users_url": "https://api.intra.42.fr/v2/expertises/net/expertises_users"
  },
  "user": {
    "id": 61,
    "login": "dartcaed",
    "url": "https://api.intra.42.fr/v2/users/dartcaed"
  }
}
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 = {expertises_user: {expertise_id: "1", user_id: "61", value: "1"}}
response = token.post("/v2/expertises_users", params: params)
response.status
# => 201
response.parsed
# => {"id"=>68, "expertise_id"=>1, "interested"=>false, "value"=>1, "contact_me"=>false, "created_at"=>"2017-03-06T15:20:16.671Z", "user_id"=>61, "expertise"=>{"id"=>1, "name"=>".NET", "slug"=>"net", "url"=>"https://api.intra.42.fr/v2/expertises/net", "kind"=>"languages", "created_at"=>"2017-03-06T14:58:45.058Z", "expertises_users_url"=>"https://api.intra.42.fr/v2/expertises/net/expertises_users"}, "user"=>{"id"=>61, "login"=>"dartcaed", "url"=>"https://api.intra.42.fr/v2/users/dartcaed"}}