id
: UUID, a unique identifierarea
: String, an identifier for an area, one of: 'Helsinki', 'Tampere', 'Turku'booked
: Boolean, true if booked, false if not bookedstartTime
: Int, Unix epoch timestamp, the starting time for the shiftendTime
: Int, Unix epoch timestamp, the ending time for the shift
All end-points implement parameter validation and error handling.
Returns all shifts
Example:
GET /shifts
[
{
"id": "95a2aaca-bab8-4504-8646-f75b325ec0e7",
"booked": false,
"area": "Helsinki",
"startTime": 1523610000000,
"endTime": 1523617200000
},
{
"id": "001e40e5-05dc-4b9d-bdc5-cae63f651970",
"booked": true,
"area": "Tampere",
"startTime": 1523602800000,
"endTime": 1523610000000
}
]
Returns a single shift by ID
Example:
GET /shifts/95a2aaca-bab8-4504-8646-f75b325ec0e7
{
"id": "95a2aaca-bab8-4504-8646-f75b325ec0e7",
"booked": false,
"area": "Helsinki",
"startTime": 1523610000000,
"endTime": 1523617200000
}
Books a shift by ID
Notes:
- Already booked shifts cannot be booked
- Already started shifts cannot be booked
- Shifts with overlapping times cannot be booked
Example:
POST /shifts/95a2aaca-bab8-4504-8646-f75b325ec0e7/book
{
"id": "95a2aaca-bab8-4504-8646-f75b325ec0e7",
"booked": true,
"area": "Helsinki",
"startTime": 1523610000000,
"endTime": 1523617200000
}
Cancels a shift by ID
Notes:
- Already cancelled/non-booked shifts cannot be cancelled
Example:
POST /shifts/95a2aaca-bab8-4504-8646-f75b325ec0e7/cancel
{
"id": "95a2aaca-bab8-4504-8646-f75b325ec0e7",
"booked": false,
"area": "Helsinki",
"startTime": 1523610000000,
"endTime": 1523617200000
}
Bugs in the API? Please report any bugs with a GitHub issue.