Loader

SMS API authentication


Overview

This command will attempt to stop the delivery of a particular message. This command can only stop messages that have been scheduled for delivery in the future or may be queued within our router. It cannot stop messages that have already been delivered to an SMSC.


Command
https://api.clickatell.com/http/delmsg?user=xxxx&password=xxxx&api_id=xxxx&apimsgid=xxxx

Parameters

You also need to supply your authentication parameters.

Parameter

Description

apimsgid

This is the API message ID you get back when you send a message.

climsgid

This is the message ID that you specified when you generated a message.

 
Examples

Bash

1
2
3
4
5
6
7

username="place username here"
password="place password here"
api_id="place password here"
apiMsgId="place message ID here"
 
curl --data "user=$username&password=$password&api_id=$api_id&apimsgid=$apiMsgId" \
'https://api.clickatell.com/http/delmsg'


PHP

1
2
3
4
5
6
7
8
9
10

<?php
$username = urlencode("place username here");
$password = urlencode("place password here");
$api_id   = urlencode("place api_id here");
 
$apiMsgId "place message ID here";
 
echo file_get_contents("https://api.clickatell.com/http/delmsg"
"?user=$username&password=$password&api_id=$api_id&apimsgid=$apiMsgId");
?>


Python

1
2
3
4
5
6
7
8
9
10
11
12

import urllib2, urllib
 
params = {
"user""place username here",
"password""place password here",
"api_id""place password here",
"apimsgid""place message ID here"
}
 
params = urllib.urlencode(params)
= urllib2.urlopen("https://api.clickatell.com/http/delmsg", params)
print f.read()>


API responses

Example response

Successful API response:

ID: f6b9af2a2c9e5b18ee2d257e3def5d66 Status: 006


Error response:

ERR: 001, Authentication failed

Format

Successful API response:

ID: <message ID> Status: <status ID>


Error response:

ERR: <error code>, <error description>
 
SMS API

How to Authenticate an SMS API

You can authenticate an API request by sending your username, password and API ID as GET parameters by opening a URL in your browser as shown below;


API Authentication Command
https://api.clickatell.com/http/auth?user=xxxx&password=xxxx&api_id=xxxx

If you would like to avoid sending your username and password with every API request, you can use a session ID. This command can be used to generate the session ID. The session ID will expire after 15 minutes of inactivity and you will have to call this API verification command again to create a new session ID. Alternatively, you can use the Ping command about every 10 minutes to ensure that the session ID is kept alive.

Note: any API command using a session ID will cause your session ID to remain active for another 15 minutes.


API Authentication Parameters

Parameter

Description

user

Your API username

password

Your API password

api_id

Your API ID


SMS SPI Authentication Examples

Bash

1
2
3
4
5
6

username="place username here"
password="place password here"
api_id="place password here"
 
curl --data "user=$username&password=$password&api_id=$api_id" \
    'https://api.clickatell.com/http/auth'


PHP

1
2
3
4
5
6
7
8

<?php
$username = urlencode("place username here");
$password = urlencode("place password here");
$api_id   = urlencode("place password here");
 
echo file_get_contents("https://api.clickatell.com/http/auth?"
    "user=$username&password=$password&api_id=$api_id");
?>


Python

1
2
3
4
5
6
7
8
9
10
11

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


API Verification 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>

 

Did you find this information informative?

Other Resources

Ask the Community

Visit Stack Overflow to join our community of developers and find the answer you need

Contact Support

Contact our support team and one of our agents will be in touch with you to answer any questions you have