Screenshot Resource¶
Name | screenshot |
URI | /api/review-requests/{review_request_id}/screenshots/{screenshot_id}/ |
Description | A resource representing a screenshot on a review request. |
HTTP Methods | |
Parent Resource | Screenshot List Resource |
Child Resources | |
Anonymous Access | Yes, if anonymous site access is enabled |
Fields¶
Field | Type | Description |
---|---|---|
caption | String | The screenshot’s descriptive caption. |
id | Integer | The numeric ID of the screenshot. |
path | String | The path of the screenshot’s image file, relative to the media directory configured on the Review Board server. |
thumbnail_url | String | The URL of the screenshot’s thumbnail file. If this is not an absolute URL (for example, if it is just a path), then it’s relative to the Review Board server’s URL. |
url | String | The URL of the screenshot file. If this is not an absolute URL (for example, if it is just a path), then it’s relative to the Review Board server’s URL. |
Links¶
Name | Method | Resource |
---|---|---|
delete | DELETE | Screenshot Resource |
screenshot_comments | GET | Screenshot Comment List Resource |
self | GET | Screenshot Resource |
update | PUT | Screenshot Resource |
HTTP DELETE¶
Deletes the screenshot.
This will remove the screenshot from the draft review request. This cannot be undone.
Deleting a screenshot will automatically create a new review request draft, if one doesn’t already exist. The screenshot won’t be actually removed until the review request draft is published.
This can be used to remove old screenshots that were previously shown, as well as newly added screenshots that were part of the draft.
Instead of a payload response on success, this will return HTTP 204 No Content.
HTTP GET¶
Returns the serialized object for the resource.
This will require login if anonymous access isn’t enabled on the site.
HTTP PUT¶
Updates the screenshot’s data.
This allows updating the screenshot. The caption, currently, is the only thing that can be updated.
Updating a screenshot will automatically create a new review request draft, if one doesn’t already exist. The updates won’t be public until the review request draft is published.
Request Parameters¶
Field | Type | Description |
---|---|---|
caption (optional) | String | The new caption for the screenshot. |
Examples¶
application/json¶
{
"screenshot": {
"caption": "Example Screenshot",
"id": 1,
"links": {
"delete": {
"href": "http://reviews.example.com/api/review-requests/8/screenshots/1/",
"method": "DELETE"
},
"screenshot_comments": {
"href": "http://reviews.example.com/api/review-requests/8/screenshots/1/screenshot-comments/",
"method": "GET"
},
"self": {
"href": "http://reviews.example.com/api/review-requests/8/screenshots/1/",
"method": "GET"
},
"update": {
"href": "http://reviews.example.com/api/review-requests/8/screenshots/1/",
"method": "PUT"
}
},
"path": "uploaded/images/2010/08/13/screenshot1.png",
"thumbnail_url": "/media/uploaded/images/2010/08/13/screenshot1_400x100.png",
"url": "/media/uploaded/images/2010/08/13/screenshot1.png"
},
"stat": "ok"
}
application/xml¶
<?xml version="1.0" encoding="utf-8"?>
<rsp>
<stat>ok</stat>
<screenshot>
<links>
<self>
<href>http://reviews.example.com/api/review-requests/8/screenshots/1/</href>
<method>GET</method>
</self>
<screenshot_comments>
<href>http://reviews.example.com/api/review-requests/8/screenshots/1/screenshot-comments/</href>
<method>GET</method>
</screenshot_comments>
<update>
<href>http://reviews.example.com/api/review-requests/8/screenshots/1/</href>
<method>PUT</method>
</update>
<delete>
<href>http://reviews.example.com/api/review-requests/8/screenshots/1/</href>
<method>DELETE</method>
</delete>
</links>
<url>/media/uploaded/images/2010/08/13/screenshot1.png</url>
<caption>Example Screenshot</caption>
<thumbnail_url>/media/uploaded/images/2010/08/13/screenshot1_400x100.png</thumbnail_url>
<path>uploaded/images/2010/08/13/screenshot1.png</path>
<id>1</id>
</screenshot>
</rsp>