Cable TV List
get
{{base_url}}/listcabletv
Get Cable Tv List
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/listcabletv?tv=DSTV' \
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/listcabletv?tv=DSTV',
5
'headers': {
6
'Authorization': 'Bearer PUBLIC_KEY'
7
},
8
formData: {
9
10
}
11
};
12
request(options, function (error, response) {
13
if (error) throw new Error(error);
14
console.log(response.body);
15
});
16
Copied!

Sample Response

1
{
2
"status": true,
3
"message": [
4
{
5
"code": "gotv-max",
6
"name": "GOtv Max N3,600",
7
"Amount": "3600.00",
8
"description": ""
9
},
10
{
11
"code": "gotv-jolli",
12
"name": "GOtv Jolli N2,460",
13
"Amount": "2460.00",
14
"description": ""
15
},
16
{
17
"code": "gotv-jinja",
18
"name": "GOtv Jinja N1,640",
19
"Amount": "1640.00",
20
"description": ""
21
}
22
]
23
}
Copied!
1
$curl = curl_init();
2
3
curl_setopt_array($curl, array(
4
CURLOPT_URL => 'https://api.1app.online/v1/listcabletv?tv=DSTV',
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/listcabletv?tv=DSTV"
4
5
payload={}
6
files={}
7
headers = {
8
'Authorization': 'Bearer PUBLIC_KEY'
9
}
10
11
response = requests.request("GET", url, headers=headers, data=payload, files=files)
12
13
print(response.text)
14
Copied!
1
var headers = {
2
'Authorization': 'Bearer PUBLIC_KEY'
3
};
4
var request = http.MultipartRequest('GET', Uri.parse('https://api.1app.online/v1/listcabletv?tv=DSTV'));
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": "CableTV List Retrieved",
4
"cablelist": [
5
{
6
"code": "dstv-padi",
7
"name": "DStv Padi N2,150",
8
"Amount": "2150.00",
9
"description": ""
10
},
11
{
12
"code": "dstv-yanga",
13
"name": "DStv Yanga N2,950",
14
"Amount": "2950.00",
15
"description": ""
16
},
17
{
18
"code": "dstv-confam",
19
"name": "Dstv Confam N5,300",
20
"Amount": "5300.00",
21
"description": ""
22
},
23
{
24
"code": "dstv79",
25
"name": "DStv Compact N9,000",
26
"Amount": "9000.00",
27
"description": ""
28
},
29
{
30
"code": "dstv3",
31
"name": "DStv Premium N21,000",
32
"Amount": "21000.00",
33
"description": ""
34
},
35
{
36
"code": "dstv6",
37
"name": "DStv Asia N7,100",
38
"Amount": "7100.00",
39
"description": ""
40
},
41
{
42
"code": "dstv7",
43
"name": "DStv Compact Plus N14,250",
44
"Amount": "14250.00",
45
"description": ""
46
},
47
{
48
"code": "dstv9",
49
"name": "DStv Premium-French N29,300",
50
"Amount": "29300.00",
51
"description": ""
52
},
53
{
54
"code": "dstv10",
55
"name": "DStv Premium-Asia N23,500",
56
"Amount": "23500.00",
57
"description": ""
58
}
59
]
60
}
Copied!