The Bazaarvoice Response API lets you programmatically manage review responses. To learn more, go to the Response API documentation home page.

Contents

(+ show- hide)

This page describes how to programmatically create a client response request.

Request

The following example demonstrates the basic request for creating a client response resource.

HTTP POST is required.
POST https://[stg.]api.bazaarvoice.com/response/v1/clientResponses/{client}/reviews/{reviewID}?passkey={RESPONSE_API_PASSKEY} HTTP/1.1

Content-Type: application/json
Authorization: Bearer {ACCESS_TOKEN}
…
{
    "attributes": {
      "department": "Department name responsible for the response",
      "response": "Content to be attached to the review as a response.",
      "responseBy": "Name of the responder"
    }
}
Older applications may be using https://[stg.]api.bazaarvoice.com/contentmanagement as the base URL for the Response API, instead of https://[stg.]api.bazaarvoice.com/response. The contentmanagement URL has been deprecated. However, Bazaarvoice will continue to support applications that use the contentmanagement URL until further notice.

Ellipses (…) in above example indicate that your application may generate other headers.

Parameters

Name Description Required

Path

client

Client name as defined by Bazaarvoice.

Yes

reviewId

Identifier of the review to attach to the response.

Yes

QueryString

passkey

Response API passkey.

Yes

Header

Content-Type

application/json.

Yes

Authorization

The Authorization value will consist of the string Bearer followed by the OAuth2 access token. Refer to OAuth2 Integration for more information.

Yes

Body

attributes

Container node that wraps the department and response.

Yes

department

The department name (string) providing the response.

Yes

response

The textual (string) response to the review. Limited to 65,535 characters.

Yes

responseBy

The name of the responder. If you don't specify a name, the value defaults to the name of the Bazaarvoice Portal user that provided OAuth authorization for the application.

No

Response

Header

An HTTP status 200 indicates success. Other header values are documented in the Overview.

Body

A successful response will contain a JSON object in the body. The following demonstrates a typical successful creation of a client response:

{
    "type": "clientResponse",
    "id": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    "attributes": {
        "department": "Some department name",
        "response": "This is a sample client response.",
        "responseBy": "Name of the responder",
        "responseSource": "Name of Application created for OAuth",
        "created": "2018-06-26T14:48:44Z",
        "updated": "2018-06-26T14:48:44Z"
    },
    "relationships": {
        "author": {
            "data": {
                "type": "author",
                "id": "Name of owner of OAuth Application"
            },
            "links": {
                "self": "https://[stg.]api.bazaarvoice.com/response/v1/clientResponses/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/relationships/author",
                "related": "https://[stg.]api.bazaarvoice.com/response/v1/clientResponses/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/author"
            }
        },
        "review": {
            "data": {
                "type": "review",
                "id": "XXXXX",
                "clientName": "client_name"
            },
            "links": {
                "self": "https://[stg.]api.bazaarvoice.com/response/v1/clientResponses/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/relationships/review",
                "related": "https://[stg.]api.bazaarvoice.com/response/v1/clientResponses/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/review"
            }
        }
    },
    "links": {
        "self": "https://[stg.]api.bazaarvoice.com/response/v1/clientResponses/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
    }
}

The definition of the key/values returned in the response body are documented in the Overview.

Errors

Please see Troubleshooting for a detailed description and solution for Response API errors.

The following lists specific errors which may be encountered when creating a new client response request:

Response may not be empty

The required parameter response is not included in the request.

{
    "httpCode": 400,
    "requestURI": "/response/v1/clientResponses/{client}/reviews/{reviewID}",
    "errors": [
        {
            "code": "INVALID_PROPERTY_VALUE",
            "field": "response",
            "message": "Validation error for ClientResponseResource.clientResponseModify.attributes.response: may not be empty"
        }
    ]
}
Department may not be empty

The required parameter department is not included in the request:

{
    "httpCode": 400,
    "requestURI": "/response/v1/clientResponses/{client}/reviews/{reviewID}",
    "errors": [
        {
            "code": "INVALID_PROPERTY_VALUE",
            "field": "department",
            "message": "Validation error for ClientResponseResource.clientResponseModify.attributes.department: may not be empty"
        }
    ]
}
The submitted JSON is not formatted correctly

The required attributes wrapper element is not included in the request:

  {
      "httpCode": 400,
      "requestURI": "/response/v1/clientResponses/{client}/reviews/{reviewID}",
      "errors": [
          {
              "code": "INVALID_PROPERTY_VALUE",
              "field": "attributes",
              "message": "Validation error for ClientResponseResource.clientResponseModify.attributes: may not be null"
          }
      ]
  }
Duplicate responses are not supported

Duplicate response text is submitted for the same reviewId:

  {
      "httpCode": 400,
      "requestURI": "/response/v1/clientResponses/{client}/reviews/{reviewID}",
      "errors": [
          {
              "code": "INVALID_PROPERTY_VALUE",
              "field": "response",
              "message": "Duplicate 'This is some sample response' detected for ClientResponse.response"
          }
      ]
  }

Considerations

Moderation

Client responses should be provided by individuals with product and brand expertise. Moderation does not exist for the Bazaarvoice Client Response API. The configurations associated with user generated content, such as reviews, are not considered.

Time to live

All actions within the Bazaarvoice Client Response API are 'near real time'. Successful modifications, creations, and deletions affecting content are only dependent on the time for the Bazaarvoice caches to update. Client-implemented caching will also affect the rate at which responses appear.