API Getting Started2017-08-24T12:53:35+00:00

Getting Started with Aspectiva’s API

This page provides an overview of the API and a guide for how to begin using it. For the full API documentation see:

In the eCommerce API, the Products endpoint is a good place to start. It is used to receive product information given a product ID (typically, a SKU or UPC). The information returned is all one needs to display the information contained in Aspectiva’s Product Page Widget. The endpoint supports both a complete response and a short response. The complete response contains the product score, a list of positive and negative aspects, review snippets per aspect, and additional fields (see full specification here). The short response is a summary that can be used to show a preview, and is also useful in search results or category pages.

In the Travel API, the Hotels endpoint is used to get information about a hotel using its attributes such as name and location.

The Aspects endpoint is used to get the pros and cons of a certain product. The aspect ID returned in the response can be further used in the Examples endpoint below. Note that the Products endpoint’s full response already contains the information provided by the Aspects endpoint. However, some applications that don’t need all of the data returned by the Products endpoint may find the lighter response more efficient.

The Examples endpoint is used to receive review snippets per product and aspect. This use case can be illustrated by the aspect search feature in the Product Page Widget. After a user selects an aspect, the Examples endpoint is called to display information about the aspect, including the score, sentiment expressions and review snippets.

The Aspect Search Suggestions endpoint is useful when allowing aspect search. This endpoint can support an auto-suggest feature when a user starts typing some text, as you’ll find embedded in the Product Page Widget. When one of the given suggestions is selected, the Examples endpoint can be called to retrieve detailed information about a specific aspect.

The Recommendations endpoint is used to get recommended products in a certain category that are best for a particular aspect. The category ID can be obtained from the Products endpoint (given a product ID, or from the Hotels endpoint in case the Travel API is used). The response contains all of the information needed to display recommendations, just like the build-in Recommendations feature of the Product Page Widget.

Tip: for optimal efficiency across browsers, ensure your API requests meet the requirements for a “simple request” as described in this MDN article.