OAuth2 Tokens List Resource¶
Added in 3.0
An API resource for managing OAuth2 tokens.
This resource allows callers to list, update, or delete their existing tokens.
Details¶
Name | oauth_tokens |
URI | /api/oauth-tokens/ |
Required Features |
|
Token Policy ID | oauth_token |
HTTP Methods |
|
Parent Resource | |
Child Resources |
Links¶
Name |
Method |
Resource |
---|---|---|
self | GET |
HTTP GET¶
Retrieve a list of information about an OAuth2 token.
If accessing this API on a Local Site, the results will be limited to those associated with that site. Otherwise, it will be limited to those associated with no Local Site.
This can only be accessed by the owner of the tokens or superusers.
Request Parameters¶
counts-onlyBoolean | If specified, a single |
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. |
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-tokens+json¶
$ curl https://reviews.example.com/api/oauth-tokens/ -H "Accept: application/json"
HTTP 200 OK
Content-Length: 583
Content-Type: application/vnd.reviewboard.org.oauth-tokens+json
ETag: 75b11bf3acce1289adbb92d982c7c474466f3fa2
Item-Content-Type: application/vnd.reviewboard.org.oauth-token+json
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
{
"links": {
"self": {
"href": "https://reviews.example.com/api/oauth-tokens/",
"method": "GET"
}
},
"oauth_tokens": [
{
"application": "Awesome App",
"expires": "2060-06-01T12:13:14.123000+00:00",
"links": {
"delete": {
"href": "https://reviews.example.com/api/oauth-tokens/1/",
"method": "DELETE"
},
"self": {
"href": "https://reviews.example.com/api/oauth-tokens/1/",
"method": "GET"
},
"update": {
"href": "https://reviews.example.com/api/oauth-tokens/1/",
"method": "PUT"
}
},
"scope": [
"root:read",
"review_request:read",
"review:read"
],
"token": "abc123"
}
],
"stat": "ok",
"total_results": 1
}