Jump to >

This documentation covers Review Board 2.0. You can see the latest Review Board documentation or all other versions.

Review File Attachment Comment Resource

Provides information on file comments made on a review.

If the review is a draft, then comments can be added, deleted, or changed on this list. However, if the review is already published, then no changes can be made.

Details

Name file_attachment_comment
URI /api/review-requests/{review_request_id}/reviews/{review_id}/file-attachment-comments/{comment_id}/
HTTP Methods
  • DELETE - Deletes the comment.
  • GET - Returns information on the comment.
  • PUT - Updates a file comment.
Parent Resource Review File Attachment Comment List Resource
Child Resources None
Anonymous Access Yes, if anonymous site access is enabled

Fields

diff_against_file_attachmentFile Attachment Resource The file changes were made against in a diff.
extra_dataDictionary Extra data as part of the comment. This depends on what is being commented on, and may be used in conjunction with an extension.
file_attachmentFile Attachment Resource The file the comment was made on.
idInteger The numeric ID of the comment.
issue_openedBoolean Whether or not a comment opens an issue.
issue_statusOne of dropped, open, resolved The status of an issue.
link_textString The text used to describe a link to the file. This may differ depending on the comment.
publicBoolean Whether or not the comment is part of a public review.
review_urlString The URL to the review UI for the comment on this file attachment.
textRich Text The comment text.
text_typeOne of plain, markdown, html The mode for the comment text field.
thumbnail_htmlString The HTML representing a thumbnail, if any, for this comment.
timestampString The date and time that the comment was made (in YYYY-MM-DD HH:MM:SS format).
userUser Resource The user who made the comment.

HTTP DELETE

Deletes the comment.

This will remove the comment from the review. This cannot be undone.

Only comments on draft reviews can be deleted. Attempting to delete a published comment will return a Permission Denied error.

Instead of a payload response on success, this will return HTTP 204 No Content.

Errors

100 - Does Not ExistHTTP 404 - Not Found Object does not exist
101 - Permission DeniedHTTP 403 - Forbidden You don’t have permission for this
103 - Not Logged InHTTP 401 - Unauthorized You are not logged in

HTTP GET

Returns information on the comment.

This contains the comment text, time the comment was made, and the file the comment was made on, amongst other information.

Errors

100 - Does Not ExistHTTP 404 - Not Found Object does not exist
101 - Permission DeniedHTTP 403 - Forbidden You don’t have permission for this
103 - Not Logged InHTTP 401 - Unauthorized You are not logged in

HTTP PUT

Updates a file comment.

This can update the text or region of an existing comment. It can only be done for comments that are part of a draft review.

Request Parameters

force_text_typeOne of plain, markdown, html The text type, if any, to force for returned text fields. The contents will be converted to the requested type in the payload, but will not be saved as that type.
issue_openedBoolean Whether or not the comment opens an issue.
issue_statusOne of dropped, open, resolved The status of an open issue.
textRich Text The comment text.
text_typeOne of plain, markdown The new content type for the comment text field. The default is to leave the type unchanged.

Errors

100 - Does Not ExistHTTP 404 - Not Found Object does not exist
101 - Permission DeniedHTTP 403 - Forbidden You don’t have permission for this
103 - Not Logged InHTTP 401 - Unauthorized You are not logged in
105 - Invalid Form DataHTTP 400 - Bad Request One or more fields had errors

Examples

application/vnd.reviewboard.org.file-attachment-comment+json

$ curl http://reviews.example.com/api/review-requests/8/reviews/8/file-attachment-comments/1/ -H "Accept: application/json"
Vary: Accept, Cookie
ETag: b23c0215bbf56b5d04d0dcf77905b7bba68737dd
Content-Type: application/vnd.reviewboard.org.file-attachment-comment+json
X-Content-Type-Options: nosniff
{
  "file_attachment_comment": {
    "diff_against_file_attachment": null, 
    "extra_data": {}, 
    "id": 1, 
    "issue_opened": false, 
    "issue_status": "", 
    "link_text": "screenshot1.png", 
    "links": {
      "delete": {
        "href": "http://reviews.example.com/api/review-requests/8/reviews/8/file-attachment-comments/1/", 
        "method": "DELETE"
      }, 
      "file_attachment": {
        "href": "http://reviews.example.com/api/review-requests/8/file-attachments/1/", 
        "method": "GET", 
        "title": "Example Attachment"
      }, 
      "self": {
        "href": "http://reviews.example.com/api/review-requests/8/reviews/8/file-attachment-comments/1/", 
        "method": "GET"
      }, 
      "update": {
        "href": "http://reviews.example.com/api/review-requests/8/reviews/8/file-attachment-comments/1/", 
        "method": "PUT"
      }, 
      "user": {
        "href": "http://reviews.example.com/api/users/admin/", 
        "method": "GET", 
        "title": "admin"
      }
    }, 
    "public": true, 
    "review_url": "/r/8/#fcomment1", 
    "text": "A fantastic comment on a fantastic file!", 
    "text_type": "plain", 
    "thumbnail_html": null, 
    "timestamp": "2011-08-26T02:49:32Z"
  }, 
  "stat": "ok"
}