Skip to content

Official PHP SDK for ETG APIv3 (RateHawk.com, ZenHotels.com, B2B.Ostrovok.ru, Ostrovok.ru)

License

Notifications You must be signed in to change notification settings

EmergingTravel/papi-sdk-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pAPI SDK

main workflow license downloads/month php version

pAPI SDK is a PHP SDK for ETG APIv3. The abbreviation "pAPI" stands for "Partner API". To know more about the benefits of our API integration or to sign up please check our website.

Requirements

  • PHP 7.2+

The package depends on the following:

Installation

composer require emerging-travel/papi-sdk-php

Quickstart

To start using ETG APIv3 you need a key, which you received after registration. A key is a combination of an id and uuid. These are passed into each request as a Basic Auth header after initialization. APIv3 supports all arguments provided by guzzle.

require 'vendor/autoload.php';
use PAPI\APIv3\Client;

$client = new Client('1000:022a2cf1-d279-02f3-9c3c-596aa09b827b');

Then you can use all available methods. Say you want to check an overview of the available methods (which is api/b2b/v3/overview endpoint), you do:

$overview = $client->overview()

Note: if you don't provide your headers and specifically your User-Agent in requests options then it will be automatically added, ex. papi_sdk/v1.0.0 GuzzleHttp/7 (php/7.4.20)