Review List Resource¶
Name | reviews |
URI | /api/review-requests/{review_request_id}/reviews/ |
Description | Provides information on reviews. |
HTTP Methods | |
Parent Resource | Review Request Resource |
Child Resources | |
Anonymous Access | Yes, if anonymous site access is enabled |
Links¶
Name | Method | Resource |
---|---|---|
create | POST | Review List Resource |
review_draft | GET | Review Draft Resource |
self | GET | Review List Resource |
HTTP GET¶
Returns the list of all public reviews on a review request.
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. 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. |
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. |
Errors¶
HTTP POST¶
Creates a new review.
The new review will start off as private. Only the author of the review (the user who is logged in and issuing this API call) will be able to see and interact with the review.
Initial data for the review can be provided by passing data for any number of the fields. If nothing is provided, the review will start off as blank.
If the user submitting this review already has a pending draft review on this review request, then this will update the existing draft and return HTTP 303 See Other. Otherwise, this will create a new draft and return HTTP 201 Created. Either way, this request will return without a payload and with a Location header pointing to the location of the new draft review.
Request Parameters¶
Field | Type | Description |
---|---|---|
body_bottom (optional) | String | The review content below the comments. |
body_top (optional) | String | The review content above the comments. |
public (optional) | Boolean | Whether or not to make the review public. If a review is public, it cannot be made private again. |
ship_it (optional) | Boolean | Whether or not to mark the review “Ship It!” |
Examples¶
application/vnd.reviewboard.org.reviews+json¶
{
"links": {
"create": {
"href": "http://reviews.example.com/api/review-requests/8/reviews/",
"method": "POST"
},
"review_draft": {
"href": "http://reviews.example.com/api/review-requests/8/reviews/draft/",
"method": "GET"
},
"self": {
"href": "http://reviews.example.com/api/review-requests/8/reviews/",
"method": "GET"
}
},
"reviews": [
{
"body_bottom": "",
"body_top": "",
"id": 8,
"links": {
"delete": {
"href": "http://reviews.example.com/api/review-requests/8/reviews/8/",
"method": "DELETE"
},
"diff_comments": {
"href": "http://reviews.example.com/api/review-requests/8/reviews/8/diff-comments/",
"method": "GET"
},
"file_attachment_comments": {
"href": "http://reviews.example.com/api/review-requests/8/reviews/8/file-attachment-comments/",
"method": "GET"
},
"replies": {
"href": "http://reviews.example.com/api/review-requests/8/reviews/8/replies/",
"method": "GET"
},
"screenshot_comments": {
"href": "http://reviews.example.com/api/review-requests/8/reviews/8/screenshot-comments/",
"method": "GET"
},
"self": {
"href": "http://reviews.example.com/api/review-requests/8/reviews/8/",
"method": "GET"
},
"update": {
"href": "http://reviews.example.com/api/review-requests/8/reviews/8/",
"method": "PUT"
},
"user": {
"href": "http://reviews.example.com/api/users/admin/",
"method": "GET",
"title": "admin"
}
},
"public": true,
"ship_it": false,
"timestamp": "2010-08-28T02:25:31.503Z"
}
],
"stat": "ok",
"total_results": 1
}
application/vnd.reviewboard.org.reviews+xml¶
<?xml version="1.0" encoding="utf-8"?>
<rsp>
<reviews>
<array>
<item>
<body_top></body_top>
<ship_it>0</ship_it>
<links>
<diff_comments>
<href>http://reviews.example.com/api/review-requests/8/reviews/8/diff-comments/</href>
<method>GET</method>
</diff_comments>
<file_attachment_comments>
<href>http://reviews.example.com/api/review-requests/8/reviews/8/file-attachment-comments/</href>
<method>GET</method>
</file_attachment_comments>
<self>
<href>http://reviews.example.com/api/review-requests/8/reviews/8/</href>
<method>GET</method>
</self>
<update>
<href>http://reviews.example.com/api/review-requests/8/reviews/8/</href>
<method>PUT</method>
</update>
<screenshot_comments>
<href>http://reviews.example.com/api/review-requests/8/reviews/8/screenshot-comments/</href>
<method>GET</method>
</screenshot_comments>
<user>
<href>http://reviews.example.com/api/users/admin/</href>
<method>GET</method>
<title>admin</title>
</user>
<replies>
<href>http://reviews.example.com/api/review-requests/8/reviews/8/replies/</href>
<method>GET</method>
</replies>
<delete>
<href>http://reviews.example.com/api/review-requests/8/reviews/8/</href>
<method>DELETE</method>
</delete>
</links>
<timestamp>2010-08-28T02:25:31.503Z</timestamp>
<id>8</id>
<body_bottom></body_bottom>
<public>1</public>
</item>
</array>
</reviews>
<total_results>1</total_results>
<stat>ok</stat>
<links>
<self>
<href>http://reviews.example.com/api/review-requests/8/reviews/</href>
<method>GET</method>
</self>
<review_draft>
<href>http://reviews.example.com/api/review-requests/8/reviews/draft/</href>
<method>GET</method>
</review_draft>
<create>
<href>http://reviews.example.com/api/review-requests/8/reviews/</href>
<method>POST</method>
</create>
</links>
</rsp>