2017 © Pedro Peláez
 

library emsearch-php-client

emsearch Api PHP Client

image

emsearch/emsearch-php-client

emsearch Api PHP Client

  • Friday, March 2, 2018
  • by emsearch
  • Repository
  • 0 Watchers
  • 0 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

emsearch API PHP client

Requirements

The only lib required is Guzzle, PHP HTTP client., (*1)

Installation

composer require emsearch/emsearch-php-client

OpenAPI specification file

This PHP client lib was generated using the openapi.json file located in the root directory. Copy this file content in editor.swagger.io to see all the possibilities., (*2)

Use

Initialize the client

emsearch API uses OAuth2 access authentication., (*3)

The first parameter must be a valid access token. The second parameter is the API entry point url. The third one is optional and is an array of headers that will be apply to every requests of the internal Guzzle client, allowing to specify the accepted language for errors eg., (*4)

/** @var \Emsearch\Api\ApiClient $apiClient */
$apiClient = new \Emsearch\Api\ApiClient(
    $token,
    'https://emsearch-api-entry-point.tld',
    ['Accept-Language' => 'en']
);

Request resources with managers

Handle resources requesting with the main API client object like this :, (*5)

/** @var \Emsearch\Api\Resources\UserResponse $userResponse */
$userResponse = $apiClient->MeManager()->getUser();

/** @var \Emsearch\Api\Resources\User $me */
$me = $userResponse->data;

TODO

More documentation to come with the first release..., (*6)

Features to come : - Link to the main documentation - Generated unit test, (*7)

The Versions

02/03 2018

dev-master

9999999-dev https://github.com/emsearch/emsearch-php-client

emsearch Api PHP Client

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ryan Gilles

php sdk ems-search emsearch