Return actual bookings in JSON. Actual means that booking ending date is greater than request time. You can filter output applying REGEX.
Output fields:
result
: key that will contain every found booking record that matches filter, if set. Each sub-key of result
is a booking ID, which contains booking details:
cid
: VATSIM ID of member who will provide ATC service on booked positionname
: name of memberpostition
: ATC position nameto/from
: fields that describes ATC session range in format 'YYYY-MM-DD HH:MM:SS'info
: this key will contain value found
that will represent number of found booking recordsUsage
Endpoint: /booking
Request method: GET
Headers:
Header parameter | Description | |
---|---|---|
X-API-Key |
Your unique API key | |
filter |
REGEX-string that will be applied to filter output. If not set - will return all actual booking records. Refer to manual to get familiar with Python regular expressions. You can also test your expression here. |
Example request:
Python
import requests
url = "https://api.vacc-ua.org/api/booking"
headers = {
'X-API-Key': "123456",
'filter': "^.*APP$",
'Cache-Control': "no-cache"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_PORT => "443",
CURLOPT_URL => "https://api.vacc-ua.org/api/booking",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Cache-Control: no-cache",
"X-API-Key: 123456",
"filter: ^.*APP$"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Example response:
{
"info": {
"found": 1
},
"result": {
"2": {
"cid": "1300518",
"from": "2018-05-03 19:00:00",
"name": "Andrey Prokhorov",
"position": "UKBB_APP",
"to": "2018-05-03 20:00:00"
}
}
}