• Hi Team,
    How can I use the local API? I find the API key, but I couldn’t find documentationhow to use it. I would like to download all reservations through api.
    Could you send me an example?What is the api link?
    For example:
    Get request:
    https://yourwebsite.com/pinpont/rest/get
    Params:
    Content-type: json
    Api-key: yourapikey
    What are the possibilities? Only get reservations? Can I delete it or set a new one?

    Thanks for your help.
    Regards,
    pacman789

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Pinpoint World Support

    (@pinpointworld)

    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>';
     

    Any news on this?
    I’m interested in API access as well. We would like to create an Android app, which will let customers book on our site. Can you please provide some API documentation for this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘API Access’ is closed to new replies.