live_help Notes

chrome_reader_mode This resource is paginated by 30 items

settings Params

Param name Description
coalition_id optional . Must be String

The coalition id or slug

user_id optional . Must be String

The user id or slug

sort optional . Must be one of: id, coalition_id, user_id, created_at, updated_at.

The sort field. Sorted by created_at desc by default.

Example:

To sort on coalitions users on the fields created_at on a descending order and updated_at on a ascending order:

...&sort=-created_at,updated_at

page optional . Must be a Hash

The pagination params, as a hash

page[number] optional . Must be Fixnum

The current page

page[size] optional . Must be Fixnum

The number of items per page, defaults to 30, maximum 100

coalitions_user optional , nil allowed . Must be a Hash
coalitions_user[coalition_id] optional . Must be Fixnum

The coalition id.

coalitions_user[user_id] optional . Must be Fixnum

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

comments powered by <span class='logo-disqus'>Disqus</span>
GET /v2/coalitions_users
200
[
  {
    "id": 4,
    "coalition_id": 1,
    "user_id": 67,
    "created_at": "2017-11-22T13:42:09.775Z",
    "updated_at": "2017-11-22T13:42:09.775Z"
  },
  {
    "id": 3,
    "coalition_id": 1,
    "user_id": 25,
    "created_at": "2017-11-22T13:42:09.750Z",
    "updated_at": "2017-11-22T13:42:09.750Z"
  },
  {
    "id": 2,
    "coalition_id": 2,
    "user_id": 23,
    "created_at": "2017-11-22T13:42:09.723Z",
    "updated_at": "2017-11-22T13:42:09.723Z"
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/coalitions_users"

[
  {
    "id": 4,
    "coalition_id": 1,
    "user_id": 67,
    "created_at": "2017-11-22T13:42:09.775Z",
    "updated_at": "2017-11-22T13:42:09.775Z"
  },
  {
    "id": 3,
    "coalition_id": 1,
    "user_id": 25,
    "created_at": "2017-11-22T13:42:09.750Z",
    "updated_at": "2017-11-22T13:42:09.750Z"
  },
  {
    "id": 2,
    "coalition_id": 2,
    "user_id": 23,
    "created_at": "2017-11-22T13:42:09.723Z",
    "updated_at": "2017-11-22T13:42:09.723Z"
  }
]
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

response = token.get("/v2/coalitions_users")
response.status
# => 200
response.parsed
# => [{"id"=>4, "coalition_id"=>1, "user_id"=>67, "created_at"=>"2017-11-22T13:42:09.775Z", "updated_at"=>"2017-11-22T13:42:09.775Z"}, {"id"=>3, "coalition_id"=>1, "user_id"=>25, "created_at"=>"2017-11-22T13:42:09.750Z", "updated_at"=>"2017-11-22T13:42:09.750Z"}, {"id"=>2, "coalition_id"=>2, "user_id"=>23, "created_at"=>"2017-11-22T13:42:09.723Z", "updated_at"=>"2017-11-22T13:42:09.723Z"}]