Media-Photo Upload

🚧

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

Upload photos for a review, question, answer or review comment(This feature will not be available or will behave differently in future versions of the Conversations API. Click for more information).

Examples

Upload a photo from a file

Photos must be uploaded using HTTP POST.

POST /data/uploadphoto.json?ApiVersion=[latestApiVersion]&ContentType=[review|question|answer|review_comment|]&PassKey=[yourKey] HTTP/1.1
Host: stg.api.bazaarvoice.com
Content-Length: 71374
Content-Type: multipart/form-data; boundary=----FormBoundarycSTk3Rd73AEuhGuD
...

----FormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="photo"; filename="your_image.jpg"
Content-Type: image/jpeg


---FormBoundaryE19zNvXGzXaLvS5C

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

📘

review_comment in above URL for Photo upload is only available to clients on our PRR platform. Click for more information.

Upload a photo from a URL

Photo upload URLs must be submitted using HTTP POST.

POST /data/uploadphoto.[FORMAT] HTTP/1.1
Host: [stg.]api.bazaarvoice.com
Content-Type: application/x-www-form-urlencoded
...

ApiVersion=[latestApiVersion]&ContentType=[review|question|answer|story|review_comment|story_comment]&PassKey=[yourKey]&photoUrl=[URLofPhoto]

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

📘

Story, review_comment, story_comment features in above URL are only available to clients on our PRR platform. Click for more information.

Parameters

NameDescription
[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)

📝
Required
This field is required in all API requests.
ApiVersionThe API version, e.g. 5.4.

📝
Required
This field is required in all API requests.
ContentTypeThe content type for which this media is being submitted. Valid values include: review, question, answer.

📝
Required
This field is required in all API requests.
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.

🔺
Alert
Failure to submit this field will result in your content being ineligible for syndication, authenticity or other business processes.
PassKeyAPI key is required to authenticate API user and check permission to access particular client's data.

📝
Required
This field is required in all API requests.
PhotoA file representing the photo to be submitted. Note that the parameter name is case-sensitive and must be lowercase. Use either the photo or photoUrl parameter to define the photo to upload. An error is returned if both parameters are defined.
PhotoUrl_<n>URL of the photo to be uploaded. Use either the photo or photoUrl parameter to define the photo to upload. An error is returned if both parameters are defined. HTTP and HTTPS are the only protocols supported for the photoUrl parameter.
UserValue of the encrypted user. This parameter demonstrates that a user has been authenticated. Note that the UserId parameter does not contain authentication information and should not be used for hosted authentication. See the Authenticate User method for more information.

⚠️
Caution
This field may be required depending on per client configurations.
UserIdUser's external ID. This value should come from your authentication system. See Client-Mastered Authentication for more information.

🔺
Alert
Do not use an email address for this value.

⚠️
Caution
This field may be required depending on per client configurations.

Response format

The following is an example of a photo upload response:

{
  "HasErrors": false,
  "Data": {},
  "Form": [],
  "AuthorSubmissionToken": null,
  "FormErrors": {},
  "TypicalHoursToPost": null,
  "SubmissionId": null,
  "Locale": "en_US",
  "Errors": [],
  "Photo": {
    "Caption": null,
    "Sizes": {
      "thumbnail": {
        "Url": "http://apitestcustomer.ugc.bazaarvoice.com/bvstaging/5555/ps_amazon_s3_ea85cew8pya54lma81quray0k/photoThumb.jpg",
        "Id": "thumbnail"
      },
      "normal": {
        "Url": "http://apitestcustomer.ugc.bazaarvoice.com/bvstaging/5555/ps_amazon_s3_ea85cew8pya54lma81quray0k/photo.jpg",
        "Id": "normal"
      }
    },
    "SizesOrder": [
      "thumbnail",
      "normal"
    ],
    "Id": "ea85cew8pya54lma81quray0k"
  }
}

Error codes

ValueDescription
ERROR_ACCESS_DENIEDInsufficient privileges to perform the operation
ERROR_FORM_DUPLICATEThe nickname is already in use.
ERROR_FORM_DUPLICATE_NICKNAMEThe nickname is already in use.
ERROR_FORM_IMAGE_HEIGHT_TOO_SMALLEmoji are not supported.
Image must be a minimum number of pixels tall. The value is configurable by content type and/or by display code.
ERROR_FORM_IMAGE_PARSEThe uploaded image could not be parsed. Ensure the image is a valid PNG, GIF, JPEG, HEIC, or TIFF file.
ERROR_FORM_IMAGE_TOO_LARGEThe image could not be uploaded due to its size. Images must be less than 10 MB.
ERROR_FORM_IMAGE_WIDTH_TOO_SMALLImage width must be a minimum number of pixels wide. The value is configurable by content type and/or by display code.`
ERROR_FORM_INVALID_EMAILADDRESSEmail address is not in the proper format.
ERROR_FORM_INVALID_IPADDRESSThe IP address is invalid.
ERROR_FORM_INVALID_OPTIONThe selected option has been removed.
ERROR_FORM_PATTERN_MISMATCHThis field is not in the correct format.
ERROR_FORM_PROFANITYThe content contains inappropriate language.
ERROR_FORM_REJECTEDThe submission was rejected.
ERROR_FORM_REQUIREDA required field was not supplied.
ERROR_FORM_REQUIRED_EITHERBoth of the required hosted authentication parameters are missing.
ERROR_FORM_REQUIRED_NICKNAMEYou must enter a nickname.
ERROR_FORM_REQUIRES_TRUEA field requires a value of true. (e.g., "You must agree to the terms and conditions.")
ERROR_FORM_RESTRICTEDContent provider's age is too young. (e.g., "Content cannot be accepted from minors under age 13.")
ERROR_FORM_STORAGE_PROVIDER_FAILEDThe uploaded file could not be stored. Try uploading again later.
ERROR_FORM_SUBMITTED_NICKNAMEThis nickname has already been submitted.
ERROR_FORM_TOO_FEWThere must be a minimum number of items contributed for this field.
ERROR_FORM_TOO_HIGHThis field has too many items.
ERROR_FORM_TOO_LONGThe field has too many characters.
ERROR_FORM_TOO_LOWThis field has too few items.
ERROR_FORM_TOO_SHORTThe field doesn't have enough characters.
ERROR_FORM_UPLOAD_IOThe item could not be uploaded. Ensure that it is a valid file type.
ERROR_PARAM_INVALID_API_KEYInvalid API Key value
ERROR_PARAM_INVALID_LOCALEInvalid locale code
ERROR_PARAM_INVALID_PARAMETERSInvalid parameter in content submission
ERROR_PARAM_MISSING_USER_IDThis client does not allow unauthenticated submissions. A valid UserId is required.
ERROR_REQUEST_LIMIT_REACHEDRate limiting error, i.e. too many requests per time interval
ERROR_UNKNOWNUnknown error (internal server error, for instance)
ERROR_UNSUPPORTEDFor unsupported features, clients etc.