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 ofhttps://[stg.]api.bazaarvoice.com/**response**
.Thecontentmanagement
URL has been deprecated. However, Bazaarvoice will continue to support applications that use thecontentmanagement
URL until further notice.
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. The above example uses a placeholder value of {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 ,response andresponseBy | Yes |
department | The department name providing the response. | Yes |
response | The textual response to the review. Limited to 65,535 ascii characters. Ascii. | Yes |
responseBy | The 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
Updated 11 months ago