SOAP API Ping

Calling the ping command will keep your session ID active for another 15 minutes (unless it has already expired).

This command is only useful if you are using the Authentication command to get a session ID for authenticating your API requests. Session IDs expire after 15 minutes of inactivity (if no API request is made with the session ID for 15 minutes).

Note that any API command using a session ID will cause your session ID to remain active for another 15 minutes. You can call this API command once every 10 minutes or so to keep your session active. Should your session expire, your application needs to make a new authentication request to get a new session ID.

 

Command

ping

 

Parameters

For this call you do not send through the usual authentication parameters. You will only send through the session ID:

Paramter

Description

session_id

Your session ID

 

Examples

All examples below are for the document/literal based server.

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://api.clickatell.com/soap/document_literal/webservice">
	<SOAP-ENV:Body>
		<ns1:ping>
			<session_id>f95d64c67d1d10d17443d636e4101711</session_id>
		</ns1:ping>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

Code samples:

PHP:

>
<?php
$oClient = new SoapClient(
	'http://api.clickatell.com/soap/document_literal/webservice?wsdl',
	array(
		'trace' => true,
		'keep_alive' => true
	)
);

// Keep session active if it has not expired already
$aResult = $oClient->ping(
	array(
		'session_id' => 'f95d64c67d1d10d17443d636e4101711',
	)
);

echo '<pre>' . print_r($aResult,true) . '</pre>';
?>  

 

API responses

Example response

Successful API response:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://api.clickatell.com/soap/document_literal/webservice">
	<SOAP-ENV:Body>
		<ns1:pingResponse>
			<return>OK:</return>
		</ns1:pingResponse>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>  

Error response:



	
		
			ERR: 001, Authentication failed
		
	
  

 

Return format:

>Successful API response:

OK:

Error response:

ERR: <error code>, <error description>