• Get Review Board
  • What's New
  • Products
  • Review Board Code review, image review, and document review
  • Documentation
  • Release Notes
  • Power Pack Enterprise integrations, reports, and enhanced document review
  • Try for 60 Days
  • Purchase
  • RBCommons Review Board as a Service, hosted by us
  • Pricing
  • RBTools Command line tools and Python API for Review Board
  • Documentation
  • Release Notes
  • Review Bot Automated code review, connecting tools you already use
  • Documentation
  • Release Notes
  • RB Gateway Manage Git and Mercurial repositories in your network
  • Documentation
  • Release Notes
  • Learn and Explore
  • What is Code Review?
  • Documentation
  • Frequently Asked Questions
  • Support Options
  • Third-Party Integrations
  • Demo
  • Review Board RBTools Power Pack Review Bot Djblets RB Gateway
    1. RBTools 3.x
    2. Version 5.x
    3. Version 4.x
    4. Version 3.x
    5. Version 2.0
    6. Version 1.0
    7. Version 0.7
    8. Version 0.6
    9. Version 0.5
    10. RBTools Python API
    11. Resource-Specific Functionality
  • Home
  • rbt
  • Configuration
  • Authenticating to Review Board
  • Repository Configuration
  • Per-User Configuration
  • Team Foundation Server Configuration
  • Commands
  • alias
  • api-get
  • attach
  • clear-cache
  • close
  • diff
  • install
  • land
  • list-repo-types
  • login
  • logout
  • patch
  • post
  • publish
  • review
  • setup-completion
  • setup-repo
  • stamp
  • status
  • status-update
  • RBTools Python API
  • Overview of the Python API Client
  • Tutorial
  • Resource-Specific Functionality
  • RBTools Workflows
  • Using RBTools with Git
  • Using RBTools With Cliosoft SOS
  • Using RBTools with HCL VersionVault and IBM ClearCase
  • Glossary
  • General Index
  • Release Notes
  • This documentation covers RBTools 3.x. You can select a version above or view the latest documentation.

    Resource-Specific Functionality¶

    The API provides extra functionality specific to a number of a resources.

    Root List Resource Functionality¶

    The Root List Resource provides a set of uri-templates which can be used to retrieve a specific resource without traversing the resource tree. Each uri-template consists of a key and a uri-template. For examples, please see the Root List Resource page.

    The API client allows the templates to be used through method calls on the root resource. For each uri-template, a method named get_<name> will be created. This method will take keyword arguments which will be used to replace the fields in the uri-template. We will use the following uri-template as an example.

    "files": "http://reviews.example.com/api/review-requests/{review_request_id}/diffs/{diff_revision}/files/"
    

    To use this uri-template, the get_files() method would be called. For example, you could retrieve a specific File Diff List Resource using the following code:

    files = root.get_files(review_request_id=1, diff_revision=1)
    

    Diff List Resource Functionality¶

    The resource object for a Diff List Resource provides the following additional methods.

    DiffListResource.upload_diff(diff, parent_diff=None, base_dir=None)¶

    Upload a diff contained in diff with the optional parent_diff and optional base_dir.

    Diff Resource Functionality¶

    The resource object for a Diff Resource provides the following additional methods.

    DiffResource.get_patch()¶

    Retrieve the actual contents of the uploaded diff.

    File Diff Resource Functionality¶

    The resource object for a File Diff Resource provides the following additional methods.

    FileDiffResource.get_patch()¶

    Retrieve the actual contents of the uploaded diff for this file.

    FileDiffResource.get_diff_data()¶

    Retrieves the actual raw diff data for the file. For more information about what this contains, see the File Diff Resource documentation.

    File Attachment List Resource Functionality¶

    The resource object for a File Attachment List Resource provides the following additional methods.

    FileAttachmentListResource.upload_attachment(filename, content, caption=None, attachment_history=None)¶

    Uploads a new attachment containing content, named filename, with the optional caption and optional attachment_history.

    Draft File Attachment List Resource Functionality¶

    The resource object for a Draft File Attachment List Resource provides the following additional methods.

    DraftFileAttachmentListResource.upload_attachment(filename, content, caption=None, attachment_history=None)¶

    Uploads a new attachment containing content, named filename, with the optional caption and optional attachment_history.

    Screenshot List Resource Functionality¶

    The resource object for a Screenshot List Resource provides the following additional methods.

    ScreenshotListResource.upload_attachment(filename, content, caption=None)¶

    Uploads a new screenshot contained in content, named filename, with the optional caption.

    Draft Screenshot List Resource Functionality¶

    The resource object for a Draft Screenshot List Resource provides the following additional methods.

    DraftScreenshotListResource.upload_attachment(filename, content, caption=None)¶

    Uploads a new screenshot contained in content, named filename, with the optional caption.

    Review Request Resource Functionality¶

    The resource object for a Review Request Resource provides the following additional methods.

    ReviewRequestResource.get_or_create_draft(**kwargs)¶

    Retrieve the review request’s draft resource. If the draft does not exist it will be created and retrieved.

    Keep up with the latest Review Board releases, security updates, and helpful information.

    About
    News
    Demo
    RBCommons Hosting
    Integrations
    Happy Users
    Support Options
    Documentation
    FAQ
    User Manual
    RBTools
    Administration Guide
    Power Pack
    Release Notes
    Downloads
    Review Board
    RBTools
    Djblets
    Power Pack
    Package Store
    PGP Signatures
    Contributing
    Bug Tracker
    Submit Patches
    Development Setup
    Wiki
    Follow Us
    Mailing Lists
    Reddit
    Twitter
    Mastodon
    Facebook
    YouTube

    Copyright © 2006-2025 Beanbag, Inc. All rights reserved.

    Terms of Service — Privacy Policy — AI Ethics Policy — Branding

    On this page

    • [Top]
    • Root List Resource Functionality
    • Diff List Resource Functionality
    • Diff Resource Functionality
    • File Diff Resource Functionality
    • File Attachment List Resource Functionality
    • Draft File Attachment List Resource Functionality
    • Screenshot List Resource Functionality
    • Draft Screenshot List Resource Functionality
    • Review Request Resource Functionality