Verify API connection
Ping (Endpoint)
Sends an empty request to the API to check if there is a working connection.
Supported API
- Payments API
- Payment Links API
Usage:
-
Create a Client for the selected API.
-
Call the
ping_the_api()
method.-
api.ping.ping_the_api();
-
Returns
Response message pong
.
Example Usage
#1. Import api
from ping.payments_api import PaymentsApi
#2. Create Client
payments_api = PaymentsApi(
tenant_id = '55555555-5555-5555-5555-555555555555', #tenant_id given py ping
environment = 'sandbox' #"sandox" for testing, "production" for production usage.
)
#3. Make call to API
var response = payments_api.ping.ping_the_api();
#4. Handel response
if response.is_success():
print("Ping...");
print(response.body)
#Valid connection to the API
elif response.is_error():
print("Invalid connection to the API");
Response
200 OK
pong
Updated over 1 year ago