GET /v2/expertises
Return all the expertises
live_help Notes
chrome_reader_mode
This resource is paginated by 30 items
settings Params
Param name | Description |
---|---|
sort |
optional
. Must be one of: id , name , slug , created_at , updated_at , kind .
The sort field. Sorted by created_at desc, id desc by default. MoreExample:To sort on expertises on the fields updated_at on a descending order and kind on a ascending order: ...&sort=-updated_at,kind |
filter |
optional
. Must be one of: id , name , slug , created_at , updated_at , kind .
Filtering on one or more fields MoreExample:
To filter on expertises with the
...&filter[id]=a_value,another_value Filterable fields:
|
range |
optional
. Must be one of: id , name , slug , created_at , updated_at , kind .
Select on a particular range MoreExample:
To range on expertises with the
...&range[kind]=min_value,max_value Rangeable fields:
|
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 |
Examples
GET /v2/expertises
200
[
{
"id": 10,
"name": "Magic",
"slug": "magic",
"url": "https://api.intra.42.fr/v2/expertises/magic",
"kind": "languages",
"created_at": "2017-11-22T13:41:01.825Z",
"expertises_users_url": "https://api.intra.42.fr/v2/expertises/magic/expertises_users"
},
{
"id": 9,
"name": "Elixir",
"slug": "elixir",
"url": "https://api.intra.42.fr/v2/expertises/elixir",
"kind": "languages",
"created_at": "2017-11-22T13:41:01.819Z",
"expertises_users_url": "https://api.intra.42.fr/v2/expertises/elixir/expertises_users"
},
{
"id": 8,
"name": "iOS",
"slug": "ios",
"url": "https://api.intra.42.fr/v2/expertises/ios",
"kind": "frameworks",
"created_at": "2017-11-22T13:41:01.814Z",
"expertises_users_url": "https://api.intra.42.fr/v2/expertises/ios/expertises_users"
}
]
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/expertises"
[
{
"id": 10,
"name": "Magic",
"slug": "magic",
"url": "https://api.intra.42.fr/v2/expertises/magic",
"kind": "languages",
"created_at": "2017-11-22T13:41:01.825Z",
"expertises_users_url": "https://api.intra.42.fr/v2/expertises/magic/expertises_users"
},
{
"id": 9,
"name": "Elixir",
"slug": "elixir",
"url": "https://api.intra.42.fr/v2/expertises/elixir",
"kind": "languages",
"created_at": "2017-11-22T13:41:01.819Z",
"expertises_users_url": "https://api.intra.42.fr/v2/expertises/elixir/expertises_users"
},
{
"id": 8,
"name": "iOS",
"slug": "ios",
"url": "https://api.intra.42.fr/v2/expertises/ios",
"kind": "frameworks",
"created_at": "2017-11-22T13:41:01.814Z",
"expertises_users_url": "https://api.intra.42.fr/v2/expertises/ios/expertises_users"
}
]
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/expertises")
response.status
# => 200
response.parsed
# => [{"id"=>10, "name"=>"Magic", "slug"=>"magic", "url"=>"https://api.intra.42.fr/v2/expertises/magic", "kind"=>"languages", "created_at"=>"2017-11-22T13:41:01.825Z", "expertises_users_url"=>"https://api.intra.42.fr/v2/expertises/magic/expertises_users"}, {"id"=>9, "name"=>"Elixir", "slug"=>"elixir", "url"=>"https://api.intra.42.fr/v2/expertises/elixir", "kind"=>"languages", "created_at"=>"2017-11-22T13:41:01.819Z", "expertises_users_url"=>"https://api.intra.42.fr/v2/expertises/elixir/expertises_users"}, {"id"=>8, "name"=>"iOS", "slug"=>"ios", "url"=>"https://api.intra.42.fr/v2/expertises/ios", "kind"=>"frameworks", "created_at"=>"2017-11-22T13:41:01.814Z", "expertises_users_url"=>"https://api.intra.42.fr/v2/expertises/ios/expertises_users"}]