The following HTTP API endpoints can be used to monitor and work with Gateway Availability groups. Within the sample HTTP responses in API descriptions, some header portions have been omitted in the interests of brevity.
Any input requests to HTTP API endpoints must be formatted as JSON code and placed in the
body of the request. The request header Content-Type
must also be
present and set to the value application/json
. If this request header
is not present or has a different value, the body of that request and your data will be
ignored.
Permissions and authentication
These endpoints use standard Gateway authentication to check
whether the caller is allowed to use the API. In order to use Availability group
endpoints, the user calling them must also have the the
availability_group
workflow permission.
If the request does not carry the required authentication, Gateway returns error 401:
HTTP/1.1 401 UNAUTHORIZED
Content-Type: application/json
{
"code": "Unauthorized",
"details": {
"log_context": "<user name used to authenticate>"
},
"message": "Authentication is required.",
"status": 401
}
If the request is from an authenticated user, but the user is not authorized to use the endpoint, Gateway returns error 403:
HTTP/1.1 403 FORBIDDEN
Content-Type: application/json
{
"code": "Forbidden",
"details": {
"log_context": "<user name used to authenticate>:session ID hash"
},
"message": "Insufficient access rights.",
"status": 403
}
<session ID hash>
is a hash of the
session ID to help you identify messages that might appear elsewhere in Gateway logs.Error codes
When an error is determined, the HTTP API response with an error code and message, formatted in JSON. Error responses use standard HTTP status codes to indicate the general nature of the problem, such as whether it originates from the client or the server. You can find a list of standard HTTP response status codes in various places on the internet, such as the Mozilla website.
If the cause of the problem cannot be determined, code 500 is used.