File Diff Comment List Resource¶
Added in 1.6
Provides information on comments made on a particular per-file diff.
The list of comments cannot be modified from this resource. It’s meant purely as a way to see existing comments that were made on a diff. These comments will span all public reviews.
Details¶
Name | diff_comments |
URI | /api/review-requests/{review_request_id}/diffs/{diff_revision}/files/{filediff_id}/diff-comments/ |
Token Policy ID | diff_comment |
HTTP Methods |
|
Parent Resource | File Diff Resource |
Child Resources | None |
Links¶
Name | Method | Resource |
---|---|---|
self | GET | File Diff Comment List Resource |
HTTP GET¶
Returns the list of comments on a file in a diff.
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¶
counts-onlyBoolean | If specified, a single count field is returned with the number of results, instead of the results themselves. |
interdiff-revisionInteger | The second revision in an interdiff revision range. The comments will be limited to this range. |
lineInteger | The line number that each comment must start on. |
max-resultsInteger | The maximum number of results to return in this list. By default, this is 25. There is a hard limit of 200; if you need more than 200 results, you will need to make more than one request, using the “next” pagination link. |
order-byString | Comma-separated list of fields to order by. Added in 1.7.10 |
startInteger | 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. |
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 |
112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden | Your OAuth2 token lacks the necessary scopes for this request. |
113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden | OAuth2 token access for this resource is prohibited. |
Examples¶
application/vnd.reviewboard.org.file-diff-comments+json¶
$ curl https://reviews.example.com/api/review-requests/8/diffs/3/files/41/diff-comments/ -H "Accept: application/json"
HTTP 200 OK
Content-Length: 4310
Content-Type: application/vnd.reviewboard.org.file-diff-comments+json
ETag: c898812b8999cd9e0ebbfb6caa5de0a0d849ea51
Item-Content-Type: application/vnd.reviewboard.org.file-diff-comment+json
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
{
"diff_comments": [
{
"extra_data": {},
"first_line": 12,
"id": 5,
"interfilediff": null,
"issue_opened": false,
"issue_status": "",
"links": {
"delete": {
"href": "https://reviews.example.com/api/review-requests/8/reviews/8/diff-comments/5/",
"method": "DELETE"
},
"filediff": {
"href": "https://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))"
},
"self": {
"href": "https://reviews.example.com/api/review-requests/8/reviews/8/diff-comments/5/",
"method": "GET"
},
"update": {
"href": "https://reviews.example.com/api/review-requests/8/reviews/8/diff-comments/5/",
"method": "PUT"
},
"user": {
"href": "https://reviews.example.com/api/users/admin/",
"method": "GET",
"title": "admin"
}
},
"num_lines": 3,
"public": true,
"text": "This is just a sample comment.",
"text_type": "plain",
"timestamp": "2010-08-22T17:25:41Z"
},
{
"extra_data": {},
"first_line": 29,
"id": 6,
"interfilediff": null,
"issue_opened": false,
"issue_status": "",
"links": {
"delete": {
"href": "https://reviews.example.com/api/review-requests/8/reviews/8/diff-comments/6/",
"method": "DELETE"
},
"filediff": {
"href": "https://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))"
},
"self": {
"href": "https://reviews.example.com/api/review-requests/8/reviews/8/diff-comments/6/",
"method": "GET"
},
"update": {
"href": "https://reviews.example.com/api/review-requests/8/reviews/8/diff-comments/6/",
"method": "PUT"
},
"user": {
"href": "https://reviews.example.com/api/users/admin/",
"method": "GET",
"title": "admin"
}
},
"num_lines": 3,
"public": true,
"text": "Another sample comment.",
"text_type": "plain",
"timestamp": "2010-08-22T17:25:52Z"
},
{
"extra_data": {},
"first_line": 12,
"id": 9,
"interfilediff": null,
"issue_opened": false,
"issue_status": "",
"links": {
"delete": {
"href": "https://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/9/",
"method": "DELETE"
},
"filediff": {
"href": "https://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": "https://reviews.example.com/api/review-requests/8/reviews/8/diff-comments/5/",
"method": "GET",
"title": "This is just a sample comment."
},
"self": {
"href": "https://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/9/",
"method": "GET"
},
"update": {
"href": "https://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/9/",
"method": "PUT"
},
"user": {
"href": "https://reviews.example.com/api/users/admin/",
"method": "GET",
"title": "admin"
}
},
"num_lines": 3,
"public": true,
"text": "I completely agree.",
"text_type": "plain",
"timestamp": "2010-08-25T03:00:22Z"
},
{
"extra_data": {},
"first_line": 29,
"id": 10,
"interfilediff": null,
"issue_opened": false,
"issue_status": "",
"links": {
"delete": {
"href": "https://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/10/",
"method": "DELETE"
},
"filediff": {
"href": "https://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": "https://reviews.example.com/api/review-requests/8/reviews/8/diff-comments/6/",
"method": "GET",
"title": "Another sample comment."
},
"self": {
"href": "https://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/10/",
"method": "GET"
},
"update": {
"href": "https://reviews.example.com/api/review-requests/8/reviews/8/replies/10/diff-comments/10/",
"method": "PUT"
},
"user": {
"href": "https://reviews.example.com/api/users/admin/",
"method": "GET",
"title": "admin"
}
},
"num_lines": 3,
"public": true,
"text": "Utter nonsense!",
"text_type": "plain",
"timestamp": "2010-08-25T03:00:30Z"
}
],
"links": {
"self": {
"href": "https://reviews.example.com/api/review-requests/8/diffs/3/files/41/diff-comments/",
"method": "GET"
}
},
"stat": "ok",
"total_results": 4
}