The method retrieves the comments in a specified comments stream. The comments that are retrieved are approved comments as well as ones that have approved replies.
Note: This method is also supported in our REST API. If you wish to execute this method from your server, please refer toREST API > comments.getComments.
The following table lists the available parameters:
|||categoryID||string||The identifier of the comments category from which to retrieve the comments.|
|||streamID||string||The identifier of the comments stream from which to retrieve the comments.|
A reference to a callback function. Gigya calls the specified function along with the results of the API method when the API method completes.
The callback function should be defined with the following signature: functionName(Response).
The "Response Object Data Members" table below provides specification of the data that is passed to the callback function.
A developer-created object that is passed back unchanged to the application as one of the fields in the response object.
|||includeStreamInfo||Boolean||This parameter specifies whether to include a stream information object in the response. The default value is ' false ' . When set to ' true ' the response to the method will include the StreamInfo object .|
|||includeUID||Boolean||Indicates whether the UID of the commenter will be included in the returned object per comment. The default value is 'false'.|
|||includeUserOptions||Boolean||This parameter specifies whether to include a user options object in the response. The default is ' false '. When set to ' true ' the response to the method will include the UserOptions object.|
|||includeUserComments||Boolean||Indicates whether all the comments posted by the user to this stream will be included in the returned response. In reviews mode the default value of this parameter is true, in comments mode the default is false.|
|||lang||string||The language to which comment placeholder texts, such as "This comment has been deleted", should be translated. If this parameter is not passed, the language for translation is detected automatically based on the language in which the other comments are written.|
|||pinnedCommentID||string||A comment ID from the stream specified by streamID. This parameter will assure that the comment thread will be included in the response, at the begining of the comments array, followed by the other comments in natural order. |
Note : the pinned comment thread is not counted by the threadLimit.
|||sort||string||The comments may be sorted in one of the following orders:|
|||start||string||Defines what should be the starting point of the comments to retrieve. The purpose of this parameter is pagination of the comments. Use threadLimit parameter to define how many comments per page. For the first page don't set the start parameter. The response includes a next field, which is a pointer to the starting point of the next page. Set the start parameter with the value of the next field received in the response of the previous getComments request.|
|||tags||array||This parameter is a strings array representing list of tags, e.g.: ["tag_a","tag_b"]. The tags are used to filter comments, only comments that match the tags are to be retrieved.|
|||threadLimit||integer||The maximum number of comment threads to retrieve. If you don't give this parameter a value, the value will be taken from the comment category thread limit that is set in the Comments Settings page of Gigya's site. You can change the comment category thread limit in the Comments Settings page or override it by using this parameter.|
|||threadDepth||integer||The maximum depth of replies per comments thread to retrieve. |
Note: with pinnedCommentID, if the pinned thread is bigger than the limit, it will not be returned even though pinned.
|||threaded||Boolean||Indicates whether the comments are threaded. The default value is true.|
Response Object Data Members
|An array listing the comments. Each comment is represented by a JSON Comment object.|
|When includeUserComments is true, the response includes an array of all the comments posted by the user to this stream; each comment is represented by a JSON Comment object. In addition to the regular fields of the Comment object, the following fields are returned in the response of this method:|
|commentCount||integer||The number of returned comments.|
|threadCount||integer||The number of returned comment threads.|
|hasMore||Boolean||Specifies whether there are more comments that were not returned within this response.|
|next||string||A pointer to the starting point of the next comments page. The purpose of this field is pagination of the comments. Use this field as the value of the 'start' parameter of the next getComments request, thus retrieving the next comments and avoid retrieving the same comments again.|
|streamInfo||Stream info object||A JSON object containing meta information of the requested commenting stream. This object is available in the response only if the "includeStreamInfo" parameter is set to 'true' in the request.|
|userOptions||JSON object||A JSON object containing meta information of a comments user. This object is available in the response only if the "includeUserOptions" parameter is set to 'true' in the request The object includes the following fields: |