Dev Tool
API Authentication Token
Copy Generate new token
Copy Generate new token
API Docs
User
// URL of the API you want to send the request to
$url = 'https://amirdata.com.ng/api/v1/user.php';
//Auth token
$auth_token = "HeFjodItGAvgKrlIPJ6iaH74393zCeF85ujkZEPEr0eV5NR"; //replace this with your token
// Initialize cURL session
$ch = curl_init($url);
// Set cURL options for the request
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Return the response as a string
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: ' . $auth_token, // Include the Authorization header
));
// Execute the cURL session and fetch the response
$response = curl_exec($ch);
// Check for cURL errors
if (curl_errno($ch)) {
echo 'cURL Error: ' . curl_error($ch);
}
// Close the cURL session
curl_close($ch);
// Output the response
echo $response;
Sample Response
{
"success":"true",
"username":"wazobia",
"balance":"8390.3"
}
Data
Sample Request
// URL of the API you want to send the POST request to
$url = 'https://amirdata.com.ng/api/v1/data.php';
$paypload = array(
'network' =>"1",
'plan_id' => "2",
'mobile_number' => "08101346784",
'request_id' => "7uw76322",
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($paypload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$headers = [
"Authorization: d4eaa2f409c4a7b92f3a9e98d4a2dc826b5b08d3383dd4719bf00fec",
'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Sample Response
{
"success":"true",
"desc":"Transaction successful",
"info":{
"status":"Success",
"trans_id":"DT235128001698",
"previous_balance":"14906.8",
"new_balance":14791.8,
"amount_deducted":"115.00",
"plan":"500MB (SME) 30 days"
}
}
Airtime
Sample Request
// URL of the API you want to send the POST request to
$url = 'https://amirdata.com.ng/api/v1/airtime.php';
$paypload = array(
'network' =>"1",
'amount' => "100",
'mobile_number' => "08101346784",
'request_id' => "7uw76322",
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($paypload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$headers = [
"Authorization: d4eaa2f409c4a7b92f3a9e98d4a2dc826b5b08d3383dd4719bf00fec",
'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Sample Response
{
"success":"true",
"desc":"Transaction successful",
"info":{"status":"Success","trans_id":"AT723428001697","previous_balance":"276","new_balance":173.664,"cash_back":1.6640000000000001}
}
Data Card
Sample Request
// URL of the API you want to send the POST request to
$url = 'https://amirdata.com.ng/api/v1/datacard.php';
$paypload = array(
'network' =>"1",
'plan_id' => "57",
'amount' => "1",
'request_id' => "56uw76322",
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($paypload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$headers = [
"Authorization: d4eaa2f409c4a7b92f3a9e98d4a2dc826b5b08d3383dd4719bf00fec",
'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Sample Response
{
"success":"true",
"desc":"Transaction successful",
"info":{
"status":"Success",
"trans_id":"DC857303001699",
"previous_balance":"1527.3",
"new_balance":1295.3,
"amount_deducted":232,
"plan":"1GB (CG) 31 days",
"pin":"[1694177830]"
}
}