WhatsApp Business API
Auth
Basic Auth
$userHashKey = 'User Hash Key provided by your account manager';
$ch = curl_init('https://web.it-decision.com/v1/api/send-whatsapp');
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "$userHashKey");
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($requestParams)); // $requestParams - raquest array with correct data
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
$result = curl_exec($ch);
curl_close($ch);API Send WhatsApp message
API Receive WhatsApp message:
WhatsApp messages statuses
sent
0
Errors
name
Too Many Requests
name
Invalid Parameter: [param_name]
name
Internal server error
name
Topup balance is required
name
Internal server error
name
Service Unavailable
name
Invalid credintals for file_url
name
Invalid credintals for file_url
Приклади відправки WhatsApp повідомлення:
Last updated