List Events
This endpoint allows you to retrieve information about all events created within Slotify.
Authentication
This endpoint needs app token for authentication.
Method | GET |
---|---|
Endpoint | v1/events |
Headers | Accept: application/json |
Authorization: Bearer <base64_encoded_token> | |
Token Type | Member Token |
Query Parameters
This endpoint supports query parameters:
Field | Value | Description |
---|---|---|
include | calendar | show user calendar |
search | start_at, end_at | search with start and end date |
Example Request:
The following code shows how to send request to retrieve events in Slotify API:
- PHP
- BASH
$endpoint = 'https://api.slotify.ca/v1/events';
$memberToken = base64_encode('email:user_token');
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $endpoint,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer ' . $memberToken,
'Accept: application/json',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
if(curl_errno($curl)) {
echo 'Error: ' . curl_error($curl);
} else {
echo $response;
}
curl_close($curl);
curl -X GET \
https://api.slotify.ca/v1/events \
-H 'Authorization: Bearer ' \
-H 'Accept: application/json'
Example Response:
T following response will be provided by Slotify server when this endpoint is called:
- 200 Ok
{
"data": [
{
"bookingUuid": null,
"uuid": "23433a06-699f-4830-9be2-3c4db268a49a",
"what": "Sample Event",
"color": "#fb923c",
"end_at": "2024-10-13T17:00:00+00:00",
"location": null,
"start_at": "2024-10-13T09:00:00+00:00",
"created_at": "2024-10-01T22:43:43+00:00",
"updated_at": "2024-10-01T22:43:43+00:00",
"description": "catch the light"
}
],
"perPage": 25,
"currentPage": 1,
"total": 1,
"totalPages": 1
}