List services
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.datashop.africa/api/v2/get-services', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://app.datashop.africa/api/v2/get-services \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.datashop.africa/api/v2/get-services"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.datashop.africa/api/v2/get-services",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}Products and services
List services
List the services available to your API account.
GET
/
api
/
v2
/
get-services
List services
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.datashop.africa/api/v2/get-services', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://app.datashop.africa/api/v2/get-services \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.datashop.africa/api/v2/get-services"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.datashop.africa/api/v2/get-services",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}Start product discovery here. The response lists the services your account can sell, such as data, airtime, electricity, and TV.
Parameters
No parameters are required.Request
GET /api/v2/get-services
Authorization: Bearer YOUR_API_KEY
Successful response
{
"status": true,
"message": "Services fetched successfully.",
"data": ["data", "airtime", "electricity", "tv"]
}
Failed response
{
"status": false,
"message": "Error message"
}
⌘I