Loader

Get coverage command


Overview

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 the availability of delivery routes and features, and there is no guarantee that all your messages will be charged this value.

GET https://api.clickatell.com/rest/coverage/[msisdn]


Note:
 the REST API may respond with various HTTP status codes. See the full list here.


JSON

Request
GET /rest/coverage/27999123456 HTTP/1.1
HOST: api.clickatell.com
X-Version: 1
Authorization: Bearer [Your Authorization Token]
Accept: application/json

Response
HTTP/1.1 200 OK
Content-Type: application/json
 
{
   "data": {
       "routable" true,
       "destination" "27999123456",
        "minimumCharge" 0.8
    }
}

XML

Request

1
2
3
4
5

GET /rest/coverage/27999123456 HTTP/1.1
HOST: api.clickatell.com
X-Version: 1
Authorization: Bearer [Your Authorization Token]
Accept: application/xml


Response

1
2
3
4
5
6
7
8
9
10
11

HTTP/1.1 200 OK
Content-Type: application/xml
 
<?xml version="1.0"?>
<response>
    <data>
        <routable>1</routable>
        <destination>27999123456</destination>
        <minimumCharge>0.8</minimumCharge>
    </data>
</response>


Sample code

cURL
number=""
 
authToken=""
 
curl -X GET \
-H "X-Version: 1" \
-H "Accept: application/json" \
-H "Authorization: Bearer $authToken" \
 
https://api.clickatell.com/rest/coverage/$number

Python

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

import httplib2, json
 
to = ""
 
authToken = ""
 
resp, content = httplib2.Http().request(
    "https://api.clickatell.com/rest/coverage/" + to,
    "GET",
    headers={
        "X-Version" "1",
        "Accept" "application/json",
        "Authorization" "Bearer " + authToken
    }
)


PHP

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

<?php
 
$mobileNumber "<mobile number>";
 
$authToken "<place auth token here>";
  
$ch = curl_init();
  
curl_setopt($ch, CURLOPT_URL,            "https://api.clickatell.com/rest/coverage/$mobileNumber");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER,     array(
    "X-Version: 1",
    "Accept: application/json",
    "Authorization: Bearer $authToken"
));
  
$result = curl_exec ($ch);
 
?>

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