Badges

This documentation explains how badges can be used to visually identify notable attributes about authors or content.

Introduction

Bazaarvoice badges allow content and/or contributors to be recognized, or flagged, as having an additional meaning. Badges can support such concepts as 'featured' content, indicating a contributor's expertise on a product, acknowledge incentivized content, and also top content providers. Badges are placed on user generated content (reviews, questions, answers) or on contributors.

Getting a list of badges

Badges will be returned as an array with the UGC response objects that include them, (i.e. Review, Question, Answer, Comment).

Image links are not returned from the Conversations API. The display for Conversation API clients is left up to your creative interpretation.

Objective-C SDK

let results = response.results
let review = results[0]
let badges = review.badges
for badge in badges {
  // id that can be used to obtain the related ContextDataValues that can
  // also be returned in the API response when configured
  let identifier = badge.identifier
 
  // The specific item the badge is meant for. Typical values are
  // 'REVIEWS', 'QUESTIONS', or 'ANSWERS'.
  let contentType = badge.contentType
}
NSArray* results = response.results;
BVReview* review = results[0];
NSArray* badges = review.badges;
for (BVBadge* badge in badges) {
  // id that can be used to obtain the related ContextDataValues that can
  // also be returned in the API response when configured
  NSString* badgeIdentifier = badge.identifier;
 
  // The specific item the badge is meant for. Typical values are
  // 'REVIEWS', 'QUESTIONS', or 'ANSWERS'.
  NSString* badgeContentType = badge.contentType;
}

Swift SDK

let results = response.results
let review = results[0]
let badges = review.badges
for badge in badges {
    // id that can be used to obtain the related ContextDataValues that can
    // also be returned in the API response when configured
    let identifier = badge.badgeId
    // The specific item the badge is meant for. Typical values are
    // 'REVIEWS', 'QUESTIONS', or 'ANSWERS'.
    let contentType = badge.contentType
}