Vend CableTv
Purchase Cable Tv Subscription
post
{{base_url}}/cabletv
Cable Tv
Take a look at how you might do this:
cURL
NodeJS
PHP - cURL
Python
Dart
1
curl --location --request POST 'https://api.1app.online/v1/cabletv' \
2
--header 'Authorization: Bearer SECRET_KEY' \
3
--form 'tvno="7528393100"' \
4
--form 'tv="GOTV"' \
5
--form 'custname="IBRAHIM MARY OPE"' \
6
--form 'custno="376946518"' \
7
--form 'amount="5000"' \
8
--form 'reference="OI8UYTEFYDTYTG7"'
Copied!
1
var request = require('request');
2
var options = {
3
'method': 'POST',
4
'url': 'https://api.1app.online/v1/cabletv',
5
'headers': {
6
'Authorization': 'Bearer SECRET_KEY'
7
},
8
formData: {
9
'tvno': '7528393100',
10
'tv': 'GOTV',
11
'custname': 'IBRAHIM MARY OPE',
12
'custno': '376946518',
13
'amount': '5000',
14
'reference': 'OI8UYTEFYDTYTG7'
15
}
16
};
17
request(options, function (error, response) {
18
if (error) throw new Error(error);
19
console.log(response.body);
20
});
21
Copied!
1
$curl = curl_init();
2
3
curl_setopt_array($curl, array(
4
CURLOPT_URL => 'https://api.1app.online/v1/cabletv',
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 => 'POST',
12
CURLOPT_POSTFIELDS => array('tvno' => '7528393100','tv' => 'GOTV','custname' => 'IBRAHIM MARY OPE','custno' => '376946518','amount' => '5000','reference' => 'OI8UYTEFYDTYTG7'),
13
CURLOPT_HTTPHEADER => array(
14
'Authorization: Bearer SECRET_KEY'
15
),
16
));
17
18
$response = curl_exec($curl);
19
20
curl_close($curl);
21
echo $response;
22
Copied!
1
import requests
2
3
url = "https://api.1app.online/v1/cabletv"
4
5
payload={'tvno': '7528393100',
6
'tv': 'GOTV',
7
'custname': 'IBRAHIM MARY OPE',
8
'custno': '376946518',
9
'amount': '5000',
10
'reference': 'OI8UYTEFYDTYTG7'}
11
files=[
12
13
]
14
headers = {
15
'Authorization': 'Bearer SECRET_KEY'
16
}
17
18
response = requests.request("POST", url, headers=headers, data=payload, files=files)
19
20
print(response.text)
21
Copied!
1
var headers = {
2
'Authorization': 'Bearer SECRET_KEY'
3
};
4
var request = http.MultipartRequest('POST', Uri.parse('https://api.1app.online/v1/cabletv'));
5
request.fields.addAll({
6
'tvno': '7528398312',
7
'tv': 'GOTV',
8
'custname': 'SW1453/NEYOTOS/OLATUNJI OLAJIDE',
9
'custno': '176146518',
10
'amount': '200',
11
'reference': 'OI8UYTEFYDTYTG7'
12
});
13
14
request.headers.addAll(headers);
15
16
http.StreamedResponse response = await request.send();
17
18
if (response.statusCode == 200) {
19
print(await response.stream.bytesToString());
20
}
21
else {
22
print(response.reasonPhrase);
23
}
24
Copied!

Sample Response

1
{
2
"status": true,
3
"message": "Success",
4
"txref": "API8650294032c698",
5
"charged": 5030,
6
"newbal": 100064.8
7
}
Copied!