Hosting Service Account List Resource¶
Added in 2.5
Provides information and allows linking of hosting service accounts.
The list of accounts tied to hosting services can be retrieved, and new accounts can be linked through an HTTP POST.
Details¶
Name | hosting_service_accounts |
URI | /api/hosting-service-accounts/ |
Token Policy ID | hosting_service_account |
HTTP Methods | |
Parent Resource | |
Child Resources |
Links¶
Name |
Method |
Resource |
---|---|---|
create | POST |
|
self | GET |
HTTP GET¶
Retrieves the list of accounts on the server.
This will only list visible accounts. Any account that the administrator has hidden will be excluded from the list.
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. |
serviceString | Filter accounts by the hosting service ID. Added in 2.5 |
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 | Filter accounts by username. Added in 2.5 |
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¶
Creates a hosting service account.
The service_id
is a registered HostingService ID. This must be
known beforehand, and can be looked up in the Review Board
administration UI.
Request Parameters¶
service_idString | Required The registered ID of the service for the account. |
usernameString | Required The username on the account. |
hosting_urlString | The hosting URL on the account, if the hosting service is self-hosted. Added in 1.7.8 |
passwordString | The password on the account, if the hosting service needs it. |
Errors¶
Examples¶
application/vnd.reviewboard.org.hosting-service-accounts+json¶
$ curl https://reviews.example.com/api/hosting-service-accounts/ -H "Accept: application/json"
HTTP 200 OK
Content-Length: 568
Content-Type: application/vnd.reviewboard.org.hosting-service-accounts+json
ETag: 99e4e0b1a8ee80ad2e295fcef8f1d739953c20a5
Item-Content-Type: application/vnd.reviewboard.org.hosting-service-account+json
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
{
"hosting_service_accounts": [
{
"id": 1,
"links": {
"remote_repositories": {
"href": "https://reviews.example.com/api/hosting-service-accounts/1/remote-repositories/",
"method": "GET"
},
"self": {
"href": "https://reviews.example.com/api/hosting-service-accounts/1/",
"method": "GET"
}
},
"service": "github",
"username": "testuser"
}
],
"links": {
"create": {
"href": "https://reviews.example.com/api/hosting-service-accounts/",
"method": "POST"
},
"self": {
"href": "https://reviews.example.com/api/hosting-service-accounts/",
"method": "GET"
}
},
"stat": "ok",
"total_results": 1
}