GET /v2/slots
Return all the slots
GET /v2/projects/:project_id/slots
Return all the slots of the given Project
GET /v2/users/:user_id/slots
Return all the slots of the given User
GET /v2/me/slots
Return all the slots for the current resource owner
A Slot is a time interval when a user desclares himself available to evaluate other users. Actually, a slot must be at least 1800 minutes by default (with a granularity of 15 minutes). Campus can manage and edit the minimum slot duration. A slot can be set every day between 30 minutes and 2 weeks in advance.
This call obviously lists all slots.
An user without the advanced tutor
role can’t set the user_id
or the scale_team_id
parameter.
-
if there is a resource owner (an user uses this api trough your app, with the web application flow):
- The
/me/slots
endpoint will list all the slots set by the current user. - The
/projects/:project_id/slots
endpoint will list all the available slots for the given project. Theses slots can be booked by the current user in order to make a defense.
- The
-
if there isn’t a resource owner
- The
/projects/:project_id/slots
endpoint lists all the slots scheduled (with ascale_team
) on this project, including all the past ones. - The
/users/:user_id/slots
endpoint lists all the slots for the requested user, as evaluator and as evaluated. This call is restricted.
- The
In all the cases, the /slots
endpoint lists all the slots, booked or not, including all the past ones.
live_help Notes
settings Params
Param name | Description |
---|---|
project_id |
optional
. Must be String
The project id or slug |
user_id |
optional
. Must be String
The user id or slug |
sort |
optional
. Must be one of: id , begin_at , end_at , user_id , created_at , scale_team_id .
The sort field. Sorted by id desc by default. MoreExample:To sort on slots on the fields created_at on a descending order and scale_team_id on a ascending order: ...&sort=-created_at,scale_team_id |
filter |
optional
. Must be one of: id , begin_at , end_at , created_at , campus_id , future , end .
Filtering on one or more fields MoreExample:
To filter on slots with the
...&filter[id]=a_value,another_value Filterable fields:
|
range |
optional
. Must be one of: id , begin_at , end_at , created_at .
Select on a particular range MoreExample:
To range on slots with the
...&range[created_at]=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/slots
200
[
{
"id": 27,
"begin_at": "2017-11-24T20:15:00.000Z",
"end_at": "2017-11-24T20:30:00.000Z",
"scale_team": null,
"user": "invisible"
},
{
"id": 76,
"begin_at": "2017-11-24T20:15:00.000Z",
"end_at": "2017-11-24T20:30:00.000Z",
"scale_team": null,
"user": "invisible"
},
{
"id": 110,
"begin_at": "2017-11-24T20:15:00.000Z",
"end_at": "2017-11-24T20:30:00.000Z",
"scale_team": null,
"user": "invisible"
}
]
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/slots"
[
{
"id": 27,
"begin_at": "2017-11-24T20:15:00.000Z",
"end_at": "2017-11-24T20:30:00.000Z",
"scale_team": null,
"user": "invisible"
},
{
"id": 76,
"begin_at": "2017-11-24T20:15:00.000Z",
"end_at": "2017-11-24T20:30:00.000Z",
"scale_team": null,
"user": "invisible"
},
{
"id": 110,
"begin_at": "2017-11-24T20:15:00.000Z",
"end_at": "2017-11-24T20:30:00.000Z",
"scale_team": null,
"user": "invisible"
}
]
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/slots")
response.status
# => 200
response.parsed
# => [{"id"=>27, "begin_at"=>"2017-11-24T20:15:00.000Z", "end_at"=>"2017-11-24T20:30:00.000Z", "scale_team"=>nil, "user"=>"invisible"}, {"id"=>76, "begin_at"=>"2017-11-24T20:15:00.000Z", "end_at"=>"2017-11-24T20:30:00.000Z", "scale_team"=>nil, "user"=>"invisible"}, {"id"=>110, "begin_at"=>"2017-11-24T20:15:00.000Z", "end_at"=>"2017-11-24T20:30:00.000Z", "scale_team"=>nil, "user"=>"invisible"}]