Authentication

To use the BookingBnb functions, you need to acquire a token. Then, the token will be sent as first argument to the available functions.

Acquiring the token

URL: https://api.bookingbnb.com/xrws/AcquireToken/

In order to acquire the token, you'll have to use the following function:

AcquireToken(user, password)

The arguments user and password are the credentials that a partner uses to enter the BookingBnb Control Panel.

The AcquireToken function returns a token, which must be treated as a string. So, for example, your code should be:


<?php
// Assign credential values
$user="YourUser";
$pass="YourPassword";

// Send a message to the server
$args = array(
	new xmlrpcval($user, 'string'), 
	new xmlrpcval($pass, 'string'));
$message = new xmlrpcmsg('xrws.AcquireToken', $args);
$result = $server->send($message);
	
// Process the response
if (!$result) {
    print "Could not connect to HTTP server.";
} elseif ($result->faultCode()) {
    print "XML-RPC Fault #" . $result->faultCode() . ": " .
        $result->faultString();
} else {
    $struct = $result->value();	
    $response = $struct->structmem('response');
    $response = $response->scalarval();
    header("Content-type: text/xml");
    print $response;
}
?>
Your IP matters. Once acquired, the token will only work with the IP from which you acquired it.

Property Identifier

Most of the BookingBnb fuctions require, as additional argument, the propertyID parameter. The propertyID is an integer, uniquely identifying a property.

It can be found by:

  1. Entering the BookingBnb Control Panel and visiting the Dashoboard;
  2. Using the BookingBnb function GetProperties.