PHP code example of forte-tecnologia / whastapp-sdk
1. Go to this page and download the library: Download forte-tecnologia/whastapp-sdk 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/ */
forte-tecnologia / whastapp-sdk example snippets
teTecnologia\Whastapp\Http\Client;
// Credenciais
$email = '[email protected]';
$password = 'xxxxxxx';
// exemplo:
// https://xxxxxxx.fortetecnologiaapp.com.br
$company = 'xxxxxxx';
// Inicializa o cliente e autentica
$client = new Client();
$token = $client->auth($email, $password);
// Cria a mensagem
$message = [
'company' => $company,
'to' => '63999999999',
'message' => 'Bom dia!'
];
// Envia a mensagem
$response = $client->messages()->send($token, $message);