Delete Booking


Delete existing ATC booking record

Output fields:

  • result: result of booking operation. Can be either "OK" or "ERROR"
  • msg: description of operation result

Usage

Endpoint: /booking

Request method: DELETE

Headers:

Header parameterDescription
X-API-Key Your unique API key
Content-Type This required to be set to application/x-www-form-urlencoded

Payload:

KeyValue description
hash Hash that was obtained as result of booking request

Example request:

Python

    import requests

    url = "https://api.vacc-ua.org/api/booking"

    payload = "hash=9953f98f9bfa1e547eedc156f0bb34f15a800b943a8f008ec267fbf0b438f109"
    headers = {
        'X-API-Key': "123456",
        'Content-Type': "application/x-www-form-urlencoded",
        'Cache-Control': "no-cache"
    }

    response = requests.request("DELETE", url, data=payload, 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 => "DELETE",
        CURLOPT_POSTFIELDS => "hash=9953f98f9bfa1e547eedc156f0bb34f15a800b943a8f008ec267fbf0b438f109",
        CURLOPT_HTTPHEADER => array(
            "Cache-Control: no-cache",
            "Content-Type: application/x-www-form-urlencoded",
            "X-API-Key: 123456"
        ),
    ));

    $response = curl_exec($curl);
    $err = curl_error($curl);

    curl_close($curl);

    if ($err) {
        echo "cURL Error #:" . $err;
    } else {
        echo $response;
    }

Example response:


{
    "msg": "Booking record ID 2 was deleted successfully",
    "result": "OK"
}