API Ping

Archived

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).

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

https://api.clickatell.com/http/ping?session_id=xxxxxxxxxxxx_

Parameters

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

Parameter
Description

session_id

Your session ID

Examples

Bash

session_id="place session ID here"
 
curl --data "session_id=$session_id" \
    'https://api.clickatell.com/http/ping'

PHP

<?php
$session_id = urlencode("place username here");
 
echo file_get_contents("https://api.clickatell.com/http/ping"
    + "?session_id=$session_id");
?>

Python

import urllib2, urllib
 
params = {
    "session_id": "place username here"
}
 
params = urllib.urlencode(params)
f = urllib2.urlopen("https://api.clickatell.com/http/ping", params)
print f.read()

API responses

Example response

Successful API response:

OK: f6b9af2a2c9e5b18ee2d257e3def5d66

Error response:

ERR: 001, Authentication failed

Format

Successful API response:

OK: <session ID>

Error response:

ERR: <error code>, <error description>