Skip to Content
Browse documentation

test_connection — WAP API

Test authenticated WAP API operation access with exact request headers, response fields, demo-mode behavior and Python/PHP examples.

POST/api/v1/test_connection/Also accepts GET

Use test_connection after the API-root login check. This operation returns a fixed success response when the request is authenticated and demo restrictions allow it. It does not create or modify a hosting account.

Request

PropertyValue
MethodsGET, POST
Versioned path/api/v1/test_connection/
Default path/api/test_connection/
AuthenticationWAP root administrator API credentials.
Query/body fieldsNone required.
HeaderRequired value
X-API-USERYour WAP API username.
X-API-PASSWORDIts API password.

Each example is standalone. Replace server.example.com, billing_api and YOUR_API_PASSWORD with your own hostname and API credentials. Use Python 3 with Requests, or PHP 8 with the cURL extension, as appropriate.

Success response

HTTP 200:

{
  "data": {
    "test": "Connection Success"
  },
  "info": "API Connection Success",
  "status": 200
}
FieldTypeMeaning
data.teststringFixed success text: Connection Success.
infostringFixed description: API Connection Success.
statusinteger200 for this successful operation.

Success confirms this request reached the authenticated operation. It does not test account creation, backups, databases or every other API operation.

Errors and demo mode

ConditionActual HTTP statusResponse
Missing API credentials, without another authenticated identity403detail: Authentication credentials were not provided.
Invalid credentials or a rejected source IP403detail: Invalid API credentials
Authenticated request in demo mode400error: Demo server; info: Api Operations not available in demo server; body status: 403.
Handler exception400error: exception text; info: API Connection Failed; body status: 500.
Unsupported method405 after authenticationMethod-not-allowed response.

HTTP status and JSON status are separate

Demo mode returns HTTP 400 with body status 403. Do not interpret the body's number as the transport status. The API-root login view is not wrapped by this demo restriction, so a successful login check can still be followed by a rejected test_connection call.

For connection, TLS or access failures, review Connect and Test API Login.