When using Reloadly’s Airtime API, it makes sense to have an overview of every operator within your country – their details, discounts that apply to them and amounts that are recharged – both local and international.
This guide aims to show how you can achieve this by making a request to view the operator information. The steps that will be followed in this article are:
- Getting your access token
- Getting details of all the operators within your country
You can get your access token by following the steps in this quickstart.
Getting details of all the operators within your country
Assuming your country is Argentina and you want to view all the operators you can purchase top-ups from within Argentina, you can use Argentina’s two-letter ISO code to make a request to an endpoint that retrieves every operator within Argentina.
The cURL code sample below shows how this can be done:
curl -i -X GET \
'https://topups-sandbox.reloadly.com/operators/countries/AR' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
In the above example, a GET request has been made using Argentina’s ISO code. If the request is successful, you should have a response similar to this:
In the above example, a GET request has been made using Argentina’s ISO code. If the request is successful, you should have a response similar to this:
[
{
"id":736,
"operatorId":736,
"name":"Claro Argentina Bundles",
"country":{
"isoName":"AR",
"name":"Argentina"
},
"fx":{
"rate":0.2184,
"currencyCode":"ARS"
}
},
{
"id":16,
"operatorId":16,
"name":"Movistar Argentina",
"country":{
"isoName":"AR",
"name":"Argentina"
},
"fx":{
"rate":0.24,
"currencyCode":"ARS"
}
},
{
"id":737,
"operatorId":737,
"name":"Movistar Argentina Bundles",
"country":{
"isoName":"AR",
"name":"Argentina"
},
"fx":{
"rate":0.2136,
"currencyCode":"ARS"
}
},
{
"id":17,
"operatorId":17,
"name":"Personal Argentina",
"country":{
"isoName":"AR",
"name":"Argentina"
},
"fx":{
"rate":0.168,
"currencyCode":"ARS"
}
},
{
"id":739,
"operatorId":739,
"name":"Personal Argentina Bundles",
"country":{
"isoName":"AR",
"name":"Argentina"
},
"fx":{
"rate":0.2136,
"currencyCode":"ARS"
}
},
{
"id":738,
"operatorId":738,
"name":"Tuenti Argentina",
"country":{
"isoName":"AR",
"name":"Argentina"
},
"fx":{
"rate":0.204,
"currencyCode":"ARS"
}
}
]
The JSON response has been abbreviated for the sake of brevity in this guide
Thus the response above shows you an overview of every operator in Argentina and their details.