Jump to >

Draft Screenshot Resource

Name draft_screenshot
URI /api/review-requests/{review_request_id}/draft/screenshots/{screenshot_id}/
Description

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.

HTTP Methods
  • DELETE - Deletes the screenshot from the draft.
  • GET - Returns the serialized object for the resource.
  • PUT - Updates the screenshot’s data.
Parent Resource Draft Screenshot List Resource
Child Resources None
Anonymous Access No

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.

HTTP DELETE

Deletes the screenshot from the draft.

This will remove the screenshot from the draft review request. This cannot be undone.

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 in a draft. The caption, currently, is the only thing that can be updated.

Request Parameters

Field Type Description
caption (optional) String The new caption for the screenshot.

Examples

application/vnd.reviewboard.org.draft-screenshot+json

{
  "draft_screenshot": {
    "caption": "Example Screenshot", 
    "id": 1, 
    "links": {
      "delete": {
        "href": "http://reviews.example.com/api/review-requests/8/draft/screenshots/1/", 
        "method": "DELETE"
      }, 
      "self": {
        "href": "http://reviews.example.com/api/review-requests/8/draft/screenshots/1/", 
        "method": "GET"
      }, 
      "update": {
        "href": "http://reviews.example.com/api/review-requests/8/draft/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/vnd.reviewboard.org.draft-screenshot+xml

<?xml version="1.0" encoding="utf-8"?>
<rsp>
 <draft_screenshot>
  <links>
   <self>
    <href>http://reviews.example.com/api/review-requests/8/draft/screenshots/1/</href>
    <method>GET</method>
   </self>
   <update>
    <href>http://reviews.example.com/api/review-requests/8/draft/screenshots/1/</href>
    <method>PUT</method>
   </update>
   <delete>
    <href>http://reviews.example.com/api/review-requests/8/draft/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>
 </draft_screenshot>
 <stat>ok</stat>
</rsp>