Jump to >

Review Reply Diff Comment List Resource

Name diff_comments
URI /api/review-requests/{review_request_id}/reviews/{review_id}/replies/{reply_id}/diff-comments/
Description

Provides information on replies to diff comments made on a review reply.

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

HTTP Methods
  • GET - Returns the list of replies to comments made on a review reply.
  • POST - Creates a new reply to a diff comment on the parent review.
Parent Resource Review Reply Resource
Child Resources
Anonymous Access Yes, if anonymous site access is enabled

HTTP GET

Returns the list of replies to comments made on a review reply.

This list can be filtered down by using the ?line= and ?interdiff-revision=.

To filter for comments that start on a particular line in the file, using ?line=.

To filter for comments that span revisions of diffs, you can specify the second revision in the range using ?interdiff-revision=.

Request Parameters

Field Type Description
counts-only (optional) Boolean If specified, a single count field is returned with the number of results, instead of the results themselves.
interdiff-revision (optional) Integer The second revision in an interdiff revision range. The comments will be limited to this range.
line (optional) Integer The line number that each comment must start on.
max-results (optional) Integer The maximum number of results to return in this list. By default, this is 25.
start (optional) Integer The 0-based index of the first result in the list. The start index is usually the previous start index plus the number of previous results. By default, this is 0.

HTTP POST

Creates a new reply to a diff comment on the parent review.

This will create a new diff comment as part of this reply. The reply must be a draft reply.

Request Parameters

Field Type Description
reply_to_id (required) Integer The ID of the comment being replied to.
text (required) String The comment text.

Errors

Examples

application/vnd.reviewboard.org.review-reply-diff-comments+json

{
  "diff_comments": [
    {
      "first_line": 12, 
      "id": 9, 
      "interfilediff": null, 
      "issue_opened": false, 
      "issue_status": "", 
      "links": {
        "delete": {
          "href": "http://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/9/", 
          "method": "DELETE"
        }, 
        "filediff": {
          "href": "http://reviews.example.com/api/review-requests/8/diffs/3/files/41/", 
          "method": "GET", 
          "title": "/trunk/reviewboard/settings_local.py.tmpl (1797) -> /trunk/reviewboard/settings_local.py.tmpl ((working copy))"
        }, 
        "reply_to": {
          "href": "http://reviews.example.com/api/review-requests/8/reviews/8/diff-comments/5/", 
          "method": "GET", 
          "title": "This is just a sample comment."
        }, 
        "self": {
          "href": "http://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/9/", 
          "method": "GET"
        }, 
        "update": {
          "href": "http://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/9/", 
          "method": "PUT"
        }, 
        "user": {
          "href": "http://reviews.example.com/api/users/admin/", 
          "method": "GET", 
          "title": "admin"
        }
      }, 
      "num_lines": 3, 
      "public": true, 
      "text": "I completely agree.", 
      "timestamp": "2010-08-25 03:00:22"
    }, 
    {
      "first_line": 29, 
      "id": 10, 
      "interfilediff": null, 
      "issue_opened": false, 
      "issue_status": "", 
      "links": {
        "delete": {
          "href": "http://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/10/", 
          "method": "DELETE"
        }, 
        "filediff": {
          "href": "http://reviews.example.com/api/review-requests/8/diffs/3/files/41/", 
          "method": "GET", 
          "title": "/trunk/reviewboard/settings_local.py.tmpl (1797) -> /trunk/reviewboard/settings_local.py.tmpl ((working copy))"
        }, 
        "reply_to": {
          "href": "http://reviews.example.com/api/review-requests/8/reviews/8/diff-comments/6/", 
          "method": "GET", 
          "title": "Another sample comment."
        }, 
        "self": {
          "href": "http://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/10/", 
          "method": "GET"
        }, 
        "update": {
          "href": "http://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/10/", 
          "method": "PUT"
        }, 
        "user": {
          "href": "http://reviews.example.com/api/users/admin/", 
          "method": "GET", 
          "title": "admin"
        }
      }, 
      "num_lines": 3, 
      "public": true, 
      "text": "Utter nonsense!", 
      "timestamp": "2010-08-25 03:00:30"
    }
  ], 
  "links": {
    "create": {
      "href": "http://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/", 
      "method": "POST"
    }, 
    "self": {
      "href": "http://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/", 
      "method": "GET"
    }
  }, 
  "stat": "ok", 
  "total_results": 2
}

application/vnd.reviewboard.org.review-reply-diff-comments+xml

<?xml version="1.0" encoding="utf-8"?>
<rsp>
 <total_results>2</total_results>
 <stat>ok</stat>
 <diff_comments>
  <array>
   <item>
    <issue_opened>0</issue_opened>
    <interfilediff>
    </interfilediff>
    <num_lines>3</num_lines>
    <links>
     <self>
      <href>http://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/9/</href>
      <method>GET</method>
     </self>
     <update>
      <href>http://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/9/</href>
      <method>PUT</method>
     </update>
     <user>
      <href>http://reviews.example.com/api/users/admin/</href>
      <method>GET</method>
      <title>admin</title>
     </user>
     <reply_to>
      <href>http://reviews.example.com/api/review-requests/8/reviews/8/diff-comments/5/</href>
      <method>GET</method>
      <title>This is just a sample comment.</title>
     </reply_to>
     <delete>
      <href>http://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/9/</href>
      <method>DELETE</method>
     </delete>
     <filediff>
      <href>http://reviews.example.com/api/review-requests/8/diffs/3/files/41/</href>
      <method>GET</method>
      <title>/trunk/reviewboard/settings_local.py.tmpl (1797) -&gt; /trunk/reviewboard/settings_local.py.tmpl ((working copy))</title>
     </filediff>
    </links>
    <timestamp>2010-08-25 03:00:22</timestamp>
    <id>9</id>
    <text>I completely agree.</text>
    <first_line>12</first_line>
    <public>1</public>
    <issue_status></issue_status>
   </item>
   <item>
    <issue_opened>0</issue_opened>
    <interfilediff>
    </interfilediff>
    <num_lines>3</num_lines>
    <links>
     <self>
      <href>http://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/10/</href>
      <method>GET</method>
     </self>
     <update>
      <href>http://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/10/</href>
      <method>PUT</method>
     </update>
     <user>
      <href>http://reviews.example.com/api/users/admin/</href>
      <method>GET</method>
      <title>admin</title>
     </user>
     <reply_to>
      <href>http://reviews.example.com/api/review-requests/8/reviews/8/diff-comments/6/</href>
      <method>GET</method>
      <title>Another sample comment.</title>
     </reply_to>
     <delete>
      <href>http://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/10/</href>
      <method>DELETE</method>
     </delete>
     <filediff>
      <href>http://reviews.example.com/api/review-requests/8/diffs/3/files/41/</href>
      <method>GET</method>
      <title>/trunk/reviewboard/settings_local.py.tmpl (1797) -&gt; /trunk/reviewboard/settings_local.py.tmpl ((working copy))</title>
     </filediff>
    </links>
    <timestamp>2010-08-25 03:00:30</timestamp>
    <id>10</id>
    <text>Utter nonsense!</text>
    <first_line>29</first_line>
    <public>1</public>
    <issue_status></issue_status>
   </item>
  </array>
 </diff_comments>
 <links>
  <self>
   <href>http://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/</href>
   <method>GET</method>
  </self>
  <create>
   <href>http://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/</href>
   <method>POST</method>
  </create>
 </links>
</rsp>