PHP code example of socola / sdk-php-chatfuel-socola

1. Go to this page and download the library: Download socola/sdk-php-chatfuel-socola 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/ */

    

socola / sdk-php-chatfuel-socola example snippets


use Socola\Chatfuel;
$bot = new Chatfuel();

$text = 'Socola';
$texts = [$text, $text, $text, $text];
$bot->sendText($text);
$bot->sendText($texts);

$image = 'http://i.imgur.com/luWlRwV.jpg';
$images = [
	'http://i.imgur.com/luWlRwV.jpg',
	'http://i.imgur.com/luWlRwV.jpg'
];
$bot->sendImage($image);
$bot->sendImage(images);
javascript
$file = 'https://01b02091.ngrok.io/test.pdf';
$files = array(
	'https://01b02091.ngrok.io/test.pdf',
	'https://01b02091.ngrok.io/test.pdf'
);
$bot->sendFile($file);
$bot->sendFile($files);
javascript
$text = 'this is text card';
$uttons = [
	$buttonToURL,
	$buttonToBlock,
	$buttonShare
];
$bot->sendTextCard($text, $button);
$bot->sendTextCard($text, $buttons);