Skip to main content

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

task_id
string
required
ID of the task generated when creating the ping. This is returned in the data.task_id field from the create ping endpoint.

Response

ok
boolean
required
Indicates whether the request was successful
type
string
required
Response type. Values: success, error, info
action
string
required
Specific 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
data
object
Response data object (typically null for this endpoint as status is conveyed via the action field)
message
string
Optional message providing additional context
meta
object
Optional metadata object

Connection Status Types

The endpoint analyzes packet loss to determine connection quality:

Example Request

curl -X GET https://api.wisphub.com/api/v1/ping/550e8400-e29b-41d4-a716-446655440000/

Example Responses

{
  "ok": true,
  "type": "success",
  "action": "stable_connection",
  "data": null,
  "message": null,
  "meta": null
}

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, or ping_failed)

Workflow Example

Status Codes

  • 200 - Request successful (check action field for connection status)
  • 401 - Unauthorized (invalid or missing token)
  • 404 - Task not found (invalid task_id)
  • 500 - Internal server error