API Methods


Bookings

Create new Booking

https://eur.api.matanbudimir.de/api/booking/create


Allows you to submit a new booking to the EURDB. Accepts the "POST" method only.


Parameters:

User ID* : VATSIM CID in the form ####### | Example: 1373921

Start Time* : Start time of the booking in the form Y-m-d H:i:s | Example: 2020-03-13 20:00:00

End Time* : End time of the booking in the form Y-m-d H:i:s | Example: 2020-03-14 12:00:00

Position* : Station Code of the booking in the form XXXX_XX_XXX | Example: LON_SC_CTR


Event : Event Name in the form xxxxxxx | Example: Midweek Madness

Training : Training Boolean in the form 0 or 1 | Example: 0


Code Example:

$token = 'abcdefghijklmn';                                  // Your API Token
    try 
    {
    $response = $client->request('POST', 'api.vatsim.eu/api/booking/create', [
        'headers' => [
            'Accept' => 'applicaton/json',
            'Authorization' => 'Bearer ' . $token,
        ],
        'form_params' => [
            'user_id'       =>      '1373921'
            'start_time'    =>      '2020-03-14 20:00:00',
            'end_time'      =>      '2020-03-14 22:00:00',
            'position'      =>      'LON_SC_CTR',
            'event'         =>      'Midweek Madness',      // Can be null
            'training'      =>       0,                     // Can be null
        ],
    ]);

    } 
    catch (ClientException $exception)
    {
        return $exception->getResponse()->getBody();
    }

    if ($response->getStatusCode() != 200) 
    {
        $data = json_decode($response->getBody());
        return $data->error;
    }

{success} Note: The "uid" and the "id" are returned after a successfull creation of the booking. Store these two values for later use (eg. Update / Remove).


Delete an existing Booking

https://eur.api.matanbudimir.de/api/booking/delete


Allows you to remove an existing booking from the EURDB. Accepts the "POST" method only.


Parameters:

UID* : Unique ID of the booking, returned after the creation of the according booking in the form of xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | Example: iTuV696UFoQPLDBHY4GdUMV3iw5MDlC8VKSclCpK

ID* : Database ID of the booking, returned after the creation of the according booking in the form of ## | Example: 1

Code Example:

$token = 'abcdefghijklmn';                                  // Your API Token
    try 
    {
    $response = $client->request('POST', 'api.vatsim.eu/api/booking/delete', [
        'headers' => [
            'Accept' => 'applicaton/json',
            'Authorization' => 'Bearer ' . $token,
        ],
        'form_params' => [
            'uid'           =>      'iTuV696UFoQPLDBHY4GdUMV3iw5MDlC8VKSclCpK',
            'id'            =>      '1',
        ],
    ]);

    } 
    catch (ClientException $exception)
    {
        return $exception->getResponse()->getBody();
    }

    if ($response->getStatusCode() != 200) 
    {
        $data = json_decode($response->getBody());
        return $data->error;
    }

Update an existing Booking

https://eur.api.matanbudimir.de/api/booking/update


Allows you to update details of an existing booking from the EURDB. Accepts the "POST" method only.


Parameters:

UID* : Unique ID of the booking, returned after the creation of the according booking in the form of xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | Example: iTuV696UFoQPLDBHY4GdUMV3iw5MDlC8VKSclCpK

ID* : Database ID of the booking, returned after the creation of the according booking in the form of ## | Example: 1

User ID* : VATSIM CID in the form ####### | Example: 1373921

Start Time* : Start time of the booking in the form Y-m-d H:i:s | Example: 2020-03-13 20:00:00

End Time* : End time of the booking in the form Y-m-d H:i:s | Example: 2020-03-14 12:00:00

Position* : Station Code of the booking in the form XXXX_XX_XXX | Example: LON_SC_CTR


Event : Event Name in the form xxxxxxx | Example: Midweek Madness

Training : Training Boolean in the form 0 or 1 | Example: 0


Code Example:

$token = 'abcdefghijklmn';                                  // Your API Token
    try 
    {
    $response = $client->request('POST', 'api.vatsim.eu/api/booking/update', [
        'headers' => [
            'Accept' => 'applicaton/json',
            'Authorization' => 'Bearer ' . $token,
        ],
        'form_params' => [
            'uid'           =>      'iTuV696UFoQPLDBHY4GdUMV3iw5MDlC8VKSclCpK',
            'id'            =>      '1',
            'user_id'       =>      '1373921'
            'start_time'    =>      '2020-03-14 20:00:00',
            'end_time'      =>      '2020-03-14 22:00:00',
            'position'      =>      'LON_SC_CTR',
            'event'         =>      'Midweek Madness',      // Can be null
            'training'      =>       0,                     // Can be null
        ],
    ]);

    } 
    catch (ClientException $exception)
    {
        return $exception->getResponse()->getBody();
    }

    if ($response->getStatusCode() != 200) 
    {
        $data = json_decode($response->getBody());
        return $data->error;
    }



Mentor Management

Add a new Mentor

https://xxx


Allows you to add a mentor to your vACC. Accepts the "POST" method only.


Parameters:

Mentor ID* : VATSIM CID in the form ####### | Example: 1373921

Staff ID* : VATSIM CID in the form ####### | Example: 1375048

vACC Code* : vACC Code in the form xxx | Example: SCA


Code Example:

$token = 'abcdefghijklmn';                                  // Your API Token
    try 
    {
    $response = $client->request('POST', 'xxxx', [
        'headers' => [
            'Accept' => 'applicaton/json',
            'Authorization' => 'Bearer ' . $token,
        ],
        'form_params' => [
            'mentor_id'     =>      '1373921'
            'staff_id'      =>      '1375048',
            'vacc_code'     =>      'SCA',
        ],
    ]);

    } 
    catch (ClientException $exception)
    {
        return $exception->getResponse()->getBody();
    }

    if ($response->getStatusCode() != 200) 
    {
        $data = json_decode($response->getBody());
        return $data->error;
    }



Remove a Mentor

https://xxx


Allows you to add a mentor to your vACC. Accepts the "POST" method only.


Parameters:

Mentor ID* : VATSIM CID in the form ####### | Example: 1373921

Staff ID* : VATSIM CID in the form ####### | Example: 1375048

vACC Code* : vACC Code in the form xxx | Example: SCA


Code Example:

$token = 'abcdefghijklmn';                                  // Your API Token
    try 
    {
    $response = $client->request('POST', 'xxxx', [
        'headers' => [
            'Accept' => 'applicaton/json',
            'Authorization' => 'Bearer ' . $token,
        ],
        'form_params' => [
            'mentor_id'     =>      '1373921'
            'staff_id'      =>      '1375048',
            'vacc_code'     =>      'SCA',
        ],
    ]);

    } 
    catch (ClientException $exception)
    {
        return $exception->getResponse()->getBody();
    }

    if ($response->getStatusCode() != 200) 
    {
        $data = json_decode($response->getBody());
        return $data->error;
    }

{danger} NOTE: Returns a 404 error if the mentor cannot be found.


Exam Management

Get list of all Exams

https://xxx


Allows you to get an entire list of Exams and their respective IDs.


Parameters:

Staff ID* : VATSIM CID in the form ####### | Example: 1375048

vACC Code* : vACC Code in the form xxx | Example: SCA


Code Example:

$token = 'abcdefghijklmn';                                  // Your API Token
    try 
    {
    $response = $client->request('POST', 'xxxx', [
        'headers' => [
            'Accept' => 'applicaton/json',
            'Authorization' => 'Bearer ' . $token,
        ],
        'form_params' => [
            'user_id'       =>      '1373921'
            'staff_id'      =>      '1375048',
            'vacc_code'     =>      'SCA',
            'exam_id'       =>      12,
        ],
    ]);

    } 
    catch (ClientException $exception)
    {
        return $exception->getResponse()->getBody();
    }

    if ($response->getStatusCode() != 200) 
    {
        $data = json_decode($response->getBody());
        return $data->error;
    }

{success} Note: The "uid" is returned after a successfull assignment of the exam. This is to be used when retreiving the exam result.



Assign Exam to User

https://xxx


Allows you to assign an exam token to a user of your vACC. Accepts the "POST" method only.


Parameters:

User ID* : VATSIM CID in the form ####### | Example: 1373921

Staff ID* : VATSIM CID in the form ####### | Example: 1375048

vACC Code* : vACC Code in the form xxx | Example: SCA

Exam ID* : Exam is in the form ## | Example: 12 (This can be retreived by logging into the Dashboard and Navigating to vACC Staff => {vACC Name} => Manage Local Exams)


Code Example:

$token = 'abcdefghijklmn';                                  // Your API Token
    try 
    {
    $response = $client->request('POST', 'xxxx', [
        'headers' => [
            'Accept' => 'applicaton/json',
            'Authorization' => 'Bearer ' . $token,
        ],
        'form_params' => [
            'user_id'       =>      '1373921'
            'staff_id'      =>      '1375048',
            'vacc_code'     =>      'SCA',
            'exam_id'       =>      12,
        ],
    ]);

    } 
    catch (ClientException $exception)
    {
        return $exception->getResponse()->getBody();
    }

    if ($response->getStatusCode() != 200) 
    {
        $data = json_decode($response->getBody());
        return $data->error;
    }

{success} Note: The "uid" is returned after a successfull assignment of the exam. This is to be used when retreiving the exam result.



Retreive Exam Result

https://xxx


Allows you to assign an exam token to a user of your vACC. Accepts the "POST" method only.


Parameters:

UID* : Unique ID of the exam, returned after the creation of the according exam in the form of xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | Example: iTuV696UFoQPLDBHY4GdUMV3iw5MDlC8VKSclCpK

Staff ID* : VATSIM CID in the form ####### | Example: 1373921

vACC Code* : vACC Code in the form xxx | Example: SCA


Code Example:

$token = 'abcdefghijklmn';                                  // Your API Token
    try 
    {
    $response = $client->request('POST', 'xxxx', [
        'headers' => [
            'Accept' => 'applicaton/json',
            'Authorization' => 'Bearer ' . $token,
        ],
        'form_params' => [
            'uid'           =>      'iTuV696UFoQPLDBHY4GdUMV3iw5MDlC8VKSclCpK'
            'staff_id'      =>      '1373921',
            'vacc_code'     =>      'SCA',
        ],
    ]);

    } 
    catch (ClientException $exception)
    {
        return $exception->getResponse()->getBody();
    }

    if ($response->getStatusCode() != 200) 
    {
        $data = json_decode($response->getBody());
        return $data->error;
    }

{success} Note: Returns the result of the exam as a boolean (0 / 1).

{danger} Note: Returns a 404 if the exam has not been taken yet.