Data Plans
Get Data Bundle Plans
get
{{base_url}}/getdataplans
Data Plans
Take a look at how you might do this:
cURL
NodeJs
PHP - cURL
Python
Dart
1
curl --location --request GET 'https://api.1app.online/v1/getdataplans?provider=MTN' \
2
--header 'Authorization: Bearer PUBLIC_KEY'
Copied!
1
var request = require('request');
2
var options = {
3
'method': 'GET',
4
'url': 'https://api.1app.online/v1/getdataplans?provider=MTN',
5
'headers': {
6
'Authorization': 'Bearer PUBLIC_KEY'
7
}
8
};
9
request(options, function (error, response) {
10
if (error) throw new Error(error);
11
console.log(response.body);
12
});
13
Copied!
1
$curl = curl_init();
2
3
curl_setopt_array($curl, array(
4
CURLOPT_URL => 'https://api.1app.online/v1/getdataplans?provider=MTN',
5
CURLOPT_RETURNTRANSFER => true,
6
CURLOPT_ENCODING => '',
7
CURLOPT_MAXREDIRS => 10,
8
CURLOPT_TIMEOUT => 0,
9
CURLOPT_FOLLOWLOCATION => true,
10
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
11
CURLOPT_CUSTOMREQUEST => 'GET',
12
CURLOPT_HTTPHEADER => array(
13
'Authorization: Bearer PUBLIC_KEY'
14
),
15
));
16
17
$response = curl_exec($curl);
18
19
curl_close($curl);
20
echo $response;
21
Copied!
1
import requests
2
3
url = "https://api.1app.online/v1/getdataplans?provider=MTN"
4
5
payload={}
6
headers = {
7
'Authorization': 'Bearer PUBLIC_KEY'
8
}
9
10
response = requests.request("GET", url, headers=headers, data=payload)
11
12
print(response.text)
13
Copied!
1
var headers = {
2
'Authorization': 'Bearer PUBLIC_KEY'
3
};
4
var request = http.Request('GET', Uri.parse('https://api.1app.online/v1/getdataplans?provider=MTN'));
5
6
request.headers.addAll(headers);
7
8
http.StreamedResponse response = await request.send();
9
10
if (response.statusCode == 200) {
11
print(await response.stream.bytesToString());
12
}
13
else {
14
print(response.reasonPhrase);
15
}
16
Copied!

Sample Response

1
{
2
"status": true,
3
"message": "Data Plans Retrieved",
4
"data": [
5
{
6
"pname": "MTN 1.0GB/30days",
7
"price": 260,
8
"datacode": "1000",
9
"point": "1.0"
10
},
11
{
12
"pname": "MTN 1.0GB/30days (SME)",
13
"price": 260,
14
"datacode": "mtn1000sme",
15
"point": "1.0"
16
},
17
{
18
"pname": "MTN 10.0GB/30days",
19
"price": 2900,
20
"datacode": "10000",
21
"point": "10.0"
22
}
23
]
24
}
Copied!