Create Client Response

This page describes how to 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"
    }
}

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

πŸ“˜

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.

Parameters

NameDescriptionRequired
Path
clientClient name as defined by Bazaarvoice.Yes
reviewIdIdentifier of the review to attach to the response.Yes
QueryString
passkeyResponse API passkey. The above example uses a placeholder value of {RESPONSE_API_PASSKEY}.Yes
Header
Content-Typeapplication/json.Yes
AuthorizationThe Authorization value will consist of the string Bearer followed by the OAuth2 access token. Refer to OAuth2 Integration for more information.Yes
Body
attributesContainer node that wraps the department ,response andresponseByYes
departmentThe department name providing the response.Yes
responseThe textual response to the review. Limited to 65,535 ascii characters. Ascii.Yes
responseByThe name of the responder. If you don't specify a name the value will be omitted from the response.No

Response

Header

HTTP status 200 indicates success. Other header values are documented in the API Response.

Body

A successful response will contain a JSON object in the body. Below is an example of a typical creation of a client response request:

{
    "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 is documented in the API Reference .

Errors

For a detailed description and solution to Response API errors, refer to Troubleshooting.

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

Response must 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.clientResponseCreate.attributes.response: may not be blank"
        }
    ]
}

Department must 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.clientResponseCreate.attributes.department: may not be blank"
        }
    ]
}

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.clientResponseCreate.attributes: may not be blank"
          }
      ]
  }

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 come from individuals who are well-versed in the product and brand. Any user-generated content (UGC) submitted through your website generally goes through a rigorous moderation process.

It’s important to note that the Bazaarvoice Client Response API cannot be used to moderate review responses. Client responses submitted via the Response API will be displayed on your website as they are and will not be subject to Bazaarvoice’s UGC moderation.

Time to live

All actions within the Bazaarvoice Client Response API are 'near real-time'. The success of response modifications, creations, and deletions is dependent on the time required for the Bazaarvoice caches to update. Additionally, the rate at which responses appear can be influenced by client-implemented caching