Draft Screenshot List Resource¶
Provides information on new screenshots being added to a draft of a review request.
These are screenshots that will be shown once the pending review request draft is published.
Details¶
Name | draft_screenshots |
URI | /api/review-requests/{review_request_id}/draft/screenshots/ |
Token Policy ID | draft_screenshot |
HTTP Methods | |
Parent Resource | |
Child Resources |
Links¶
Name |
Method |
Resource |
---|---|---|
create | POST |
|
self | GET |
HTTP GET¶
Returns a list of draft screenshots.
Each screenshot in this list is an uploaded screenshot that will be shown in the final review request. These may include newly uploaded screenshots or screenshots that were already part of the existing review request. In the latter case, existing screenshots are shown so that their captions can be added.
Request Parameters¶
counts-onlyBoolean | If specified, a single |
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. |
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. |
HTTP POST¶
Creates a new screenshot from an uploaded file.
This accepts any standard image format (PNG, GIF, JPEG) and associates it with a draft of a review request.
It is expected that the client will send the data as part of a
multipart/form-data mimetype. The screenshot’s name
and content should be stored in the path
field. A typical request
may look like:
-- SoMe BoUnDaRy
Content-Disposition: form-data; name=path; filename="foo.png"
<PNG content here>
-- SoMe BoUnDaRy --
Request Parameters¶
pathUploaded file | Required The screenshot to upload. |
captionString | The optional caption describing the screenshot. |
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.draft-screenshots+json¶
$ curl https://reviews.example.com/api/review-requests/8/draft/screenshots/ -H "Accept: application/json"
HTTP 200 OK
Content-Length: 1020
Content-Type: application/vnd.reviewboard.org.draft-screenshots+json
ETag: 204b591b9855207d5d7b7594a3b8298fa0310bcf
Item-Content-Type: application/vnd.reviewboard.org.draft-screenshot+json
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
{
"draft_screenshots": [
{
"absolute_url": "https://reviews.example.com/media/uploaded/images/2010/08/13/screenshot1.png",
"caption": "Example Screenshot",
"filename": "screenshot1.png",
"id": 1,
"links": {
"delete": {
"href": "https://reviews.example.com/api/review-requests/8/draft/screenshots/1/",
"method": "DELETE"
},
"self": {
"href": "https://reviews.example.com/api/review-requests/8/draft/screenshots/1/",
"method": "GET"
},
"update": {
"href": "https://reviews.example.com/api/review-requests/8/draft/screenshots/1/",
"method": "PUT"
}
},
"path": "uploaded/images/2010/08/13/screenshot1.png",
"review_url": "/r/8/s/1/",
"thumbnail_url": "/media/uploaded/images/2010/08/13/screenshot1_400x100.png",
"url": "/media/uploaded/images/2010/08/13/screenshot1.png"
}
],
"links": {
"create": {
"href": "https://reviews.example.com/api/review-requests/8/draft/screenshots/",
"method": "POST"
},
"self": {
"href": "https://reviews.example.com/api/review-requests/8/draft/screenshots/",
"method": "GET"
}
},
"stat": "ok",
"total_results": 1
}