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:

  1. Create a Client for the selected API.

    1. Payments API.
    2. Payment Links Api.
  2. Call the ping_the_api() method.

    1. api.ping.ping_the_api();
      
  3. Handle response

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