Jump to >

Extension Resource

Review Board’s extension resource.

This resource special-cases the one in Djblets to provide API token and OAuth token access.

Details

Name extension
URI /api/extensions/{extension_name}/
Token Policy ID extension
HTTP Methods
  • GET - Handles HTTP GETs to individual object resources.
  • PUT - Updates the state of the extension.
Parent Resource Extension List Resource
Child Resources None
Anonymous Access Yes, if anonymous site access is enabled

Fields

authorString The author of the extension.
author_urlString The author’s website.
can_disableBoolean Whether or not the extension can be disabled.
can_enableBoolean Whether or not the extension can be enabled.
class_nameString The class name for the extension.
enabledBoolean Whether or not the extension is enabled.
installedBoolean Whether or not the extension is installed.
load_errorString If the extension could not be loaded, this will contain any errors captured while trying to load.
loadableBoolean Whether or not the extension is currently loadable. An extension may be installed but missing or may be broken due to a bug.
nameString The name of the extension.
summaryString A summary of the extension’s functionality.
versionString The installed version of the extension.

HTTP GET

Handles HTTP GETs to individual object resources.

By default, this will check for access permissions and query for the object. It will then return a serialized form of the object.

This may need to be overridden if needing more complex logic.

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

Updates the state of the extension.

If enabled is true, then the extension will be enabled, if it is not already. If false, it will be disabled.

Request Parameters

enabledBoolean Required

Whether or not to make the extension active.

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
107 - Enable Extension FailedHTTP 500 - Internal Server Error There was a problem enabling the extension
108 - Disable Extension FailedHTTP 500 - Internal Server Error There was a problem disabling the extension
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.extension+json

$ curl http://reviews.example.com/api/extensions/rbe.extension.EnterpriseExtension/ -H "Accept: application/json"
Vary: Accept, Cookie
ETag: 6d077c6d17d359381bccce8680ca200e3b5c9b72
Content-Type: application/vnd.reviewboard.org.extension+json
X-Content-Type-Options: nosniff
{
  "extension": {
    "author": null, 
    "author_url": null, 
    "can_disable": false, 
    "can_enable": false, 
    "class_name": "rbe.extension.EnterpriseExtension", 
    "enabled": false, 
    "installed": false, 
    "links": {
      "self": {
        "href": "http://reviews.example.com/api/extensions/rbe.extension.EnterpriseExtension/", 
        "method": "GET"
      }, 
      "update": {
        "href": "http://reviews.example.com/api/extensions/rbe.extension.EnterpriseExtension/", 
        "method": "PUT"
      }
    }, 
    "load_error": "This extension is not installed or could not be found. Try re-installing it and then click \"Scan for installed extensions.\"", 
    "loadable": false, 
    "name": "ReviewBoardPowerPack", 
    "summary": null, 
    "version": null
  }, 
  "stat": "ok"
}