emerging-travel / papi-sdk-php
pAPI SDK is a PHP SDK for ETG APIv3
Installs: 1 190
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: ^7.2.5 || ^8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.3
- netresearch/jsonmapper: ^4.0
This package is not auto-updated.
Last update: 2025-04-27 02:14:19 UTC
README
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)