post https://pay2new.in/apis/offer/v1/hlr
The home location register (HLR) is a central database that contains details of each mobile phone subscriber connected to the global mobile network. You can use this API to validate that a mobile number is live and registered on a mobile network in real-time.
Header Request
Accept : application/json
Content-Type: application/json
secret : Unique secret key (Provided by Pay2New)
Request Parameters
Parameters | Type | Mandatory (M) , Optional(O) | Description |
---|---|---|---|
number | String | M | Mobile Number |
request_id | String | M | Your Unique Transaction/Request Id (max length 20) |
Sample Request
curl --request POST \
--url https://pay2new.in/apis/offer/v1/hlr \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'secret: qwertyuQWERTY12345asdf' \
--data '
{
"number": "9696969696",
"request_id": "P2N54544444545"
}
'
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pay2new.in/apis/offer/v1/hlr",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"number\":\"9696969696\",\"request_id\":\"P2N54544444545\"}",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json",
"secret: qwertyuQWERTY12345asdf"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Response Parameters
Name | Type | Description |
---|---|---|
status | Integer | Transaction Status |
message | String | Message from API |
data | Array | Response Data (If Present) |
product_code | String | Product Code |
operator_name | String | Operator Name |
circle_code | String | Circle Code |
circle_name | String | State Name |
Sample Response
{
"status": 1,
"message": "Transaction Successfull!",
"data": {
"product_code": "1",
"product_name": "AIRTEL",
"circle_code": "13",
"circle_name": "MAHARASHTRA"
}
}
{"status":2,"message":"Invalid Json!"}