-
Notifications
You must be signed in to change notification settings - Fork 5
API Clients
Once you've familiarised yourself with the API documentation you'll want to start writing some code to communicate with the API. Being a RESTful api, you're able to write in any language that is capable of making HTTP requests and can interpret JSON.
We strongly recommend that you make use of an API client within your code, in order to simplify the integration process. A list of your options are available below.
Our light-weight API client can be downloaded from https://github.com/CarltonSoftware/api-documentation/blob/master/examples/php-curl/helpers/src/tabs/api/client/ApiClient.php. The lightweight API client allows a developer to make simple GET/POST/PUT requests to the API, with all of the complicated authentication and headers being handled automatically.
// new curl request
$client = \tabs\api\client\ApiClient::factory(APIURL, APIKEY, APISECRET);
$url = sprintf('/property/%s_%s', $propRef, $brandCode);
$res = $client->get($url);
$property = $res->response;
print $property->name;
In addition to our lite API client, we also offer a full version. Rather than making GET/POST/PUT requests from within your code, all of the API functions are available through PHP objects.
$property = \tabs\api\property\Property::getProperty($propRef, $brandCode);
echo $property->getName();
This is a paid for product, if you're interested please get in touch with us so we can advise you on pricing.
You can also access the tabs api via a third party api client such as guzzle. We have developed a plugin for guzzle (via its subscriber interface) which handles the authentication needed to access tabs api data. For a working example, see here: https://github.com/CarltonSoftware/api-documentation/tree/master/examples/guzzle.
If you're not developing in PHP (or have chosen not to use either of the API clients we supply) you will need to develop your own client. Before you do though, you may want to ask on our developer forum to see if anyone else has written an API client in your language of choice, who may wish to exchange their work.