SOAP API Get coverage Command

This command allows you to check our coverage of a network or mobile number, without sending a message to that handset. This command should NOT be used before sending each message.

The returned credit charge value indicates the lowest possible credit charge at that point in time (for a single plain-text message). Credit charges may fluctuate (based on availability of delivery routes and features) and there is no guarantee that all your messages will be charged this value.

 

Command

routecoverage

Parameters

You also need to supply the authentication parameters.

Parameter

Description

msisdn

This is the mobile number you would like to query. It must be in international format (no leading zeros or + symbols).

 

Examples

Request data sample

<?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:routecoverage>
		<api_id>123456</api_id>
		<user>MyUsername</user>
		<password>MyPassword</password>
		<msisdn>27999123456</msisdn>
		</ns1:routecoverage>
	</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
	)
);

// Query message
$aResult = $oClient->delmsg(
	array(
		'api_id' => '123456',
		'user' => 'MyUsername',
		'password' => 'MyPassword',
		'apimsgid' => '57809dfd9296c9df57c84c16d69ceeef'
	)
);

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:delmsgResponse>
		<return>ID: 57809dfd9296c9df57c84c16d69ceeef Status: 006</return>
		</ns1:delmsgResponse>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Error 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:delmsgResponse>
		<return>ERR: 001, Authentication failed</return>
		</ns1:delmsgResponse>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

Return format

Successful API response:

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

Error response:

ERR: <error code>, <error description>

 

Samples:

PHP:

<?php

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

// Query coverage
$aResult = $oClient->routecoverage(
	array(
		'api_id' => '123456',
		'user' => 'MyUsername',
		'password' => 'MyPassword',
		'msisdn' => '27999123456'
	)
);

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:routecoverageResponse>
		<return>OK: This prefix is currently supported. Messages sent to this prefix will be routed. Charge: 0.33</return>
		</ns1:routecoverageResponse>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

OR:

<?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:routecoverageResponse>
		<return>ERR: This prefix is not currently supported. Messages sent to this prefix will fail. Please contact support for assistance.</return>
		</ns1:routecoverageResponse>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

OR:

 

Return format - Successful API response:

OK: This prefix is currently supported. Messages sent to this prefix will be routed. Charge: <cost of message>

OR:

ERR: This prefix is not currently supported. Messages sent to this prefix will fail. Please contact support for assistance.

 

Return format - Error response:

ERR: <error code>, <error description>