Difference between revisions of "API:Ping"
Greg Donald (talk | contribs) |
Ashley DeBon (talk | contribs) |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| + | == [[API]] » API Ping == | ||
| − | + | The '''API Ping''' endpoint verifies that the CallProof API is reachable and that the provided API credentials are valid. It is recommended as the first API call when testing connectivity or troubleshooting authentication issues. | |
| − | + | === Base URL === | |
| + | <code>https://app.callproof.com</code> | ||
| − | + | === Endpoint === | |
| + | <code>/api/ping/</code> | ||
| − | + | === Purpose === | |
| + | Use this endpoint to confirm: | ||
| − | * | + | * The CallProof API is available. |
| − | * | + | * Your API Key and Secret are valid. |
| + | * Authentication is working correctly before calling other API endpoints. | ||
| − | + | === HTTP Method === | |
| + | <code>GET</code> | ||
| − | * | + | === Headers === |
| − | + | ||
| − | * ''''' | + | {| class="wikitable" |
| + | ! Header | ||
| + | ! Required | ||
| + | ! Description | ||
| + | |- | ||
| + | | None | ||
| + | | No | ||
| + | | This endpoint does not require HTTP headers. Authentication is provided using query parameters. | ||
| + | |} | ||
| + | |||
| + | === Security === | ||
| + | |||
| + | * Authentication is required. | ||
| + | * Pass the API credentials using the <code>key</code> and <code>secret</code> query parameters. | ||
| + | |||
| + | === Parameters === | ||
| + | |||
| + | ==== Query Parameters ==== | ||
| + | |||
| + | {| class="wikitable" | ||
| + | ! Parameter | ||
| + | ! Type | ||
| + | ! Required | ||
| + | ! Description | ||
| + | |- | ||
| + | | key | ||
| + | | string | ||
| + | | Yes | ||
| + | | Public API key assigned to your CallProof account. | ||
| + | |- | ||
| + | | secret | ||
| + | | string | ||
| + | | Yes | ||
| + | | Private API secret associated with the API key. | ||
| + | |} | ||
| + | |||
| + | ==== Path Parameters ==== | ||
| + | |||
| + | None. | ||
| + | |||
| + | ==== Request Body ==== | ||
| + | |||
| + | None. | ||
| + | |||
| + | === Example Request === | ||
| + | |||
| + | ==== cURL ==== | ||
| + | |||
| + | <pre> | ||
| + | curl -X GET "https://app.callproof.com/api/ping/?key=YOUR_API_KEY&secret=YOUR_API_SECRET" | ||
| + | </pre> | ||
| + | |||
| + | === Successful Response (200) === | ||
| + | |||
| + | Returns a successful response when the API is available and the supplied credentials are valid. | ||
| + | |||
| + | {| class="wikitable" | ||
| + | ! Field | ||
| + | ! Type | ||
| + | ! Description | ||
| + | |- | ||
| + | | result | ||
| + | | object | ||
| + | | Contains the result of the health check. | ||
| + | |- | ||
| + | | result.result | ||
| + | | integer | ||
| + | | A value of <code>1</code> indicates the API ping was successful. | ||
| + | |- | ||
| + | | errors | ||
| + | | array | ||
| + | | Empty when no errors occur. | ||
| + | |- | ||
| + | | code | ||
| + | | integer | ||
| + | | HTTP status code returned by the API. | ||
| + | |} | ||
| + | |||
| + | ==== Example Response ==== | ||
| + | |||
| + | <pre> | ||
| + | { | ||
| + | "result": { | ||
| + | "result": 1 | ||
| + | }, | ||
| + | "errors": [], | ||
| + | "code": 200 | ||
| + | } | ||
| + | </pre> | ||
| + | |||
| + | === Error Responses === | ||
| + | |||
| + | {| class="wikitable" | ||
| + | ! HTTP Status | ||
| + | ! Description | ||
| + | |- | ||
| + | | 401 | ||
| + | | Unauthorized. The API Key or Secret is missing, invalid, inactive, or belongs to a disabled account. | ||
| + | |- | ||
| + | | 405 | ||
| + | | Method Not Allowed. Only the <code>GET</code> method is supported. | ||
| + | |- | ||
| + | | 500 | ||
| + | | Internal Server Error. An unexpected server error occurred. | ||
| + | |} | ||
| + | |||
| + | ==== 401 Unauthorized ==== | ||
| + | |||
| + | <pre> | ||
| + | { | ||
| + | "results": [], | ||
| + | "errors": [ | ||
| + | "Invalid API Key" | ||
| + | ], | ||
| + | "code": 401 | ||
| + | } | ||
| + | </pre> | ||
| + | |||
| + | ==== 405 Method Not Allowed ==== | ||
| + | |||
| + | <pre> | ||
| + | { | ||
| + | "results": [], | ||
| + | "errors": [ | ||
| + | "Method not allowed" | ||
| + | ], | ||
| + | "code": 405 | ||
| + | } | ||
| + | </pre> | ||
| + | |||
| + | === Notes === | ||
| + | |||
| + | * Authentication credentials must be supplied as the <code>key</code> and <code>secret</code> query parameters. | ||
| + | * This endpoint does '''not''' support Bearer Token authentication. | ||
| + | * Use this endpoint to verify connectivity and authentication before calling other CallProof API endpoints. | ||
| + | * No request body or custom HTTP headers are required. | ||
Latest revision as of 07:27, 17 July 2026
Contents
API » API Ping
The API Ping endpoint verifies that the CallProof API is reachable and that the provided API credentials are valid. It is recommended as the first API call when testing connectivity or troubleshooting authentication issues.
Base URL
Endpoint
/api/ping/
Purpose
Use this endpoint to confirm:
- The CallProof API is available.
- Your API Key and Secret are valid.
- Authentication is working correctly before calling other API endpoints.
HTTP Method
GET
Headers
| Header | Required | Description |
|---|---|---|
| None | No | This endpoint does not require HTTP headers. Authentication is provided using query parameters. |
Security
- Authentication is required.
- Pass the API credentials using the
keyandsecretquery parameters.
Parameters
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| key | string | Yes | Public API key assigned to your CallProof account. |
| secret | string | Yes | Private API secret associated with the API key. |
Path Parameters
None.
Request Body
None.
Example Request
cURL
curl -X GET "https://app.callproof.com/api/ping/?key=YOUR_API_KEY&secret=YOUR_API_SECRET"
Successful Response (200)
Returns a successful response when the API is available and the supplied credentials are valid.
| Field | Type | Description |
|---|---|---|
| result | object | Contains the result of the health check. |
| result.result | integer | A value of 1 indicates the API ping was successful.
|
| errors | array | Empty when no errors occur. |
| code | integer | HTTP status code returned by the API. |
Example Response
{
"result": {
"result": 1
},
"errors": [],
"code": 200
}
Error Responses
| HTTP Status | Description |
|---|---|
| 401 | Unauthorized. The API Key or Secret is missing, invalid, inactive, or belongs to a disabled account. |
| 405 | Method Not Allowed. Only the GET method is supported.
|
| 500 | Internal Server Error. An unexpected server error occurred. |
401 Unauthorized
{
"results": [],
"errors": [
"Invalid API Key"
],
"code": 401
}
405 Method Not Allowed
{
"results": [],
"errors": [
"Method not allowed"
],
"code": 405
}
Notes
- Authentication credentials must be supplied as the
keyandsecretquery parameters. - This endpoint does not support Bearer Token authentication.
- Use this endpoint to verify connectivity and authentication before calling other CallProof API endpoints.
- No request body or custom HTTP headers are required.