Typing api enable you to simulate typing and creating typing indicator on whatsapp.
this is beneficial for adding presence that you are being thinking/answering the message or just simulate typing, especially on long awaited answer like waiting AI to response or your webhook need to process something and take a bit longer than a second.
you can see it on postman.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.fonnte.com/typing',
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('target' => '08123456789','countryCode'=>'62','duration' => 10,'stop'=>false),
CURLOPT_HTTPHEADER => array(
'Authorization: TOKEN'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response; Available parameter
- target (required) (string) - number to simulate typing with
- countyCode (optional) (string) - country code of the target
- duration (required) (int) - typing duration in second
- stop (optional) (bool) - should the typing stop
