Jump to >

File Diff List Resource

Name files
URI /api/review-requests/{review_request_id}/diffs/{diff_revision}/files/
Description

Provides information on per-file diffs.

Each of these contains a single, self-contained diff file that applies to exactly one file on a repository.

HTTP Methods
  • GET - Returns the list of public per-file diffs on the review request.
Parent Resource Diff Resource
Child Resources
Anonymous Access Yes, if anonymous site access is enabled

HTTP GET

Returns the list of public per-file diffs on the review request.

Each per-file diff has information about the diff. It does not provide the contents of the diff. For that, access the per-file diff’s resource directly and use the correct mimetype.

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.
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.

Examples

application/vnd.reviewboard.org.files+json

{
  "files": [
    {
      "dest_detail": "(working copy)", 
      "dest_file": "/trunk/reviewboard/settings_local.py.tmpl", 
      "id": 31, 
      "links": {
        "diff_comments": {
          "href": "http://reviews.example.com/api/review-requests/8/diffs/1/files/31/diff-comments/", 
          "method": "GET"
        }, 
        "self": {
          "href": "http://reviews.example.com/api/review-requests/8/diffs/1/files/31/", 
          "method": "GET"
        }
      }, 
      "source_file": "/trunk/reviewboard/settings_local.py.tmpl", 
      "source_revision": "1797"
    }, 
    {
      "dest_detail": "(revision 0)", 
      "dest_file": "/trunk/reviewboard/TESTING", 
      "id": 36, 
      "links": {
        "diff_comments": {
          "href": "http://reviews.example.com/api/review-requests/8/diffs/1/files/36/diff-comments/", 
          "method": "GET"
        }, 
        "self": {
          "href": "http://reviews.example.com/api/review-requests/8/diffs/1/files/36/", 
          "method": "GET"
        }
      }, 
      "source_file": "/trunk/reviewboard/TESTING", 
      "source_revision": "PRE-CREATION"
    }
  ], 
  "links": {
    "self": {
      "href": "http://reviews.example.com/api/review-requests/8/diffs/1/files/", 
      "method": "GET"
    }
  }, 
  "stat": "ok", 
  "total_results": 2
}

application/vnd.reviewboard.org.files+xml

<?xml version="1.0" encoding="utf-8"?>
<rsp>
 <files>
  <array>
   <item>
    <links>
     <self>
      <href>http://reviews.example.com/api/review-requests/8/diffs/1/files/31/</href>
      <method>GET</method>
     </self>
     <diff_comments>
      <href>http://reviews.example.com/api/review-requests/8/diffs/1/files/31/diff-comments/</href>
      <method>GET</method>
     </diff_comments>
    </links>
    <dest_detail>(working copy)</dest_detail>
    <source_revision>1797</source_revision>
    <source_file>/trunk/reviewboard/settings_local.py.tmpl</source_file>
    <dest_file>/trunk/reviewboard/settings_local.py.tmpl</dest_file>
    <id>31</id>
   </item>
   <item>
    <links>
     <self>
      <href>http://reviews.example.com/api/review-requests/8/diffs/1/files/36/</href>
      <method>GET</method>
     </self>
     <diff_comments>
      <href>http://reviews.example.com/api/review-requests/8/diffs/1/files/36/diff-comments/</href>
      <method>GET</method>
     </diff_comments>
    </links>
    <dest_detail>(revision 0)</dest_detail>
    <source_revision>PRE-CREATION</source_revision>
    <source_file>/trunk/reviewboard/TESTING</source_file>
    <dest_file>/trunk/reviewboard/TESTING</dest_file>
    <id>36</id>
   </item>
  </array>
 </files>
 <total_results>2</total_results>
 <stat>ok</stat>
 <links>
  <self>
   <href>http://reviews.example.com/api/review-requests/8/diffs/1/files/</href>
   <method>GET</method>
  </self>
 </links>
</rsp>