VEXXHOSTDocumentation

Make API requests

Authenticate, find endpoints, read errors and retry when you call the APIs directly over HTTPS.

Every service has an HTTP API. The openstack CLI and the OpenStack SDK call these APIs for you. This page is for calling them directly.

Authenticate and find the endpoint

Every request needs a token from Identity in the X-Auth-Token header. See Get a token. Find the service's endpoint for your region in the service catalog. Each service's API reference lists its paths, which start with a version, such as /v3/ or /v1/.

This request asks Identity which projects you can access:

curl https://auth.vexxhost.net/v3/auth/projects \
  --header "X-Auth-Token: $TOKEN"

Send and receive JSON

Request and response bodies are JSON. Send Content-Type: application/json with a body. Some services let you choose a newer version of their API for each request with the OpenStack-API-Version header. Their API reference says when.

Read errors

The status code shows what went wrong and whether to retry. The body adds detail in a format that varies by service. Each API reference describes its own.

StatusMeaningRetry
400 Bad RequestThe request cannot be done as written.No. Fix the request.
401 UnauthorizedThe token is missing or has expired.After getting a new token.
403 ForbiddenThe token's project or roles do not allow this, or a quota is reached.No.
404 Not FoundThe resource does not exist, or your project cannot see it.No.
409 ConflictThe resource is in a state that does not allow this, or it changed since you read it.After reading it again.
413 Content Too LargeThe request body is too large.No.
422 Unprocessable EntityThe body does not match what the operation expects.No. Fix the request.
429 Too Many RequestsThe service is busy, or you sent too many requests.Yes, after Retry-After seconds.
503 Service UnavailableThe service cannot answer right now.Yes, with backoff.
504 Gateway TimeoutThe request took too long.Yes, with backoff.

Retry safely

Wait as long as Retry-After says when a response includes it. Otherwise retry 503 and 504 with exponential backoff, starting at about one second. Other 4xx responses fail the same way every time, so fix the request instead of retrying it.

Request IDs

Responses carry a request ID header, such as X-Openstack-Request-Id. Include it when you contact support about a request, so support can find the request quickly. Each API reference names the header its service uses.

On this page