Get comment list
OVERVIEW
Method to obtain comments on a particular content.
This method is supported in version 2 of the API and above
Request URI
GET /comments{?filter parameters}
| Parameter Name | Value | Description |
|---|---|---|
| site | String |
Provide site id of the required site, the parameter only accepts one site in the current implementation. e.g For global contents like microblogs please provide 0 as the siteid |
| contentid | String |
This the content id of the required content. e.g blogid for contenttype=blog, taskid for contenttype=tasks |
| contenttype | String |
|
| offset | int | The integer value of the last comment fetched. |
| limit | int |
No of comments to return in one request. Default is 20 and the maximum value is 100 If a value of 0 or less is provided in the request then 20 comments will be returned. If a value of more than 100 is provided then 100 comments are returned. |
Response
The response will contain a collection of comments
<comments> <comment> <text>{comment snippet - without formatting}</text> <html><![CDATA[<p>{actual content - with formatting}</p>]]> </html> <author> <username>{author's full-name}</username> <email>{author's email address}</email> <httpavatar>{get author's avatar - http call}</httpavatar> <avatar>{get author's avatar - API call}</avatar> <userlink>{author's detail - API}</userlink> <httplink>{{author's detail - http}}</httplink> </author> <datepublished>{comment creation date}</datepublished> </comment> <comment> <text>{comment snippet - without formatting}</text> <html><![CDATA[<p>{actual content - with formatting}</p>]]> </html> <author> <username>{author's full-name}</username> <email>{author's email address}</email> <httpavatar>{get author's avatar - http call}</httpavatar> <avatar>{get author's avatar - API call}</avatar> <userlink>{author's detail - API}</userlink> <httplink>{{author's detail - http}}</httplink> </author> <datepublished>{comment created date}</datepublished> <images> <image> <imagelink>{image link - http}</imagelink> <apilink>{API link to image file's thumbnail}</apilink> </image> </images> <attachments> <attachment> <id>{attachment/file - id}</id> <name>{attachment/file - name}</name> <extension>{attachment/file - extension}</extension> <siteid>{attachment/file - site id}</siteid> <parentfolderid>{attachment/file - parent folder id}</parentfolderid> <filesize>1587</filesize> </attachment> <attachment> <id>{attachment/file - id}</id> <name>{attachment/file - name}</name> <extension>{attachment/file - extension}</extension> <siteid>{attachment/file - site id}</siteid> <parentfolderid>{attachment/file - parent folder id}</parentfolderid> <filesize>1587</filesize> </attachment> </attachments> </comment> </comments>
Response codes
| CODE | MEANING |
|---|---|
| 201 | Comments returned successfully |
| 400 | Problem with parameters |
| 401 | Unauthorized |
| 403 | Validation failed | Forbidden |
| 500 | Internal error occurred while returning comments |
In case of an error code other than 201, an error object will be returned in the format
Error Response
<error> <ref>{integer reference id, generated on the server side} </ref> <summary>{Description for the error message}</summary></error>
The parameter "site" mentioned in the parameters list above appears to be incorrect and does not work. I used "siteid" instead and it worked.
Comments
1 Comments