Data Bundle
Purchase Data Bundle
post
{{base_url}}/databundle
Data Bundle
Take a look at how you might do this:
cURL
NodeJS
PHP - cURL
Python
Dart
curl --location --request POST 'https://api.1app.online/v1/databundle' \
--header 'Authorization: Bearer SECREY_KEY' \
--form 'datacode="1000"' \
--form 'network_id="2"' \
--form 'phoneno="07012345678"' \
--form 'reference="DJIEJ2MEUE2EN34"'
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.1app.online/v1/databundle',
'headers': {
'Authorization': 'Bearer SECREY_KEY'
},
formData: {
'datacode': '1000',
'network_id': '2',
'phoneno': '07012345678',
'reference': 'DJIEJ2MEUE2EN34'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.1app.online/v1/databundle',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('datacode' => '1000','network_id' => '2','phoneno' => '07012345678','reference' => 'DJIEJ2MEUE2EN34'),
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer SECREY_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://api.1app.online/v1/databundle"
payload={'datacode': '1000',
'network_id': '2',
'phoneno': '07012345678',
'reference': 'DJIEJ2MEUE2EN34'}
files=[
]
headers = {
'Authorization': 'Bearer SECREY_KEY'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
var headers = {
'Authorization': 'Bearer SECREY_KEY'
};
var request = http.MultipartRequest('POST', Uri.parse('https://api.1app.online/v1/databundle'));
request.fields.addAll({
'datacode': '1000',
'network_id': '2',
'phoneno': '07012345678',
'reference': 'DJIEJ2MEUE2EN34'
});
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}

Sample Response

{
"status": true,
"message": "Success",
"txref": "API1090229525d60",
"charged": "260.00",
"newbal": 40083.79
}
Copy link
On this page
post
Data Bundle
Sample Response