2017 © Pedro Peláez
 

library bazaarvoice-request

PHP library for making requests to Bazaarvoice API.

image

mikemiles86/bazaarvoice-request

PHP library for making requests to Bazaarvoice API.

  • Tuesday, July 11, 2017
  • by mikemiles86
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,751 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 15 % Grown

The README.md

bazaarvoice-request

PHP library for making requests to Bazaarvoice APIs, (*1)

Bazaarvoice Request Library

Latest Version on Packagist Software License Total Downloads, (*2)

PHP library for making requests to Bazaarvoice APIs and handling responses., (*3)

Install

Via Composer, (*4)

``` bash $ composer require mikemiles86/bazaarvoice-request, (*5)


## Usage ### Creating a Request ``` php $client = new \GuzzleHttp\Client(); $api_key = '12345abcd'; $bazaarvoice_request = new \BazaarvoiceRequest\BazaarvoiceRequest($client, $api_key);

Making a request

``` php, (*6)

$client = new \GuzzleHttp\Client(); $api_key = '12345abcd'; $bazaarvoice_request = new \BazaarvoiceRequest\BazaarvoiceRequest($client, $api_key);, (*7)

$reviews = $bazaarvoice_request->apiRequest('data/reviews');, (*8)


#### Making a staging request ``` php $client = new \GuzzleHttp\Client(); $api_key = '12345abcd'; $bazaarvoice_request = new \BazaarvoiceRequest\BazaarvoiceRequest($client, $api_key); $reviews = $bazaarvoice_request->useStage()->apiRequest('data/reviews');

Making a request with additional configurations

``` php $client = new \GuzzleHttp\Client(); $api_key = '12345abcd'; $bazaarvoice_request = new \BazaarvoiceRequest\BazaarvoiceRequest($client, $api_key);, (*9)

$configuration = [ 'method' => 'POST', 'options' => [ 'headers' => [ 'X-Forwarded-For' => '127.0.0.1', ], ], ];, (*10)

$reviews = $bazaarvoice_request->apiRequest('data/reviews', $configuration);, (*11)


``` php $client = new \GuzzleHttp\Client(); $api_key = '12345abcd'; $bazaarvoice_request = new \BazaarvoiceRequest\BazaarvoiceRequest($client, $api_key); $configuration = [ 'arguments' => [ 'ProductId' => 'my_product_123', ], ]; $product_reviews = $bazaarvoice_request->->apiRequest('data/reviews', $configuration);

Get values from a response

``` php, (*12)

$client = new \GuzzleHttp\Client(); $api_key = '12345abcd'; $bazaarvoice_request = new \BazaarvoiceRequest\BazaarvoiceRequest($client, $api_key);, (*13)

$response = $bazaarvoice_request->useStage()->apiRequest('data/reviews');, (*14)

$reviews = $response->getResponse('Results');, (*15)


#### Get errors from a response ``` php $client = new \GuzzleHttp\Client(); $api_key = '12345abcd'; $bazaarvoice_request = new \BazaarvoiceRequest\BazaarvoiceRequest($client, $api_key); $response = $bazaarvoice_request->useStage()->apiRequest('data/reviews'); if ($response->getStatusCode() != '200' || $response->hasErrors()) { $errors = $response->getErrors(); }

Testing

bash $ composer test, (*16)

Credits

License

The MIT License (MIT). Please see License File for more information., (*17)

The Versions

11/07 2017

dev-master

9999999-dev https://github.com/mikemiles86/bazaarvoice-request

PHP library for making requests to Bazaarvoice API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles

bazaarvoice

11/07 2017

1.0.3

1.0.3.0 https://github.com/mikemiles86/bazaarvoice-request

PHP library for making requests to Bazaarvoice API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles

bazaarvoice

31/05 2017

dev-1.0.x-dev

dev-1.0.x-dev https://github.com/mikemiles86/bazaarvoice-request

PHP library for making requests to Bazaarvoice API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles

bazaarvoice

31/05 2017

1.0.2

1.0.2.0 https://github.com/mikemiles86/bazaarvoice-request

PHP library for making requests to Bazaarvoice API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles

bazaarvoice

24/05 2017

1.0.1

1.0.1.0 https://github.com/mikemiles86/bazaarvoice-request

PHP library for making requests to Bazaarvoice API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles

bazaarvoice

18/05 2017

1.0.0

1.0.0.0 https://github.com/mikemiles86/bazaarvoice-request

PHP library for making requests to Bazaarvoice API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles

bazaarvoice