Introduction

Learn how to integrate our APIs into your application and build your own solution

API Basics

The DataVTU API gives you access to pretty much all the features you can use on our dashboard and lets you extend them for use in your application.

Sample Requests

We provide sample API calls next to each method using cURL. All you need to do is insert your specific parameters, and you can test the calls from the command line. See this tutorial on using cURL with APIs.

Requests and Response

Both request body data and response data are formatted as JSON. Content type for responses will always be application/json.

API Balance

Authenticate your API calls by including your secret key in the Authorization header of every request you make. You can manage your API keys from the dashboard.

$curl = curl_init();
$body = [];
curl_setopt_array($curl, array(
CURLOPT_URL => “https://datavtu.com.ng/api/user”,
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 => $body,
CURLOPT_HTTPHEADER => array(
“Content-Type: application/json”,
“Authorization:
hfhk1ukeneqeyece7a6ufiwaxe5ici3a5ute5urajucivuyukfjhirage3u8″
),
));
$response = curl_exec($curl);
print_r($response);

BUY AIRTIME

$curl = curl_init();
$body = json_encode([“network” => “mtn”, “amount” => “50”, “phoneno” => “08136367446”]);
curl_setopt_array($curl, array(
CURLOPT_URL => “https://datavtu.com.ng/api/airtime”,
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 => $body,
CURLOPT_HTTPHEADER => array(
“Content-Type: application/json”,
“Authorization: hfhk1ukeneqeyece7a6ufiwaxe5ici3a5ute5urajucivuyukfjhirage3u8”
),
));
$response = curl_exec($curl);
print_r($response);

BUY DATA

$curl = curl_init();
$body = json_encode([“datasize” => “500MB”, “phoneno” => “08136367446”]);
curl_setopt_array($curl, array(
CURLOPT_URL => “https://datavtu.com.ng/api/data”,
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 => $body,
CURLOPT_HTTPHEADER => array(
“Content-Type: application/json”,
“Authorization: hfhk1ukeneqeyece7a6ufiwaxe5ici3a5ute5urajucivuyukfjhirage3u8”
),
));
$response = curl_exec($curl);
print_r($response);

BUY CABLE

$curl = curl_init();
$body = json_encode([“package” => “smallie”, “iuc” => “2229159680”]);
curl_setopt_array($curl, array(
CURLOPT_URL => “https://datavtu.com.ng/api/cabletv”,
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 => $body,
CURLOPT_HTTPHEADER => array(
“Content-Type: application/json”,
“Authorization:
=hfhk1ukeneqeyece7a6ufiwaxe5ici3a5ute5urajucivuyukfjhirage3u8″
),
));
$response = curl_exec($curl);
print_r($response);

BUY EDUCATION

$curl = curl_init();
$body = json_encode([“productid” => “waec”]);
curl_setopt_array($curl, array(
CURLOPT_URL => “https://datavtu.com.ng/api/vendeducation”,
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 => $body,
CURLOPT_HTTPHEADER => array(
“Content-Type: application/json”,
“Authorization: hfhk1ukeneqeyece7a6ufiwaxe5ici3a5ute5urajucivuyukfjhirage3u8”
),
));
$response = curl_exec($curl);
print_r($response);

BUY ELECTRICITY

$curl = curl_init();
$body = json_encode([“disco” => “ibedc”, “meterNo” => “27132076089”, “amount” => 50]);
curl_setopt_array($curl, array(
CURLOPT_URL => “https://datavtu.com.ng/api/electrcity”,
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 => $body,
CURLOPT_HTTPHEADER => array(
“Content-Type: application/json”,
“Authorization: hfhk1ukeneqeyece7a6ufiwaxe5ici3a5ute5urajucivuyukfjhirage3u8”
),
));
$response = curl_exec($curl);
print_r($response);