live_help Notes

chrome_reader_mode This resource is paginated by 30 items

settings Params

Param name Description
partnership_id optional . Must be String

The partnership id or slug

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

The sort field. Sorted by created_at desc by default.

Example:

To sort on partnerships users on the fields updated_at on a descending order and final_mark on a ascending order:

...&sort=-updated_at,final_mark

filter optional . Must be one of: id, partnership_id, user_id, created_at, updated_at, final_mark.

Filtering on one or more fields

Example:

To filter on partnerships users with the id field matching a_value or another_value:

...&filter[id]=a_value,another_value

Filterable fields:
  • id (standard field)
  • partnership_id (standard field)
  • user_id (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • final_mark (standard field)
range optional . Must be one of: id, partnership_id, user_id, created_at, updated_at, final_mark.

Select on a particular range

Example:

To range on partnerships users with the final_mark field between min_value and max_value:

...&range[final_mark]=min_value,max_value

Rangeable fields:
  • id
  • partnership_id
  • user_id
  • created_at
  • updated_at
  • final_mark
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

comments powered by <span class='logo-disqus'>Disqus</span>
GET /v2/partnerships_users
200
[
  {
    "id": 5,
    "partnership_id": 1,
    "final_mark": null,
    "user": {
      "id": 77,
      "login": "bofett",
      "url": "https://api.intra.42.fr/v2/users/bofett"
    }
  },
  {
    "id": 4,
    "partnership_id": 1,
    "final_mark": null,
    "user": {
      "id": 12,
      "login": "kiki-adi",
      "url": "https://api.intra.42.fr/v2/users/kiki-adi"
    }
  },
  {
    "id": 3,
    "partnership_id": 1,
    "final_mark": null,
    "user": {
      "id": 14,
      "login": "pamidala",
      "url": "https://api.intra.42.fr/v2/users/pamidala"
    }
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/partnerships_users"

[
  {
    "id": 5,
    "partnership_id": 1,
    "final_mark": null,
    "user": {
      "id": 77,
      "login": "bofett",
      "url": "https://api.intra.42.fr/v2/users/bofett"
    }
  },
  {
    "id": 4,
    "partnership_id": 1,
    "final_mark": null,
    "user": {
      "id": 12,
      "login": "kiki-adi",
      "url": "https://api.intra.42.fr/v2/users/kiki-adi"
    }
  },
  {
    "id": 3,
    "partnership_id": 1,
    "final_mark": null,
    "user": {
      "id": 14,
      "login": "pamidala",
      "url": "https://api.intra.42.fr/v2/users/pamidala"
    }
  }
]
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/partnerships_users")
response.status
# => 200
response.parsed
# => [{"id"=>5, "partnership_id"=>1, "final_mark"=>nil, "user"=>{"id"=>77, "login"=>"bofett", "url"=>"https://api.intra.42.fr/v2/users/bofett"}}, {"id"=>4, "partnership_id"=>1, "final_mark"=>nil, "user"=>{"id"=>12, "login"=>"kiki-adi", "url"=>"https://api.intra.42.fr/v2/users/kiki-adi"}}, {"id"=>3, "partnership_id"=>1, "final_mark"=>nil, "user"=>{"id"=>14, "login"=>"pamidala", "url"=>"https://api.intra.42.fr/v2/users/pamidala"}}]