Skip to content

groupby/gb-retailapi-java-client

Repository files navigation

gb-retailapi-client

GroupBy Retail

  • API version: 0.0.0
    • Build date: 2023-09-28T19:17:28.544199255-04:00[America/Toronto]

GroupBy Retail API

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 1.8+
  2. Maven (3.8.3+)/Gradle (7.2+)

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.groupbyinc</groupId>
  <artifactId>gb-retailapi-client</artifactId>
  <version>0.0.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

  repositories {
    mavenCentral()     // Needed if the 'gb-retailapi-client' jar has been published to maven central.
    mavenLocal()       // Needed if the 'gb-retailapi-client' jar has been published to the local maven repo.
  }

  dependencies {
     implementation "com.groupbyinc:gb-retailapi-client:0.0.0"
  }

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/gb-retailapi-client-0.0.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

// Import classes:
import com.groupbyinc.retailapi.ApiClient;
import com.groupbyinc.retailapi.ApiException;
import com.groupbyinc.retailapi.Configuration;
import com.groupbyinc.retailapi.auth.*;
import com.groupbyinc.retailapi.models.*;
import com.groupbyinc.retailapi.api.AutocompleteApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure HTTP basic authorization: GroupByIncEmployee
    HttpBasicAuth GroupByIncEmployee = (HttpBasicAuth) defaultClient.getAuthentication("GroupByIncEmployee");
    GroupByIncEmployee.setUsername("YOUR USERNAME");
    GroupByIncEmployee.setPassword("YOUR PASSWORD");

    // Configure API key authorization: ClientKey
    ApiKeyAuth ClientKey = (ApiKeyAuth) defaultClient.getAuthentication("ClientKey");
    ClientKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ClientKey.setApiKeyPrefix("Token");

    AutocompleteApi apiInstance = new AutocompleteApi(defaultClient);
    String xGroupbyCustomerId = "xGroupbyCustomerId_example"; // String | Header on incoming HTTP requests that is populated by the API gateway and indicates the customer ID.
    Identity identity = new Identity(); // Identity | 
    Merchandiser merchandiser = new Merchandiser(); // Merchandiser | 
    Request request = new Request(); // Request | Object which is represent autocomplete request and encapsulate all passed parameters. 
    try {
      SearchResults result = apiInstance.autocompletesearch(xGroupbyCustomerId, identity, merchandiser, request);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AutocompleteApi#autocompletesearch");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Documentation for 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

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

ClientKey

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

GroupByIncEmployee

  • Type: HTTP basic authentication

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages