Hi,
We have updated the API and we will put the documentation online later this week.
Here is an example of how to call the API, and this API only works on the server-side it can’t be called in the browser. By default, you get 10 reservations per page.
<?php
$post_variables = array('key' => '539houiBOVF5G0KGZM1ZxdHLGoox9ebc-1');//the key from you Pinpoint Bookin System Dashboard
$get_variables = array('dopbsp_api' => 'true',
'action' => 'get',
'data' => 'reservations',
// 'start_date' => 'YYYY-MM-DD',
// 'end_date' => 'YYYY-MM-DD',
// 'start_hour' => 'HH:MM',
// 'end_hour' => 'HH:MM',
'status' => 'expired',
'payment_methods' => 'redsys' ,
//'search' => 'email',
// 'page' => '{page number}',
// 'per_page' => '{the number of reservations per page}',
'order' => 'DESC',
'order_by' => 'id'
);
$link = 'https://your-domain.com';
// 'start_date' => 'YYYY-MM-DD'
// 'end_date' => 'YYYY-MM-DD'
// 'start_hour' => 'HH:MM'
// 'end_hour' => 'HH:MM'
// 'status' => 'pending' | 'approved' | 'rejected' | 'canceled' | 'expired'
// 'payment_methods' => 'none' | 'default' | 'woocommerce' | 'paypal' | 'stripe' | ...
// 'search' => '{search term}'
// 'page' => '{page number}'
// 'per_page' => '{the number of reservations per page}'
// 'order' => 'ASC' | 'DESC'
// 'order_by' => 'check_in' | 'check_out' | 'start_our' | 'end_hour' | 'id' | 'status' | 'date_created'
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $link.'?'.implode('&', array_map(function($value, $key){return $key.'='.$value;}, $get_variables, array_keys($get_variables))));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_variables);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec($ch);
curl_close ($ch);
echo '<pre>';
print_r(json_decode($server_output));
echo '</pre>';