PHP code example of zepson / whatsappcloud-php

1. Go to this page and download the library: Download zepson/whatsappcloud-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zepson / whatsappcloud-php example snippets




pson\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)
bash
composer