2017 © Pedro Peláez
 

library bazaarvoice-conversations-api

PHP Wrapper for the Bazaarvoice Conversations API

image

mikemiles86/bazaarvoice-conversations-api

PHP Wrapper for the Bazaarvoice Conversations API

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

The README.md

Bazaarvoice Request Library

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

PHP Wrapper for the Bazaarvoice Conversations API, (*2)

Install

Via Composer, (*3)

``` bash $ composer require mikemiles86/bazaarvoice-conversations-api, (*4)


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

Content Types

All conversation API content types are supported., (*5)

Depending on the specific content type, data can be retrieved and sent to Bazaarvoice., (*6)

Get wrapper for Reviews content type.

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

$conversations_wrapper = new \BazaarvoiceConversations\BazaarvoiceConversations($bazaarvoice_request);, (*8)

$reviews_wrapper = $conversations_wrapper->getContentType('Reviews');, (*9)

#### Make a raw request
``` php
$client = new \GuzzleHttp\Client();
$api_key = '12345abcd';
$bazaarvoice_request = new \BazaarvoiceRequest\BazaarvoiceRequest($client, $api_key);

$conversations_wrapper = new \BazaarvoiceConversations\BazaarvoiceConversations($bazaarvoice_request);

$response = $conversations_wrapper->apiRequest('data/reviews');

Retrieve Content

Retrieve content for Content Type by Id.

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

$conversations_wrapper = new \BazaarvoiceConversations\BazaarvoiceConversations($bazaarvoice_request);, (*11)

$reviews_wrapper = $conversations_wrapper->getContentType('Reviews');, (*12)

$review = $reviews_wrapper->getResultById('review_1234');, (*13)


#### Retrieve content for Content Type by other parameters ``` php $client = new \GuzzleHttp\Client(); $api_key = '12345abcd'; $bazaarvoice_request = new \BazaarvoiceRequest\BazaarvoiceRequest($client, $api_key); $conversations_wrapper = new \BazaarvoiceConversations\BazaarvoiceConversations($bazaarvoice_request); $reviews_wrapper = $conversations_wrapper->getContentType('Reviews'); $configuration = [ 'arguments' => [ 'ProductId' => 'my_product', ], ]; $response = $reviews_wrapper->retrieveRequest($configuration); $product_reviews = $response->getResponse('Results');

Submit Content

Get Submission Form

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

$conversations_wrapper = new \BazaarvoiceConversations\BazaarvoiceConversations($bazaarvoice_request);, (*15)

$reviews_wrapper = $conversations_wrapper->getContentType('Reviews');, (*16)

$reviews_submit_form = $reviews_wrapper->getSubmissionForm();, (*17)

#### Preview Submission
``` php
$client = new \GuzzleHttp\Client();
$api_key = '12345abcd';
$bazaarvoice_request = new \BazaarvoiceRequest\BazaarvoiceRequest($client, $api_key);

$conversations_wrapper = new \BazaarvoiceConversations\BazaarvoiceConversations($bazaarvoice_request);

$reviews_wrapper = $conversations_wrapper->getContentType('Reviews');

$submission_data = [
  'Rating' => 5,
  'ReviewText' => 'This is my Review',
];

$reviews_wrapper->previewSubmission($submission_data);

Submit Submission

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

$conversations_wrapper = new \BazaarvoiceConversations\BazaarvoiceConversations($bazaarvoice_request);, (*19)

$reviews_wrapper = $conversations_wrapper->getContentType('Reviews');, (*20)

$submission_data = [ 'Rating' => 5, 'ReviewText' => 'This is my Review', ];, (*21)

$reviews_wrapper->submitSubmission($submission_data);, (*22)


## Testing ``` bash $ composer test

Credits

License

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

The Versions

11/07 2017

dev-master

9999999-dev https://github.com/mikemiles86/bazaarvoice-conversations-api

PHP Wrapper for the Bazaarvoice Conversations 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-conversations-api

PHP Wrapper for the Bazaarvoice Conversations 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-conversations-api

PHP Wrapper for the Bazaarvoice Conversations API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles

bazaarvoice

25/05 2017

1.0.2

1.0.2.0 https://github.com/mikemiles86/bazaarvoice-conversations-api

PHP Wrapper for the Bazaarvoice Conversations 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-conversations-api

PHP Wrapper for the Bazaarvoice Conversations 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-conversations-api

PHP Wrapper for the Bazaarvoice Conversations API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles

bazaarvoice