This API is used to delete a device via API.
Before proceed, the only way to delete device is by giving correct OTP code.
The OTP code is sent to the whatsapp number on the setting menu.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.fonnte.com/delete-device',
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 => array(),
CURLOPT_HTTPHEADER => array(
'Authorization: TOKEN'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
If you prefer to see on postman, see here.
The token is device token. see how to get token.
Response
Successfull response
{
"detail": "device 08123456789 successfully deleted",
"status": true
}
- invalid device : invalid token
{
"reason": "invalid device",
"status": false
} 