SI Lookup using XML/JSON Data
API for performing a lookup for specific number(s), along with callback URL, will be in the following format:
curl -X POST \
'<BASE_URL>&method=lookup.json&to=92xxxxxxxx&json=%3A%2F%2Fdomain.net%2F.......' \
curl -X POST \
'<BASE_URL>&method=lookup.xml&to=92xxxxxxxx&xml=%3A%2F%2Fdomain.net%2F.......' \
API Parameter Specifications
The API parameter specifications are described in the following sections:
Mandatory Parameters
The mandatory parameters in the HTTP API are tabulated below:
| Parameter | Description | Expected Values |
|---|---|---|
| SMS_Service_URL | URL of your SMS Service | URL |
| method | Predefined method | lookup |
| xml/json | You can provide either URL encoded XML/JSON data or URL of the XML/JSON file | Valid XML/JSON document or link of XML/JSON document |
Optional Parameter
The Optional parameter in HTTP API is tabulated below:
| Parameter | Description | Expected Values |
|---|---|---|
| format | Output format should be as specified by this variable | XML/PHP/JSON/JSONP. Default response will be in JSON |
Sample JSON Data
{
"lookup":[
{
"to": "95XXXXXXXX",
},
{
"to": "99XXXXXXXX",
}],
"dlrurl": "http://www.example.com/dlr.php/......"
}
Sample XML Data
<?xml version="1.0" encoding="UTF-8"?>
<xmlapi>
<dlrurl>
<![CDATA[http://domain.com/dlr.php]]>
</dlrurl>
<lookup>
<to>99xxxxxxxxx</to>
</lookup>
<lookup>
<to>98xxxxxxxxx</to>
</lookup>
</xmlapi>
Custom XML/JSON Tags
| Field Name | Description |
|---|---|
| {orig_country} | Original Country Name |
| {orig_circle} | From which circle, number does belong originally |
| {orig_cprefix} | Original Country Prefix |
| {orig_nprefix} | Original Network Prefix |
| {orig_code} | Original geographical circle code |
| {is_roaming} | Whether number is in roaming or not |
| {roaming_network} | Roaming Network Name |
| {roaming_country} | Roaming Country Name |
| {roaming_circle} | In which circle current number is under roaming |
| {orig_network} | Original Network Name |
| {roaming_cprefix} | Roaming Country Prefix |
| {roaming_nprefix} | Roaming Network Prefix |
| {roaming_code} | Geographical roaming circle code |
| {is_ported} | Whether number has been ported or not |
| {ported_network} | Ported Network Name |
| {ported_country} | Ported Country Name |
| {ported_nprefix} | Ported Network Prefix |
| {ported_code} | Geographical ported circle code |
| {mcc} | Mobile country code used in the combination of mobile network code to uniquely identify an operator |
| {mnc} | Mobile country code used in the combination of mobile network code to uniquely identify an operator |
| {imsi} | 15-digit IMSI number of the mobile subscriber's phone number (MSISDN) |
| {ported_circle} | To which circle this number has been ported |
| {ported_cprefix} | Ported Country Prefix |
| {status} | It indicates the success or failure of your request. |
| {smsc} | SMS Centre number |
| {err_code} | If there is any error or not |
Example Responses
- JSON
{
"status": "OK",
"data": [
{
"id": "336-1",
"customid": "",
"customid1": "",
"customid2": "",
"mobile": "97XXXXXXXX",
"status": "AWAITED-DLR"
}],
"message": "Campaign of 1 numbers Submitted successfully."
}
- XML
<api>
<status>OK</status>
<data>
<lookup>
<id>337-1</id>
<customid></customid>
<customid1></customid1>
<customid2></customid2>
<mobile>97XXXXXXXX</mobile>
<status>AWAITED-DLR</status>
</lookup>
</data>
<message>Campaign of 1 numbers Submitted successfully.</message>
</api>
Error Response
<api>
<status>A415</status>
<message>Invalid json</message>
</api>
Response Data:
| Field Name | Description |
|---|---|
| status | It indicates the success or failure of your request. |
| message | It indicates the success or failure message. |
| data | All the responses is wrapped inside data |
| Mobile | Mobile number |
| id | External message ID |
Sample DLRURL
http://domain.net/dlr/trigger.php?orig_network={orig_network}&orig_country={orig_country}&orig_circle={orig_circle}&
orig_cprefix={orig_cprefix}&orig_nprefix={orig_nprefix}&orig_code={orig_code}&is_roaming={is_roaming}&roaming_network={roaming_network}&roaming_country={roaming_country}&roaming_circle={roaming_circle}&roaming_cprefix={roaming_cprefix}&roaming_nprefix={roaming_nprefix}&roaming_code={roaming_code}&is_ported={is_ported}&ported_network={ ported_network}&ported_country={ported_country}&ported_circle={ported_circle}&ported_cprefix={ported_cprefix}&ported_nprefix={ported_nprefix}&ported_code={ported_code}&mcc={mcc}&mnc={mnc}&imsi={imsi}&status={status}&smsc={smsc}&err_code={err_code}