zepson / whatsappcloud-php
WhatsApp Latest CLoud API Wrapper for PHP
Fund package maintenance!
pro-cms
Installs: 827
Dependents: 0
Suggesters: 0
Security: 0
Stars: 75
Watchers: 9
Forks: 24
Open Issues: 4
Requires
- php: ^8.0|^7.4
- guzzlehttp/guzzle: ^7.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- pestphp/pest: ^1.20
- spatie/ray: ^1.28
This package is auto-updated.
Last update: 2024-12-09 06:57:56 UTC
README
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.