test_connection — WAP API
Test authenticated WAP API operation access with exact request headers, response fields, demo-mode behavior and Python/PHP examples.
/api/v1/test_connection/Also accepts GETUse 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
| Property | Value |
|---|---|
| Methods | GET, POST |
| Versioned path | /api/v1/test_connection/ |
| Default path | /api/test_connection/ |
| Authentication | WAP root administrator API credentials. |
| Query/body fields | None required. |
| Header | Required value |
|---|---|
X-API-USER | Your WAP API username. |
X-API-PASSWORD | Its 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
}| Field | Type | Meaning |
|---|---|---|
data.test | string | Fixed success text: Connection Success. |
info | string | Fixed description: API Connection Success. |
status | integer | 200 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
| Condition | Actual HTTP status | Response |
|---|---|---|
| Missing API credentials, without another authenticated identity | 403 | detail: Authentication credentials were not provided. |
| Invalid credentials or a rejected source IP | 403 | detail: Invalid API credentials |
| Authenticated request in demo mode | 400 | error: Demo server; info: Api Operations not available in demo server; body status: 403. |
| Handler exception | 400 | error: exception text; info: API Connection Failed; body status: 500. |
| Unsupported method | 405 after authentication | Method-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.