Opensource php wrapper to WhatsApp Cloud API.
- Sending messages
- Sending Media (images, audio, video and ducuments)
- Sending location
- Sending interactive buttons
- Sending template messages
You can install the package via composer:
composer require zepson/whatsappcloud-php
<?php
require_once 'vendor/autoload.php';
use zepson\Whatsapp\WhatsappClass;
$token = 'YOUR_META_WHATSAPP_APP_ACCESS_TOKEN';
$phone_number_id = '10726082513218961';
//send message
$tsap = new WhatsappClass( $phone_number_id, $token);
$sendtsap = $tsap->send_template('hello_world', '255654485755');
print_r($sendtsap);
send_message($message, $recipient_id)
send_template($template, $recipient_id, $lang = "en_US")
sendLocation($lat, $long, $name, $address, $recipient_id)
send_image($image, $recipient_id, $recipient_type = "individual", $caption = null, $link = true)
send_audio($audio, $recipient_id, $link = true)
send_video($video, $recipient_id, $caption = null, $link = true)
send_document($document, $recipient_id, $caption = null, $link = true)
create_button($button)
public function send_button($button, $recipient_id)
composer test
Please see CHANGELOG for more information on what has changed recently.
Contribute to make more improvement and fix bugs.
The MIT License (MIT). Please see License File for more information.