PHP code example of papalardo / bot-conversa-api-client
1. Go to this page and download the library: Download papalardo/bot-conversa-api-client 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/ */
papalardo / bot-conversa-api-client example snippets
use Papalardo\BotConversaApiClient\BotConversaClientConfig;
BotConversaClientConfig::i()
->accessToken('your-access-token')
->debug() // To enable debug info
;
use Papalardo\BotConversaApiClient\BotConversaClient;
$subscriberService = BotConversaClient::make()->subscriber();
// Creating subscriber
$subscriberService->create(new CreateSubscriberData([
'phone' => '5561000000000',
'firstName' => 'John',
'lastName' => 'Doe'
]))
// Read subscriber
$subscriber = $subscriberService->read('5561000000000');
// Send message
$subscriberService
->sendMessage($subscriber->id(), new SendMessageData([
'value' => 'Notification test message'
]));