Qiscus Whatsapp API Third Party PHP Package.
Before you use the package, make sure you have a Qiscus Multichannel account by register in here. You also need WABA (WhatsApp Business Account) ID to create template.
Install package with composer by following command:
composer require ryuamy/whatsapp-qiscus-php
Add following code on your project:
use Ryuamy\WAQiscus;
WAQiscus\Class::function( $appId, ... );
$bodyParameters = [
'email' => '(Qiscus login email)',
'password' => '(Qiscus login password)',
];
$Whatsapp = WAQiscus\Authentication::getToken( '(Application ID)', $bodyParameters );
Sending whatsapp chat with template. Make sure you have the template already on your Qiscus dashboard.
$bodyParameters = [
'to' => '62812345678',
'type' => 'template',
'template' => [
'namespace' => '(namespace template)',
'name' => 'template_testing',
'language' => [
'policy' => 'deterministic',
'code' => 'en'
],
'components' => array() //header, body, and footer template variables
]
];
$Whatsapp = WAQiscus\Message::template( '(Application ID)', '(Token Auth)', '(Channel ID)', $bodyParameters );