Jump to >

Screenshot List Resource

Name screenshots
URI /api/review-requests/{review_request_id}/screenshots/
Description A resource representing a screenshot on a review request.
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

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.
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.

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

Field Type Description
caption (optional) String The optional caption describing the screenshot.
path (required) Uploaded File The screenshot to upload.

Errors

Examples

application/vnd.reviewboard.org.screenshots+json

{
  "links": {
    "create": {
      "href": "http://reviews.example.com/api/review-requests/8/screenshots/", 
      "method": "POST"
    }, 
    "self": {
      "href": "http://reviews.example.com/api/review-requests/8/screenshots/", 
      "method": "GET"
    }
  }, 
  "screenshots": [
    {
      "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", 
  "total_results": 1
}

application/vnd.reviewboard.org.screenshots+xml

<?xml version="1.0" encoding="utf-8"?>
<rsp>
 <total_results>1</total_results>
 <stat>ok</stat>
 <screenshots>
  <array>
   <item>
    <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>
   </item>
  </array>
 </screenshots>
 <links>
  <self>
   <href>http://reviews.example.com/api/review-requests/8/screenshots/</href>
   <method>GET</method>
  </self>
  <create>
   <href>http://reviews.example.com/api/review-requests/8/screenshots/</href>
   <method>POST</method>
  </create>
 </links>
</rsp>