Comment JS

Skip to end of metadata
Go to start of metadata

Description

 

A JSON object representing a comment. 

 

Field NameTypeDescription
IDstringUnique comment ID.
streamIdstringUnique stream ID.  See the Stream object.
parentIDstringID of the direct parent comment. When this comment is a reply to another comment, this field is the ID of the comment to which this comment replied.
threadIDstringID of the ancestor comment (root comment of this comment's thread).
commentTextstringThe content of the comment.
tagsArrayA string array representing a list of tags (e.g., ["Sports", "Football"]) assigned to this comment. A comment can be assigned a maximum of 15 tags.
senderJSON ObjectA JSON object representing the user who posted the comment. The object includes the following fields:
  • UID - the user ID of the user who posted the comment. It is returned only if includeUID is set to 'true' in comments.getComments or in comments.getThread. See User.UID for more information.
  • photoURL - the URL of the user's photo. This is populated from the User object's thumbnailURL field, or, if thumbnailURL is unavailable, the User object's photoURL field (which holds the address of the full-sized user photo).
  • profileURL
  • loginProvider
  • name -  if posted by someone anonymous the name value will be "Anonymous". 
  • isSelf - the value is 'true' when the 
    comment was posted by the current user, and 'false' if it wasn't.
votestringThe vote of the current user on the comment. The vote value may be one of the following:
  • "pos" - a positive vote, in favor of the specified comment
  • "neg" - a negative vote, opposing the specified comment
  • "none" - no vote. This will undo a previous vote on the specified comment
posVotesintThe number of positive votes on the comment.
negVotesintThe number of negative votes on the comment.
totalVotesintThe total number of votes on the comment (posVotes - negVotes).
providerPostIDsJSON Object

List of the IDs of the comments posted on various social networks. The IDs will be delivered in the following structure:

{
     "facebook": “FACEBOOK_POST_ID”,
     "twitter": “TWITTER_POST_ID”,
     ...
}
flagCountintThe number of times this comment was flagged. Gigya's commenting service allows users to flag specific comments that they find offensive or inappropriate. To learn more about flagging comments and moderation, please refer to the Flagging section of the Comments Moderation guide.
timestamplongThe GMT in which the comment was posted. The timestamp is in milliseconds (i.e. the number of milliseconds since Jan. 1st 1970).
threadTimestamplongThe GMT in which the root comment of this comment's thread was posted. The timestamp is in milliseconds (i.e. the number of milliseconds since Jan. 1st 1970).
repliesArray of
Comment objects
An array listing the replies to this comment. Each reply is represented by a Comment object as defined by this page (recursive definition).
descendantsCountintegerThe number of replies to the ancestor comment. This counter is returned when postComment is called with a parent ID.
highlightGroupsArray of stringsAn array of the highlight group names to which this comment belongs.
isModeratorBooleanIndicates whether the comment has been posted by a moderator.
editedBooleanindicates whether the original comment was edited by the user after the initial post.
moderatorEditBooleanIndicated whether the comment has been edited by the moderator.
guestPhotoURLstringA URL of a photo to be used for a guest commenter.
statusstringThe status of the comment that is returned in comment.postComment only. The possible values are "published", "pending" (the comment is pending moderation) or "rejected".
taggedUsersArray of objectsThe list of users (commenters) that are tagged in the friends' comments. The array is made up of objects, each with the following values:
  • UID (If a UID cannot be resolved its place in the array is reserved with "null")
  • name
  • photoURL
mediaItemsArray of mediaItem objectsAn array of the embedded media (audio, video or images). Requires that embedding media is enabled in the Comments Settings of the Gigya Console.
Rating & Reviews related fields:
The following fields are available and relevant only if this object represents a Review (technically, if this comment belongs to a category that is defined with 'Operation mode: Rating & Reviews'). Learn more in the R&R guide.
commentTitlestringA title for the comment. The title may be maximum 250 characters long.
ratingsJSON
Object
An object that defines user ratings for this stream.
The object structure is: {'_overall': ratingValue}, where the ratingValue is an integer between 1-5.

Note: A field that does not contain data will not appear in the object.

 

Example Object

{
            "ID": "2a9f579657c044f380a4a0e1b6fc2af8",
            "threadID": "",
            "commentText": "setfsdgdgsdg",
            "sender": {
                "photoURL": "http://graph.facebook.com/100002990175600/picture?type=square",
                "profileURL": "http://www.facebook.com/profile.php?id=100002990175600",
                "loginProvider": "Facebook",
                "name": "Alex Za",
                "isSelf":true
            },
            "vote": "none",
            "providerPostIDs": {
                "facebook": "100002990175600_121761944600144"
            },
            "highlightGroups" : [],
            "flagCount": 0,
            "timestamp": 1320012310883,
            "threadTimestamp": 1320012329120,
            "replies": [{
                "ID": "e708a2dbb2a74a3c9b827b3b9661a4c3",
                "parentID": "2a9f579657c044f380a4a0e1b6fc2af8",
                "threadID": "2a9f579657c044f380a4a0e1b6fc2af8",
                "commentText": "sdgsdg ",
                "sender": {
                    "photoURL": "http://graph.facebook.com/100002990175600/picture?type=square",
                    "profileURL": "http://www.facebook.com/profile.php?id=100002990175600",
                    "loginProvider": "Facebook",
                    "name": "Alex Za",
                    "isSelf":false
                },
                "vote": "none",
                "providerPostIDs": {
                    "facebook": "100002990175600_121762021266803"
                },
                "flagCount": 0,
                "timestamp": 1320012329120,
                "threadTimestamp": 0}],
            "descendantsCount": 1
}