Number Lookup - POST
The POST method receives the mobile number and the given ISO code of the country where the mobile number is registered as body parameters to make this request. A developer may make use of the POST method when retrieving the details of a number under the following conditions:
  • The number details to be retrieved are not to be stored or cached
  • The number details to be retrieved are sensitive and need to be protected
  • Details for multiple mobile numbers are required
post
https://topups.reloadly.com
/mnp-lookup/operators
Number Lookup

Request samples

cURL
C#
Golang
Java
Node JS
PHP
Python
1
curl --location --request POST 'https://topups.reloadly.com/mnp-lookup/operators' \
2
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE' \
3
--header 'Accept: application/com.reloadly.topups-v1+json' \
4
--header 'Content-Type: application/json' \
5
--data-raw '{
6
"phone":"03238482221",
7
"countryCode":"PK"
8
}'
Copied!
1
using System;
2
using System.Threading.Tasks;
3
using System.Net.Http;
4
using System.Text;
5
using Newtonsoft.Json;
6
7
namespace WebAPIClient {
8
class Program {
9
10
static async Task Main(string[] args) {
11
await ApiCall();
12
}
13
14
private static async Task ApiCall() {
15
var json = JsonConvert.SerializeObject(new {
16
phone = "03238482221",
17
countryCode = "PK"
18
});
19
20
var message = new HttpRequestMessage(HttpMethod.Post, "https://topups.reloadly.com/mnp-lookup/operators");
21
22
message.Headers.TryAddWithoutValidation("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE");
23
message.Headers.TryAddWithoutValidation("Accept", "application/com.reloadly.topups-v1+json");
24
message.Headers.TryAddWithoutValidation("Content-Type", "application/json");
25
26
using
27
var httpClient = new HttpClient();
28
var response = await httpClient.SendAsync(message);
29
var responseBody = await response.Content.ReadAsStringAsync();
30
var result = JsonConvert.DeserializeObject < dynamic > (responseBody);
31
32
Console.WriteLine(result);
33
}
34
35
}
36
}
Copied!
1
package main
2
3
import (
4
"fmt"
5
"strings"
6
"net/http"
7
"io/ioutil"
8
)
9
10
func main() {
11
12
url := "https://topups.reloadly.com/mnp-lookup/operators"
13
method := "POST"
14
15
payload := strings.NewReader(`{
16
"phone":"03238482221",
17
"countryCode":"PK"
18
}`)
19
20
client := &http.Client {
21
}
22
req, err := http.NewRequest(method, url, payload)
23
24
if err != nil {
25
fmt.Println(err)
26
return
27
}
28
req.Header.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
29
req.Header.Add("Accept", "application/com.reloadly.topups-v1+json")
30
req.Header.Add("Content-Type", "application/json")
31
32
res, err := client.Do(req)
33
if err != nil {
34
fmt.Println(err)
35
return
36
}
37
defer res.Body.Close()
38
39
body, err := ioutil.ReadAll(res.Body)
40
if err != nil {
41
fmt.Println(err)
42
return
43
}
44
fmt.Println(string(body))
45
}
Copied!
1
OkHttpClient client = new OkHttpClient().newBuilder()
2
.build();
3
MediaType mediaType = MediaType.parse("application/json");
4
RequestBody body = RequestBody.create(mediaType, "{\n\t\"phone\":\"03238482221\",\n\t\"countryCode\":\"PK\"\n}");
5
Request request = new Request.Builder()
6
.url("https://topups.reloadly.com/mnp-lookup/operators")
7
.method("POST", body)
8
.addHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
9
.addHeader("Accept", "application/com.reloadly.topups-v1+json")
10
.addHeader("Content-Type", "application/json")
11
.build();
12
Response response = client.newCall(request).execute();
Copied!
1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://topups.reloadly.com/mnp-lookup/operators',
5
'headers': {
6
'Authorization': 'Bearer YOUR_ACCESS_TOKEN_HERE',
7
'Accept': 'application/com.reloadly.topups-v1+json',
8
'Content-Type': 'application/json'
9
},
10
body: JSON.stringify({
11
"phone": "03238482221",
12
"countryCode": "PK"
13
})
14
15
};
16
request(options, function (error, response) {
17
if (error) throw new Error(error);
18
console.log(response.body);
19
});
Copied!
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://topups.reloadly.com/mnp-lookup/operators',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_POSTFIELDS =>'{
15
"phone":"03238482221",
16
"countryCode":"PK"
17
}',
18
CURLOPT_HTTPHEADER => array(
19
'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE',
20
'Accept: application/com.reloadly.topups-v1+json',
21
'Content-Type: application/json'
22
),
23
));
24
25
$response = curl_exec($curl);
26
27
curl_close($curl);
28
echo $response;
Copied!
1
import requests
2
import json
3
4
url = "https://topups.reloadly.com/mnp-lookup/operators"
5
6
payload = json.dumps({
7
"phone": "03238482221",
8
"countryCode": "PK"
9
})
10
headers = {
11
'Authorization': 'Bearer YOUR_ACCESS_TOKEN_HERE',
12
'Accept': 'application/com.reloadly.topups-v1+json',
13
'Content-Type': 'application/json'
14
}
15
16
response = requests.request("POST", url, headers=headers, data=payload)
17
18
print(response.text)
Copied!

Response parameters

Parameter
Type
Description
id/operatorId
integer
This indicates the operator's ID
name
string
The operator's name
bundle
boolean
Indicates if the operator has any existing bundle plans
data
boolean
Indicates if the operator has any existing data plans
pin
boolean
Indicates if the operator supports PIN transactions
supportsLocalAmounts
boolean
Indicates if the operator can make top-ups in local amounts
denominationType
string
Indicates if the operator makes top-ups through a fixed amount or a range of amounts. Options include FIXED and RANGE
senderCurrencyCode
string
Indicates the currency code of the account where the top-up is being made from
senderCurrencySymbol
string
Indicates the currency symbol of the account where the top-up is being made from
destinationCurrencyCode
string
Indicates the currency code of the mobile number where the top-up is being sent to
destinationCurrencySymbol
string
Indicates the currency symbol of the mobile number where the top-up is being sent to
commission
integer
Indicates if the operator offers a commission or discount
internationalDiscount
integer
Indicates if the operator offers a discount for top-ups made to foreign numbers
localDiscount
integer
Indicates if the operator offers a discount for top-ups made to local numbers
mostPopularAmount
integer
Indicates the amount that is often used to make a top-up
mostPopularLocalAmount
integer
Indicates the amount that is often used to make a top-up locally
minAmount
integer
Indicates the minimum amount that can be used to make a top-up
maxAmount
integer
Indicates the maximum amount that can be used to make a top-up
localMinAmount
integer
Indicates the minimum amount that can be used to make a top-up locally