Skip to content

groupby/gb-retailapi-php-client

Repository files navigation

GbRetailApiClient

GroupBy Retail API

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/groupby/gb-retailapi-php-client.git"
    }
  ],
  "require": {
    "groupby/gb-retailapi-php-client": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/GbRetailApiClient/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure HTTP basic authorization: GroupByIncEmployee
$config = Groupby\RetailApiClient\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

// Configure API key authorization: ClientKey
$config = Groupby\RetailApiClient\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Groupby\RetailApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new Groupby\RetailApiClient\Api\AutocompleteApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$x_groupby_customer_id = 'x_groupby_customer_id_example'; // string | Header on incoming HTTP requests that is populated by the API gateway and indicates the customer ID.
$identity = new \Groupby\RetailApiClient\Model\Identity(); // Identity
$merchandiser = new \Groupby\RetailApiClient\Model\Merchandiser(); // Merchandiser
$request = new \Groupby\RetailApiClient\Model\Request(); // Request | Object which is represent autocomplete request and encapsulate all passed parameters.

try {
    $result = $apiInstance->autocompletesearch($x_groupby_customer_id, $identity, $merchandiser, $request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AutocompleteApi->autocompletesearch: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
AutocompleteApi autocompletesearch GET /api/request
ProductApi getByProductIds GET /api/search/product Provided product search functionality
RecommendationsAPIApi predict POST /api/predict Provide Recommendations AI functionality.
RecommendationsAPIApi predictV2 POST /api/recommendation Provide Recommendations AI functionality.
SearchApi facetSearch POST /api/search/facet Provided search functionality
SearchApi search POST /api/search Provided search functionality

Models

Authorization

Authentication schemes defined for the API:

ClientKey

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

GroupByIncEmployee

  • Type: HTTP basic authentication

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 0.0.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors