Jump to >

Screenshot List Resource

A resource representing a screenshot on a review request.

Details

Name screenshots
URI /api/review-requests/{review_request_id}/screenshots/
Token Policy ID screenshot
HTTP Methods
  • GET - Returns a list of screenshots on the review request.
  • POST - Creates a new screenshot from an uploaded file.
Parent Resource Review Request Resource
Child Resources
Anonymous Access Yes, if anonymous site access is enabled

HTTP GET

Returns a list of screenshots on the review request.

Each screenshot in this list is an uploaded screenshot that is shown on the review request.

Request Parameters

counts-onlyBoolean If specified, a single count field is returned with the number of results, instead of the results themselves.
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.

Creating a new screenshot will automatically create a new review request draft, if one doesn’t already exist. This screenshot will be part of that draft, and will be shown on the review request when it’s next published.

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.screenshots+json

$ curl http://reviews.example.com/api10/ -H "Accept: application/json"
Vary: Accept, Cookie
Item-Content-Type: application/vnd.reviewboard.org.screenshot+json
Content-Type: application/vnd.reviewboard.org.screenshots+json
ETag: 5e4bd2c22d36646808f2cde18fac81f222a75d7c
X-Content-Type-Options: nosniff
{
  "links": {
    "create": {
      "href": "http://reviews.example.com/api10/", 
      "method": "POST"
    }, 
    "self": {
      "href": "http://reviews.example.com/api10/", 
      "method": "GET"
    }
  }, 
  "screenshots": [], 
  "stat": "ok", 
  "total_results": 0
}