comments.updateComment REST

Skip to end of metadata
Go to start of metadata

Description

This method allows moderators to update an existing comment. 

 

Note: This method is available to moderators only, unless user editing is enabled. When user editing is enabled, whether through the comments.setCategoryInfo API method or via the Comments Settings in the console, users can edit the following fields: commentText, commentTitle, mediaItems, ratings and taggedUsers.

 

Request URL

 

Where <Data_Center> is:
  • us1.gigya.com - For the US data center.
  • eu1.gigya.com - For the European data center.
  • au1.gigya.com - For the Australian data center.
  • ru1.gigya.com - For the Russian data center.
  • cn1.gigya-api.cn - For the Chinese data center.

If you are not sure of your site's data center, see Finding Your Data Center.

Parameters

RequiredNameTypeDescription
categoryIDstringThe identifier of the comments category to which you would like to update the comment.
streamIDstringThe identifier of the comments stream to which you would like to update the comment. 
commentIDstringThe identifier of the comment you would like to update.
commentTextstringChange the comment text to this string.
commentTitlestringChange the comment title to this string.
statusstringChange the comment status: pending/rejected/approved
flagCountintegerChange the flag count of the comment. Supports absolute values as well as "+" and "-" to increment or decrement the count. "0"(zero) will be used to clear flags.
noteobjectThe note is a custom object, which may include additional information about the reason for the update and who performed it.
addHighlightGroupsarray of stringsAn array of group names to add to the highlightGroups field of the comment object. If the name already exists, it will not be added.
deleteHighlightGroupsarray of stringsAn array of group names to delete from the highlightGroups field of the  comment object .
ratingsJSON objectAn object that redefines user ratings for this stream. 
The object structure is: {'_overall': ratingValue}, where the ratingValue is an integer between 1-5.
Old values are overwritten by the new  ones. To reset a dimension's value, pass a null value to that dimension.
mediaItemsarrayAn array of URLs of media items to attach to the comment. Currently media items are limited to 3 per comment. If the number of media items exceeds this limit, only the first 3 will be posted. This parameter is only accepted if  clientSettings.enableMediaItems  is set to true for the category via comments.setCategoryInfo.
taggedUsersarrayAn array of users (UIDs) tagged in the comment body. The taggedUsers array replaces the users that are tagged in the comment. The comment body should have special markup elements that refer to the index of the tagged user in the array. Nulls are allowed members of the array.

Currently tagged users are limited to 10 per comment. If the number of tagged users exceeds this limit, only the first 10 will be posted. This parameter is only accepted if clientSettings.enableUserTagging is set to true for the category via comments.setCategoryInfo.

senderJSON object

An object that can change the following values for the comment: name, photoURL, profileURL. The URLs should be publicly accessible.

This may be used, for example, when migrating to a different database, and the URLs of user info have changed. Note that the change is per comment - changing the photo URL for a sender in one comment, for example, won't change the photo URL of that sender in a different comment.

Authorization Parameters

Each REST API request must contain identification and authorization parameters.

Please refer to the Authorization Parameters section for details. 

 

Response Data

FieldTypeDescription
 
statusCode integer The HTTP response code of the operation. Code '200' indicates success.
errorCode integer The result code of the operation. Code '0' indicates success, any other number indicates failure. For a complete list of error codes, see the Error Codes table.
statusReason string A brief explanation of the status code.
errorMessage string A short textual description of an error, associated with the errorCode, for logging purposes. This field will appear in the response only in case of an error.
errorDetails string This field will appear in the response only in case of an error and will contain the exception info, if available.
callId string Unique identifier of the transaction, for debugging purposes.
time string The time of the response represented in ISO 8601 format, i.e., yyyy-mm-dd-Thh:MM:ss.SSSZ or

 

 

commentComment objectThe updated comment.

 

A field that does not contain data will not appear in the response.

 

Response Example

{
"comment": {
    "ID": "c50379017b4749b88ed82ac2eb096cc3",
    "streamId": "eyal",
    "tags": [],
    "threadID": "",
    "isModerator": false,
    "commentText": "Post comment1",
    "posVotes": 0,
    "TotalVotes": 0,
    "sender": {
        "name": "Dani",
        "loginProvider": "Site",
        "isSelf": false
    },
    "flagCount": 0,
    "moderatorEdit": false,
    "timestamp": 1421132632176,
    "threadTimestamp": 1421132632176,
    "status": "published",
    "mediaItems": [],
    "highlightGroups": [
        "Experts"
    ],
    "edited": false
},
"statusCode": 200,
"errorCode": 0,
"statusReason": "OK",
"callId": "7a4fd32fac384dfa959fa19271de262a",
"time": "2015-01-13T07:03:54.605Z"
}