Jump to >

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
  • GET - Retrieves the list of accounts on the server.
  • POST - Creates a hosting service account.
Parent Resource Root List Resource
Child Resources
Anonymous Access Yes, if anonymous site access is enabled

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

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

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
213 - Server Configuration ErrorHTTP 500 - Internal Server Error There was an error storing configuration on the server.
214 - Bad Host KeyHTTP 403 - Forbidden The SSH key on the host does ot match the stored key.
215 - Unverified Host KeyHTTP 403 - Forbidden The SSH key on the host is unverified.
216 - Unverified Host CertificateHTTP 403 - Forbidden The HTTPS certificate on the host is unverified.
218 - Repository Authentication ErrorHTTP 403 - Forbidden Unable to authenticate with the repository using the provided credentials.

Examples

application/vnd.reviewboard.org.hosting-service-accounts+json

$ curl http://reviews.example.com/api/hosting-service-accounts/ -H "Accept: application/json"
Vary: Accept, Cookie
Item-Content-Type: application/vnd.reviewboard.org.hosting-service-account+json
Content-Type: application/vnd.reviewboard.org.hosting-service-accounts+json
X-Content-Type-Options: nosniff
{
  "hosting_service_accounts": [
    {
      "id": 1, 
      "links": {
        "remote_repositories": {
          "href": "http://reviews.example.com/api/hosting-service-accounts/1/remote-repositories/", 
          "method": "GET"
        }, 
        "self": {
          "href": "http://reviews.example.com/api/hosting-service-accounts/1/", 
          "method": "GET"
        }
      }, 
      "service": "github", 
      "username": "testuser"
    }
  ], 
  "links": {
    "create": {
      "href": "http://reviews.example.com/api/hosting-service-accounts/", 
      "method": "POST"
    }, 
    "self": {
      "href": "http://reviews.example.com/api/hosting-service-accounts/", 
      "method": "GET"
    }
  }, 
  "stat": "ok", 
  "total_results": 1
}