承接 mikemiles86/bazaarvoice-request 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mikemiles86/bazaarvoice-request

最新稳定版本:1.0.4

Composer 安装命令:

composer require mikemiles86/bazaarvoice-request

包简介

PHP library for making requests to Bazaarvoice API.

关键字:

README 文档

README

PHP library for making requests to Bazaarvoice APIs

Bazaarvoice Request Library

Latest Version on Packagist Software License Total Downloads

PHP library for making requests to Bazaarvoice APIs and handling responses.

Install

Via Composer

$ composer require mikemiles86/bazaarvoice-request

Usage

Creating a Request

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

Making a request

$client = new \GuzzleHttp\Client(); $api_key = '12345abcd'; $bazaarvoice_request = new \BazaarvoiceRequest\BazaarvoiceRequest($client, $api_key); $reviews = $bazaarvoice_request->apiRequest('data/reviews');

Making a staging request

$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

$client = new \GuzzleHttp\Client(); $api_key = '12345abcd'; $bazaarvoice_request = new \BazaarvoiceRequest\BazaarvoiceRequest($client, $api_key); $configuration = [ 'method' => 'POST', 'options' => [ 'headers' => [ 'X-Forwarded-For' => '127.0.0.1', ], ], ]; $reviews = $bazaarvoice_request->apiRequest('data/reviews', $configuration);
$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

$client = new \GuzzleHttp\Client(); $api_key = '12345abcd'; $bazaarvoice_request = new \BazaarvoiceRequest\BazaarvoiceRequest($client, $api_key); $response = $bazaarvoice_request->useStage()->apiRequest('data/reviews'); $reviews = $response->getResponse('Results');

Get errors from a response

$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

$ composer test

Credits

License

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

统计信息

  • 总下载量: 60.33k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 9
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04