Inherits from NSObject
Declared in BVPost.h
BVPost.m

Overview

BVPost is used for all requests to the Bazaarvoice API which submit content excluding photo and video uploads. This includes submitting answers, review comments, story comments, feedback, questions, reviews and stories.

In the simplest case, a request might be created as follows:

BVPost *questionRequest = [[ BVPost alloc ] initWithType:BVPostTypeQuestion ];
questionRequest.categoryId = @“1020”;

[ questionRequest sendRequestWithDelegate:self ];

The specified delegate will then receive BVDelegate callbacks when a response is received. Note that it is the client’s responsibility to set the delegate to nil in the case that the the delegate is deallocated before a response is received.

Properties

action

The submission action to take – either BVActionPreview or BVActionSubmit. ‘BVActionPreview’ will show a draft of the content to be submitted; ‘BVActionSubmit’ will submit the content.

@property (assign, nonatomic) BVAction action

Declared In

BVPost.h

agreedToTermsAndConditions

Boolean indicating whether or not the user agreed to the terms and conditions. Required depending on the client’s settings.

@property (assign, nonatomic) BOOL agreedToTermsAndConditions

Declared In

BVPost.h

answerText

Contains the text of an answer for a BVPostTypeAnswer request.

@property (assign, nonatomic) NSString *answerText

Declared In

BVPost.h

campaignId

Arbitrary text that may be saved alongside content to indicate vehicle by which content was captured, e.g. “post-purchase email”.

@property (assign, nonatomic) NSString *campaignId

Declared In

BVPost.h

categoryId

The id of the category that this content is being submitted on.

@property (assign, nonatomic) NSString *categoryId

Declared In

BVPost.h

commentText

The text of the comment.

@property (assign, nonatomic) NSString *commentText

Declared In

BVPost.h

contentId

ID of the content with which a BVPostTypeFeedback request is associated.

@property (assign, nonatomic) NSString *contentId

Declared In

BVPost.h

contentType

Type of content with which a BVPostTypeFeedback request is associated. (BVFeedbackContentTypeAnswer, BVFeedbackContentTypeQuestion, BVFeedbackContentTypeReview, BVFeedbackContentTypeReviewComment, BVFeedbackContentTypeStory, BVFeedbackContentTypeStoryComment)

@property (assign, nonatomic) BVFeedbackContentType contentType

Declared In

BVPost.h

delegate

The client delegate to receive BVDelegate notifications.

@property (weak) id<BVDelegate> delegate

Declared In

BVPost.h

feedbackType

Type of feedback for a BVPostTypeFeedback request. (BVFeedbackTypeInappropriate, BVFeedbackTypeHelpfulness)

@property (assign, nonatomic) BVFeedbackType feedbackType

Declared In

BVPost.h

isRecommended

Boolean answer to “I would recommend this to a friend”. Required dependent on client settings.

@property (assign, nonatomic) BOOL isRecommended

Declared In

BVPost.h

isUserAnonymous

Indicates whether this submission should be displayed anonymously.

@property (assign, nonatomic) BOOL isUserAnonymous

Declared In

BVPost.h

locale

Locale 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.

@property (assign, nonatomic) NSString *locale

Declared In

BVPost.h

netPromoterComment

Text representing a user comment to explain numerical Net Promoter score.

@property (assign, nonatomic) NSString *netPromoterComment

Declared In

BVPost.h

netPromoterScore

Value is positive integer between 1 and 10 representing a numerical rating in response to “How would you rate this company?”

@property (assign, nonatomic) int netPromoterScore

Declared In

BVPost.h

productId

The id of the product that this content is being submitted on.

@property (assign, nonatomic) NSString *productId

Declared In

BVPost.h

questionDetails

Contains the text of the question details for a BVPostTypeQuestion request. Multiple lines of text are allowed.

@property (assign, nonatomic) NSString *questionDetails

Declared In

BVPost.h

questionId

The id of the category that this content is being submitted on for a BVPostTypeQuestion request. For such a request, one of productId or categoryId must be provided.

@property (assign, nonatomic) NSString *questionId

Declared In

BVPost.h

questionSummary

Contains the text of the question summary for a BVPostTypeQuestion request. Only a single line of text is allowed.

@property (assign, nonatomic) NSString *questionSummary

Declared In

BVPost.h

rating

Value is positive integer between 1 and 5, and represents review overall rating. Required depending on client settings.

@property (assign, nonatomic) int rating

Declared In

BVPost.h

reasonText

For BVPostTypeFeedback requests. Reason this content has been flagged as inappropriate.

@property (assign, nonatomic) NSString *reasonText

Declared In

BVPost.h

requestURL

The URL that this request was sent to. Is only available after the request has been sent.

@property (assign, nonatomic) NSString *requestURL

Declared In

BVPost.h

reviewId

The id of the review that this comment is being submitted on for a BVPostTypeReviewComment request. This field is required for BVPostTypeReviewComment requests.

@property (assign, nonatomic) NSString *reviewId

Declared In

BVPost.h

reviewText

Contains the text of an review for a BVPostTypeReview request.

@property (assign, nonatomic) NSString *reviewText

Declared In

BVPost.h

sendEmailAlertWhenCommented

Boolean indicating whether or not the user wants to be notified when a comment is posted on the content.

@property (assign, nonatomic) BOOL sendEmailAlertWhenCommented

Declared In

BVPost.h

sendEmailAlertWhenPublished

Boolean indicating whether or not the user wants to be notified when his/her content is published.

@property (assign, nonatomic) BOOL sendEmailAlertWhenPublished

Declared In

BVPost.h

storyId

The id of the story that this comment is being submitted on for a BVPostTypeStoryComment request. This field is required for BVPostTypeStoryComment requests.

@property (assign, nonatomic) NSString *storyId

Declared In

BVPost.h

storyText

The text of the story for a BVPostTypeStory request.

@property (assign, nonatomic) NSString *storyText

Declared In

BVPost.h

title

Content title text.

@property (assign, nonatomic) NSString *title

Declared In

BVPost.h

type

The particular type (BVPostTypeReview, BVPostTypeAnswer…) of this request.

@property (assign, nonatomic) BVPostType type

Declared In

BVPost.h

userEmail

User’s email address.

@property (assign, nonatomic) NSString *userEmail

Declared In

BVPost.h

userId

User’s external ID.

@property (assign, nonatomic) NSString *userId

Declared In

BVPost.h

userLocation

User location text.

@property (assign, nonatomic) NSString *userLocation

Declared In

BVPost.h

userNickname

User nickname display text.

@property (assign, nonatomic) NSString *userNickname

Declared In

BVPost.h

vote

Helpfulness vote for this content. Valid votes are: BVFeedbackVoteTypePositive, NegatBVFeedbackVoteTypeNegative. This parameter is only required for feedbackType=BVFeedbackTypeHelpfulness.

@property (assign, nonatomic) BVFeedbackVoteType vote

Declared In

BVPost.h

Instance Methods

addGenericParameterWithName:value:

Adds a generic parameter to the request. This method should be used as a last resort when another method does not exist for a particular request you would like to make. Behavior may be undefined.

- (void)addGenericParameterWithName:(id)name value:(id)value

Parameters

name

of parameter.

value

of parameter.

Declared In

BVPost.h

addPhotoUrl:withCaption:

Associates a photo url and corresponding caption with this submission.

- (void)addPhotoUrl:(id)url withCaption:(id)caption

Parameters

url

Bazaarvoice URL of a photo uploaded using the Data API.

caption

Assocated caption. May be nil.

Declared In

BVPost.h

addProductRecommendationForIndex:withProductExternalId:

Value is non-negative integer representing the product external ID of the ‘th product recommendation (for Social Recommendations)

- (void)addProductRecommendationForIndex:(id)index withProductExternalId:(id)productExternalId

Parameters

index

Index of product recommendation

productExternalId

Product external ID for this product recommendation.

Declared In

BVPost.h

addTagForDimensionExternalId:value:

Adds a tag with a particular dimensionExternalId and value. For example, a client might add the value “comfort” for the dimensionExternalId of “Pro” and “expensive” with a dimensionExternalId of “Con.”

- (void)addTagForDimensionExternalId:(id)dimensionExternalId value:(id)value

Parameters

dimensionExternalId

Dimension external id for this tag.

value

Tag value.

Declared In

BVPost.h

addTagIdForDimensionExternalId:value:

Adds a tagid field with a particular dimensionExternalId and value. This corresponds to a checkbox in a form. For example, a client might add the value true for the dimensionExternalId of “Pro/comfort” and true with a dimensionExternalId of “Con/expensive”

- (void)addTagIdForDimensionExternalId:(id)dimensionExternalId value:(id)value

Parameters

dimensionExternalId

Dimension external id for this tag.

value

Boolean value for this tagid.

Declared In

BVPost.h

addVideoUrl:withCaption:

Associates a video url and corresponding caption with this submission.

- (void)addVideoUrl:(id)url withCaption:(id)caption

Parameters

url

A valid YouTube or Bazaarvoice video-upload URL.

caption

Assocated caption. May be nil.

Declared In

BVPost.h

initWithType:

Convenience initializer with type.

- (id)initWithType:(id)type

Parameters

type

The particular type (BVPostTypeReview, BVPostTypeAnswer…) of this request.

Declared In

BVPost.h

requestURL

Returns the URL that this request was sent to. Is only available after the request has been sent.

- (NSString *)requestURL

Declared In

BVPost.h

send

Sends request asynchronously. A delegate must be set before this method is called.

- (void)send

Declared In

BVPost.h

sendRequestWithDelegate:

Convenience method to set delegate and send request asynchronously.

- (void)sendRequestWithDelegate:(id)delegate

Parameters

delegate

The client delegate to receive BVDelegate notifications.

Declared In

BVPost.h

setAdditionalField:value:

Sets AdditionalField for a particular dimensionExternalId. In general, this parameter is used to attach additional information to a submission. A concrete example of the parameter might be a dimensionExternalId of'Seat' with a value of ‘24F’ (describing the seat number at a stadium or on a plane) resulting in a parameter AdditionalField_Seat=24F.

- (void)setAdditionalField:(id)dimensionExternalId value:(id)value

Parameters

dimensionExternalId

Name of the additional parameter the client wishes to associate with this submission.

value

Value for the additional parameter.

Declared In

BVPost.h

setContextDataValue:value:

Sets ContextDataValue for a particular dimensionExternalId. In general, this parameter is used for custom parameters that a client may want to track. Some examples of this parameter include the following:

- (void)setContextDataValue:(id)dimensionExternalId value:(id)value

Parameters

dimensionExternalId

Custom parameter the client wishes to track.

value

Value for the custom parameter.

Discussion

  • dimensionExternalId:PurchaserRank value:“top10” -> ContextDataValue_PurchaserRank=top10
  • dimensionExternalId:Purchaser value:“yes” -> ContextDataValue_Purchaser=yes
  • dimensionExternalId:Age value:“35to44” -> ContextDataValue_Age=35to44
  • dimensionExternalId:Gender value:“male” -> ContextDataValue_Gender=male

Declared In

BVPost.h

setRatingForDimensionExternalId:value:

Sets a rating for a particular dimensionExternalId. A concrete example might be a dimensionExternalId of “Quality” where the value would represent the user’s opinion of the quality of the product.

- (void)setRatingForDimensionExternalId:(id)dimensionExternalId value:(id)value

Parameters

dimensionExternalId

Custom parameter the client wishes to track.

value

A positive integer between 1 and 5 representing rating dimension value.

Declared In

BVPost.h