/api/reports/:id/comments

Returns all comments for the report with the specified ID.

Resource Information

Resource URL

https://service.belladati.com/api/reports/:id/comments

HTTP Method

GET

Request Parameters

Parameters

Detail

Example

id

ID of the report whose comments to fetch. You can find the ID in the response to /api/reports.

123

offset

(Optional) Specifies the page offset if pagination is necessary.

2

size

(Optional) Specifies the number of entries on each page if pagination is necessary.

  • size = 0 means, that the back-end is supposed to return total records count only. The returning object's size parameter then becomes the default value, which is 15
  • size =-1 is used to get to get all records
  • size >0 specifies the exact number of records to be retrieved
15

Response Structure

{
  "comments" : [ ],
  "offset" : 2,
  "size" : 15
}

JSON response contains 2 pagination elements (offset and size) but the main element is array "comments" that contains multiple report comment objects with following definition:

Name
Description
idComment identifier
authorIdAuthor identifier
author

Author full name

privateBoolean value defining if the comment is public or private
textComment text
whenDate and time of comment creation

Sample Request / Response

Using curl:

curl -H "Authorization: OAuth realm=\"https://service.belladati.com/\", oauth_consumer_key=\"myConsumer\", oauth_token=\"mh7an9dkrg59\", oauth_timestamp=\"135131231\", oauth_nonce=\"randomString\"" https://service.belladati.com/api/reports/123/comments

The JSON format response:

{
  "comments" : [
    {
	  "id" : "12345",
      "authorId" : "1",
      "author" : "John Smith",
	  "private" : true,
	  "text" : "This is a comment.",
      "when" : "Fri, 16 Aug 2013 12:56:50 GMT"
    }
  ],
  "offset" : 2,
  "size" : 15
}