Contents

(+ show- hide)

This page contains reference documentation for version 1 of the Product Sentiment Insights API HTTP service.

Environments

The Product Sentiment Insights API supports the following environments:

Environment Domain Description
Staging

https://stg.api.bazaarvoice.com

Used while developing your application.
Production

https://api.bazaarvoice.com

Used when your application is complete.

Required headers

All requests must include the following headers:

Name Description
Host Environment, staging or production, that will process the request.
X-Bazaarvoice-Passkey

The passkey key described in the Credentials section.

X-Bazaarvoice-Signature

An access signature used to verify the request. This is created by your application for each request. Refer to Creating the access signature for additional details.

X-Bazaarvoice-Timestamp

A Unix timestamp in milliseconds. Requests will be valid for 3600 seconds after the time stamp is created. Requests using an expired timestamp will return an error.

Access signature

The contents of the message to be encrypted will vary based on the request. The two possible variations are demonstrated below:

Without path passkey={PSI_PASSKEY}&timestamp={TIMESTAMP}
With path path={PATH_VALUE}&passkey={PSI_PASSKEY}&timestamp={TIMESTAMP}

The tokens above should be replaced with the appropriate values as described below:

Name Description
{PATH_VALUE}

This is the same value communicated in the path query string parameter. Refer to the Workflow Walk-Through for more information.

{PSI_PASSKEY}

This is the same value communicated with the X-Bazaarvoice-Passkey header.

{TIMESTAMP}

A Unix timestamp in milliseconds. This is the same value communicated by the X-Bazaarvoice-Timestamp header.

Using seconds or any increment other than milliseconds will cause your request to fail

Refer to Creating Access Signature for verification values and code examples.

Parameters

Name Description
path

The value identifying the data set version in the form of a URL path segment.

The path value must be used exactly as it is. Any modification will result in an error.

Examples

Request manifest file list

Returns a JSON list of manifest file paths which will be used in the next request.

Request

GET https://[stg.]api.bazaarvoice.com/psi/v1/data

Headers

Host: [stg.]api.bazaarvoice.com
X-Bazaarvoice-Passkey: {PSI_PASSKEY}
X-Bazaarvoice-Signature: {SIGNATURE}
X-Bazaarvoice-Timestamp: {TIMESTAMP}

Request manifest file

Returns a 302 redirect to a manifest file containing paths to data files.

Request

GET https://[stg.]api.bazaarvoice.com/psi/v1/data?path={MANIFEST_PATH}

Headers

Host: [stg.]api.bazaarvoice.com
X-Bazaarvoice-Passkey: {PSI_PASSKEY}
X-Bazaarvoice-Signature: {SIGNATURE}
X-Bazaarvoice-Timestamp: {TIMESTAMP}

Request data file

Returns a 302 redirect to a file containing data.

Request

GET https://[stg.]api.bazaarvoice.com/psi/v1/data?path={DATA_PATH}

Headers

Host: [stg.]api.bazaarvoice.com
X-Bazaarvoice-Passkey: {PSI_PASSKEY}
X-Bazaarvoice-Signature: {SIGNATURE}
X-Bazaarvoice-Timestamp: {TIMESTAMP}

Following a 302 redirect

The HTTP service will return 302 redirects for some requests. This allows us to decouple the location of the data file from the request path. It is essential that your application immediately follow the redirect exactly as it is provided and to not save or reuse redirects at a later time.

GET {REDIRECT_URL}

Error specific troubleshooting tips

Please see the Troubleshooting page.