WhatsApp Latest Cloud API Wrapper for PHP
Opensource php wrapper to WhatsApp Cloud API.
Features supported
- Sending messages
- Sending Media (images, audio, video and ducuments)
- Sending location
- Sending interactive buttons
- Sending template messages
Installation
You can install the package via composer:
composer require zepson/whatsappcloud-php
Usage
<?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);
All Available Methods
Send plain text
send_message($message, $recipient_id)
Send from template
send_template($template, $recipient_id, $lang = "en_US")
Send Location
sendLocation($lat, $long, $name, $address, $recipient_id)
Send image
send_image($image, $recipient_id, $recipient_type = "individual", $caption = null, $link = true)
Send Audio
send_audio($audio, $recipient_id, $link = true)
Send Video
send_video($video, $recipient_id, $caption = null, $link = true)
Send Document
send_document($document, $recipient_id, $caption = null, $link = true)
create button
create_button($button)
send button
public function send_button($button, $recipient_id)
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Contribute to make more improvement and fix bugs.
Credits
License
The MIT License (MIT). Please see License File for more information.