Jump to >

OAuth2 Applications List Resource

Added in 3.0

Manage OAuth2 applications.

Details

Name oauth_apps
URI /api/oauth-apps/
Token Policy ID oauth_app
HTTP Methods
  • GET - Return information about all OAuth2 applications.
  • POST - Create a new OAuth2 application.
Parent Resource Root List Resource
Child Resources
Anonymous Access No

HTTP GET

Return information about all OAuth2 applications.

This will be limited to the client’s logged in user’s applications unless the user is an administrator.

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

If present, the results will be filtered to Applications owned by the specified user.

Only administrators have access to Applications owned by other users.

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

Create a new OAuth2 application.

The client_secret and client_id fields will be auto-generated and returned in the response (providing the request is successful).

Extra data can be stored later lookup. See Storing/Accessing Extra Data for more information.

Request Parameters

authorization_grant_typeOne of authorization-code, client-credentials, implicit, password Required

How authorization is granted to the application.

client_typeOne of confidential, public Required

The client type. Confidential clients must be able to keep user passwords secure.

nameString Required

The application name.

enabledBoolean

Whether or not the application will be enabled.

If disabled, authentication and API access will not be available for clients using this application.

Defaults to true when creating a new Application.

redirect_urisString A comma-separated list of allowed URIs to redirect to.
skip_authorizationBoolean Whether or not users will be prompted for authentication.
userString

The user who owns the application.

This field is only available to super users.

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.oauth-apps+json

$ curl http://reviews.example.com/api/oauth-apps/ -H "Accept: application/json"
Vary: Accept, Cookie
Item-Content-Type: application/vnd.reviewboard.org.oauth-app+json
Content-Type: application/vnd.reviewboard.org.oauth-apps+json
X-Content-Type-Options: nosniff
{
  "links": {
    "create": {
      "href": "http://reviews.example.com/api/oauth-apps/", 
      "method": "POST"
    }, 
    "self": {
      "href": "http://reviews.example.com/api/oauth-apps/", 
      "method": "GET"
    }
  }, 
  "oauth_apps": [
    {
      "authorization_grant_type": "client-credentials", 
      "client_id": "awesome-app", 
      "client_secret": "ILWUl0tzMvDhBZZVnmtIRzL0vJPIaUMJykBXSfnjBAGOo0L1tk1yEv0akpuovA9vI5heXdrEDzHJny4S98XIvoMzh6Zx8Fr4g1aOZ22i6RNrO56Ja23X09xAETA3mUqK", 
      "client_type": "public", 
      "enabled": true, 
      "extra_data": {}, 
      "id": 1, 
      "links": {
        "delete": {
          "href": "http://reviews.example.com/api/oauth-apps/1/", 
          "method": "DELETE"
        }, 
        "self": {
          "href": "http://reviews.example.com/api/oauth-apps/1/", 
          "method": "GET"
        }, 
        "update": {
          "href": "http://reviews.example.com/api/oauth-apps/1/", 
          "method": "PUT"
        }, 
        "user": {
          "href": "http://reviews.example.com/api/users/doc/", 
          "method": "GET", 
          "title": "doc"
        }
      }, 
      "name": "Awesome App", 
      "redirect_uris": [
        "https://awesomeapp.example.com/oauth-redirect/"
      ], 
      "skip_authorization": false
    }
  ], 
  "stat": "ok", 
  "total_results": 1
}