Skip to content

ryuamy/whatsapp-qiscus-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Qiscus Whatsapp API Third Party PHP Package

license release

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.

Instalation

Install package with composer by following command:

composer require ryuamy/whatsapp-qiscus-php

Call Package

Add following code on your project:

use Ryuamy\WAQiscus;

Usages

WAQiscus\Class::function( $appId, ... );

Example

Authentication

Get Token

$bodyParameters = [
    'email' => '(Qiscus login email)',
    'password' => '(Qiscus login password)',
];

$Whatsapp = WAQiscus\Authentication::getToken( '(Application ID)', $bodyParameters );

Sending Message

Template Message

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 );