Answers Display

🚧

Only API keys on our Conversations PRR platform are eligible to use this API version. Refer to the Platforms section of our Platform & API Concepts documentation to learn which platform your API keys are on

Returns answers and related data.

Examples

🚧

Demonstration purposes only. Do not reuse the API passkeys below in your application.

Requesting a single answer

https://stg.api.bazaarvoice.com/data/answers.json?apiversion=5.4&passkey=kuy3zj9pr3n7i0wxajrzj04xo&Filter=Id:16369&Filter=ProductId:1000001

You can request multiple answers by separating the answer IDs with a comma - e.g. filter=id:16256,16257,16258

Requesting a single answer, including questions

https://stg.api.bazaarvoice.com/data/answers.json?apiversion=5.4&passkey=kuy3zj9pr3n7i0wxajrzj04xo&Filter=Id:16369&Filter=ProductId:1000001&Include=Questions

You can request multiple pieces of related information by separating them with a comma - e.g. include=questions, products, categories, authors.

Requesting all answers for a particular product, including questions.

https://stg.api.bazaarvoice.com/data/answers.json?apiversion=5.4&passkey=kuy3zj9pr3n7i0wxajrzj04xo&Filter=ProductId:test1&Include=Questions

Requesting all answers submitted by a particular author ID

https://stg.api.bazaarvoice.com/data/answers.json?apiversion=5.4&Filter=AuthorId:5jrptijda8&passkey=kuy3zj9pr3n7i0wxajrzj04xo

Requesting all native (non-syndicated) answers

🚧

Native (non-syndicated) content only. Continue reading for more details.

https://stg.api.bazaarvoice.com/data/answers.json?apiversion=5.4&passkey=kuy3zj9pr3n7i0wxajrzj04xo

Requests for this content type that do not include a ProductId, AuthorId, CategoryAncestorId, SubmissionId, or Answer Id filter will only work with API keys that are configured to exclude syndicated content.

We recommend using our Displayable Content Export service to download all of your native and syndicated content. If you still prefer the Conversations API, then you may contact our support team to have your Conversations API keys re-configured.

Parameters

NameDescriptionRequiredDefault Value
ApiVersionThe API version, e.g. 5.4.Yes
[FORMAT]Response format (
xml This feature will not be available or will behave differently in future versions of the Conversations API. Click for more information.
or json)
Yes
PassKeyAPI key is required to authenticate API user and check permission to access particular client's data.Yes
AttributesAttributes to be included when returning content. For example, if includes are requested along with the &attributes=ModeratorCodes parameter, both the includes and the results will contain moderator codes. In order to filter by ModeratorCode, you must request the ModeratorCodes attribute parameter.No
CallbackCallback function name used with JSONP. Value is a string consisting of the following characters: a-z,A-Z,0-9,_ (excluding comma). See the JSONP tutorial for more information.No
ExcludeFamilyBoolean flag indicating whether to exclude content from other products in the same family as the requested product. For example, "&filter=productid:eq:1101&excludeFamily=true" limits returned content to just that of product 1101 and not any of the products in the same family. If a value is not defined, content on all products in the family will be returned.NoFalse
FilterFilter criteria for primary content of the query. Multiple filter criteria are supported.No
IncludeRelated subjects to be included (e.g. Products, Categories, Authors, or Questions).NoWill only return Answers
LimitMax number of records returned. An error is returned if the value passed exceeds 100.No10
LocaleLocale to display Labels, Configuration, Product Attributes and Category Attributes in. The default value is the locale defined in the display associated with the API key.No
OffsetIndex at which to return results. By default, indexing begins at 0 when you issue a query. Using Limit=100, Offset=0 returns results 0-99. When changing this to Offset=1, results 1-100 are returned. The maximum supported value is 300000.No0
SearchFull-text search string used to find UGC. For more information about what fields are searched by default, see the Conversations API page.

Note: This invalidates sort options due to the fact that search takes precedence in returned data.
No
Search_[Type]Searching option for included content followed by full-text search string. See the Conversations API page for examples of searching for included data.

Note: This invalidates sort options due to the fact that search takes precedence in returned data.
No
SortSort criteria for primary content type of the query. Sort order is required (asc or desc). Multi-attribute sorting for each content/subject type is supported.No
StatsThe type of statistics that will be calculated on included subjects. Available content types are: Reviews, Questions, Answers. Note: Not all statistical content types apply to every possible include.No

Filter options

  • Each filter argument specifies the attribute to filter on followed by a comma-separated list of values. For instance, "Filter=Id:eq:50,75" will match all Answers with Id 50 OR 75.
  • Advanced operators can be used to define filters. For instance, "Filter=Id:lt:100" will match all Answers with an Id value of less than 100. All advanced operators are documented on the Conversations API page.
  • If a filter value contains a comma or a colon, that character needs to be escaped with a backslash (\, or \:). If a filter value contains an ampersand (&), the ampersand must be encoded in the filter value by replacing & with %26.
  • Multiple filters are allowed as URL parameters in which case filters are AND'ed. For instance, "Filter=QuestionId:eq:50&filter=isfeatured:true" will match all featured Answers with QuestionId 50.
  • Time-based filters can be used for SubmissionTime, LastModificationTime and LastModeratedTime. Dates in time-based filters are calculated as the number of seconds since January 1, 1970, 00:00:00 UTC. In a future version, we will be adding support for comparing date/time string values. The following example returns content that was submitted on November 9, 2009: &filter=SubmissionTime:gt:1257746400&filter=SubmissionTime:lt:1257832800

The following table lists the attributes available for filtering.

NameDescription
IdThe identifier of the content/subject type.
AdditionalField\_[FIELD_NAME]Additional field to filter by, e.g., filter=AdditionalField_[FIELD_NAME]:eq:[FIELD_VALUE](This feature is only available to clients on our Conversations PRR platform. Click for more information.)
AffiliationThe valid affiliation type. For example, to display answers by staff members, use filter=affiliation:eq:Staff. The affiliation value is case-sensitive and can be any value that is set in your configuration.
AuthorIdThe identifier of the author who wrote the content.
CampaignIdThe identifier of the Campaign associated with the content
CategoryAncestorIdThe identifier of the product category ancestor. Syndicated content will not be returned when using this filter.
CategoryIdThe identifier of the product category.(This feature is only available to clients on our Conversations PRR platform. Click for more information.)
ContentLocaleLocale of the content to display. If this filter is not defined, all content regardless of its locale is returned. To return specific content by locale, define the value in the filter. A wildcard character “*” can be used to define the value, e.g., “en*” returns all content in English (en_US, en_CA, en_GB, etc.) or you can use a single ContentLocale code (e.g., “fr_FR”). ContentLocale codes are case-sensitive.
ContextDataValue_[DIMENSION_EXTERNAL_ID]The context data value for the content. DIMENSION_EXTERNAL_ID can be age, gender, etc. e.g. filter=contextdatavalue_age:under21(This feature is only available to clients on our Conversations PRR platform. Click for more information.)
HasPhotosBoolean flag indicating whether content has photos
HasVideosBoolean flag indicating whether content has videos. For more information on inserting the returned VideoUrl into HTML, see the Conversations API page.(This feature is only available to clients on our Conversations PRR platform. Click for more information.)
IsBestAnswerBoolean flag indicating whether the Answer is the Best Answer of the question to which it belongs.
IsBrandAnswerBoolean flag indicating whether the answer is a brand answer. If the value is set to true and the reviewer has a badge associated with it, a BrandLogoImageURL is also returned.
IsFeaturedBoolean flag indicating whether content is featured
LastModeratedTimeThe date/time of the latest moderation of the content. See the Introduction for an example of using advanced operators for filtering.
LastModificationTimeThe date/time of the latest modification of the content. See the Introduction for an example of using advanced operators for filtering.
ModeratorCodeString value indicating the moderator code for rejected content, e.g., &Filter=ModeratorCode:eq:CR returns UGC that contains the CR (Competitor Reference) code. Multiple codes can be entered in a comma-delimited list, e.g., &Filter=ModeratorCode:eq:CS,IU returns UGC with either the CS (Customer Service Complaint) or the IU (Inappropriate/Unusable Content) code. For a list of all Moderator Codes, see the Conversations API page. Note that the ModeratorCodes attribute parameter must be explicitly requested in order to use this filter. See the Parameters section above.
ProductIdThe identifier of the product
QuestionIdId of the Question on which the Answer was written.
SubmissionIdSubmission identifier assigned to the content when it was initially submitted
SubmissionTimeThe submission date/time of the content. See the Introduction for an example of using advanced operators for filtering.
TotalFeedbackCountNumber of feedbacks received
TotalNegativeFeedbackCountNumber of negative feedbacks received
TotalPositiveFeedbackCountNumber of positive feedbacks received
UserLocationLocation of the author

Sort options

  • Sort order is required (asc or desc). There is no default.
  • Multi-attribute sorting is supported by using a comma separated list of sort criteria for a content/subject type. e.g. Sort=Id:asc,SubmissionTime:desc

The following table lists the attributes that are available for sorting.

NameDescription
IdThe identifier of the content/subject type.
AdditionalField_[FIELD_NAME]Additional field to sort by, e.g., sort=AdditionalField_[FIELD_NAME]:desc(This feature is only available to clients on our Conversations PRR platform. Click for more information.)
AuthorIdThe Identifier of the author who wrote the content
CampaignIdThe identifier of the Campaign associated with the content
CategoryIdThe identifier of the product category(This feature is only available to clients on our Conversations PRR platform. Click for more information.)
ContentLocaleLocale value of the content
ContextDataValue_[DIMENSION_EXTERNAL_ID]The context data value for the content. DIMENSION_EXTERNAL_ID can be age, gender, etc. e.g. sort=contextdatavalue_age:desc(This feature is only available to clients on our Conversations PRR platform. Click for more information.)
HasPhotosBoolean flag indicating whether content has photos
HasVideosBoolean flag indicating whether content has videos. For more information on inserting the returned VideoUrl into HTML, see the Conversations API page.(This feature is only available to clients on our Conversations PRR platform. Click for more information.)
IsBestAnswerBoolean flag indicating if this answer is the best answer of the question to which it belongs.
IsFeaturedBoolean flag indicating whether content is featured
LastModeratedTimeThe date/time of the latest moderation of the content
LastModificationTimeThe date/time of the latest modification of the content
ProductIdThe identifier of the product
QuestionIdId of the Question on which the Answer was written.
SubmissionIdSubmission identifier assigned to the content when it was initially submitted
SubmissionTimeThe submission date/time of the content
TotalFeedbackCountNumber of feedbacks received
TotalNegativeFeedbackCountNumber of negative feedbacks received
TotalPositiveFeedbackCountNumber of positive feedbacks received
UserLocationLocation of the author

Response format

Requesting all Answers along with the Questions they were written on and the Authors who wrote the Answers. The Answers are sorted in descending order by SubmissionTime

http://[stg.]api.bazaarvoice.combazaarvoice.com/data/answers.[FORMAT]?ApiVersion=[latestApiVersion]&passkey=[yourKey]&Include=Questions,Authors&Sort=SubmissionTime:desc
{
    "Includes": { },
    "HasErrors": false,
    "Offset": 101,
    "TotalResults": 1232,
    "Locale": "en_US",
    "Errors": [ ],
    "Results": [
        {
            "AdditionalFieldsOrder": [ ],
            "UserNickname": "2hTZ",
            "Photos": [
                {
                    "Caption": "The honor of a scout will not permit of anything but the highest and the best and the manliest. The honor of a scout is a sacred thing, and cannot be lightly set aside or trampled on. Faithfulness to duty is another one of t",
                    "Sizes": {
                        "thumbnail": {
                            "Url": "http://testcustomer.ugc.bazaarvoice.com/answers/0001/168986/photoThumb.jpg",
                            "Id": "thumbnail"
                        },
                        "normal": {
                            "Url": "http://testcustomer.ugc.bazaarvoice.com/answers/0001/168986/photo.jpg",
                            "Id": "normal"
                        }
                    },
                    "SizesOrder": [
                        "thumbnail",
                        "normal"
                    ],
                    "Id": "168986"
                }
            ],
            "ContextDataValues": { },
            "Videos": [ ],
            "ContextDataValuesOrder": [ ],
            "SubmissionId": null,
            "LastModificationTime": "2011-10-12T14:32:32.000-00:00",
            "QuestionId": "305107",
            "TotalFeedbackCount": 0,
            "TotalPositiveFeedbackCount": 0,
            "TotalInappropriateFeedbackCount": 0,
            "InappropriateFeedbackList": [ ],
            "BadgesOrder": [
                "top250Contributor"
            ],
            "UserLocation": null,
            "Badges": {
                "top250Contributor": {
                    "Id": "top250Contributor",
                    "ContentType": "ANSWER"
                }
            },
            "AuthorId": "data-gen-user-b82iyxmi2k4a8lxcaamzzyh4w",
            "IsFeatured": false,
            "ProductRecommendationIds": [ ],
            "AdditionalFields": { },
            "CampaignId": null,
            "TotalNegativeFeedbackCount": 0,
            "SubmissionTime": "2011-10-12T14:12:26.000-00:00",
            "ContentLocale": "en_US",
            "ModerationStatus": "APPROVED",
            "Id": "273739",
            "AnswerText": "Specimens and drawings may be forwarded for identification to the zoological department of the local state university, to the state fish commission, to the Bureau of Fisheries, Washington, D.C., or to the United States National Museum in the same city.",
            "LastModeratedTime": "2011-10-12T14:15:12.000-00:00"
        }
    ],
    "Limit": 1
 
}

Response elements

NameDescription
DataSection containing all the data matched by a query grouped by content/subject type. Within each data section there is a map of objects keyed by ids
ErrorsError section is populated instead of other fields if there is an error with a query syntax or problem executing a query.
LimitThe total number of results returned, specified by user in the URL. Defaults to 10 and has a maximum of 100.
OffsetDataset offset used for pagination (passed as URL parameter in a query request). The maximum supported value is 300000.
ResultsSection containing an array of primitive type object references matched by a query.
TotalResultsTotal number of records matched.

Error codes

ValueDescription
ERROR_ACCESS_DENIEDInsufficient privileges to perform the operation
ERROR_PARAM_INVALID_API_KEYInvalid API Key value
ERROR_PARAM_INVALID_CALLBACKInvalid JsonP callback function name
ERROR_PARAM_INVALID_FILTER_ATTRIBUTEInvalid filter attribute name
ERROR_PARAM_INVALID_INCLUDEDInvalid parameter value
ERROR_PARAM_INVALID_LIMITInvalid limit value
ERROR_PARAM_INVALID_LOCALEInvalid locale code
ERROR_PARAM_INVALID_SORT_ATTRIBUTEInvalid sort attribute name
ERROR_REQUEST_LIMIT_REACHEDRate limiting error, i.e. too many requests per time interval
ERROR_UNKNOWNUnknown error (internal server error, for instance)