GET /api/v1/ping//
Retrieves the resolved result of a previously initialized PING task. This endpoint interprets the packet loss level from results returned by WispHub (e.g., packets sent vs. received) to determine if the connection is Stable, Intermittent, or if there is no internet service at the client’s end.This endpoint should be called after creating a ping task using the Create Ping Task endpoint. Poll this endpoint until you receive a final status.
Path Parameters
ID of the task generated when creating the ping. This is returned in the
data.task_id field from the create ping endpoint.Response
Indicates whether the request was successful
Response type. Values:
success, error, infoSpecific action identifier indicating the connection status:
stable_connection- Connection is stable (low packet loss)intermittent_connection- Connection is unstable (partial packet loss)no_internet- No internet service detected (complete packet loss)ping_failed- Task failed or error occurred
Response data object (typically null for this endpoint as status is conveyed via the
action field)Optional message providing additional context
Optional metadata object
Connection Status Types
The endpoint analyzes packet loss to determine connection quality:Example Request
Example Responses
Polling Best Practices
Since ping tasks are processed asynchronously, implement a polling strategy with the following guidelines:
- Initial Delay: Wait 2-3 seconds after creating the task before the first poll
- Polling Interval: Poll every 2-5 seconds to balance responsiveness and server load
- Maximum Attempts: Set a reasonable limit (e.g., 20 attempts = ~60 seconds max wait)
- Exponential Backoff: Consider increasing the delay between polls over time
- Error Handling: Stop polling when receiving a final status (
stable_connection,intermittent_connection,no_internet, orping_failed)
Workflow Example
Status Codes
200- Request successful (checkactionfield for connection status)401- Unauthorized (invalid or missing token)404- Task not found (invalid task_id)500- Internal server error
