Number Request Lookup
Hellio's HLR API provides a way to send Network Queries to any mobile number globally. It
allows you to
view what mobile number (MSISDN) belongs to what operator in real-time and see if the
number is active.
The HLR API uses HTTP verbs and a RESTful endpoint structure with an access key that is
used as the API
Authorization framework. Request and response payloads are formatted as JSON—although we
provide a GET
alternative for requests—using UTF-8 encoding and URL encoded values.
API URL V1:
https://api.helliomessaging.com/v1/hlr/request?
Request Method: MATCH (Either POST or GET)
Content-Type: application/json
Number Request Lookup (Java)
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
public class Main {
public static void main(String[] args) {
String username = "&username=" + "YOU-HELLIO-MESSAGING-USERNAME";
String password = "&password=" + "YOU-HELLIO-MESSAGING-PASSWORD";
String mobile_number = "&msisdn=" + "233242813656";
String reference = "&reference=" + "HellioSMS";
// Prepare Url
URLConnection myURLConnection = null;
URL myURL = null;
BufferedReader reader = null;
// Base Endpoint
String baseUrl = "https://api.helliomessaging.com/v1/hlr/request?";
// Prepare parameter string
StringBuilder sbPostData = new StringBuilder(baseUrl);
sbPostData.append("&username=" + username);
sbPostData.append("&password=" + password);
sbPostData.append("&msisdn=" + mobile_number);
sbPostData.append("&reference=" + reference);
// final string
baseUrl = sbPostData.toString();
try {
// prepare connection
myURL = new URL(baseUrl);
myURLConnection = myURL.openConnection();
myURLConnection.connect();
reader = new BufferedReader(new InputStreamReader(myURLConnection.getInputStream()));
// reading response
String response;
while ((response = reader.readLine()) != null)
// print response
System.out.println(response);
// finally close connection
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
HLR Response Object
[
{
"msgid": "f340400f-fb6d-4fb6-ac8b-ef58cd115f5b",
"msisdn": "233557560136",
"reference": "Hellio",
"status": "Active",
"ported": "NO",
"country": "Ghana",
"operator": "Scancom Ltd (MTN)",
"mccmnc": 62001,
"created_at": "2020-11-16 13:52:57"
}
]
HLR Request (PHP)
$baseUrl = 'https://api.helliomessaging.com/v1/hlr/request?';
$username = 'YOUR-HELLIO-MESSAGING-USERNAME';
$password = 'YOUR-HELLIO-MESSAGING-PASSWORD';
$senderId = 'YOUR-SENDERID'; // e.g HellioSMS (Max character for SenderId is 11 including space);
$mobile_number = 'MOBILE-NUMBER'; // e.g 233242813656;
$params = array(
'username' => $username,
'password' => $password,
'reference' => $senderId,
'msisdn' => $mobile_number
);
// Send through CURL
$ch = curl_init($baseUrl);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
//Process your response here
$result = curl_exec($ch);
echo var_export($result, true);
curl_close($ch);
HLR Response Object
[
{
"msgid": "f340400f-fb6d-4fb6-ac8b-ef58cd115f5b",
"msisdn": "233557560136",
"reference": "Hellio",
"status": "Active",
"ported": "NO",
"country": "Ghana",
"operator": "Scancom Ltd (MTN)",
"mccmnc": 62001,
"created_at": "2020-11-16 13:52:57"
}
]