Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen

/api/reports/:id/comments

Returns all comments for the report with the specified ID.

Resource Information

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

Code Block
javascript
javascript
{
  "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

textComment text
whenDate and time of comment creation

Sample Request / Response

Using curl:

Code Block
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:

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

...