1. Go to this page and download the library: Download tm4b/tm4b-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/ */
lient = \Tm4b\Rest\Client::create([
'apiKey' => 'TM4B_API_KEY'
]);
try {
$response = $msgClient->messages()->send([
'destination_address' => '+441234567890',
'source_address' => 'master',
'content' => 'There is a civil war between the Galactic Empire and a Rebel Alliance.'
]);
print_r($response);
} catch (\Tm4b\Exception\HttpClientException $e) {
print_r($e->getResponseBody());
}
lient = \Tm4b\Rest\Client::create([
'apiKey' => 'TM4B_API_KEY'
]);
$response = $msgClient->messages()->send([
[
'destination_address' => '+447711961111',
'source_address' => 'GeorgeLucas',
'content' => 'There is a civil war between the Galactic Empire and a Rebel Alliance.'
],
[
'destination_address' => '+97150349030',
'source_address' => 'GeorgeLucas',
'content' => 'There is a civil war between the Galactic Empire and a Rebel Alliance.'
]
]);
lient = \Tm4b\Rest\Client::create([
'apiKey' => 'TM4B_API_KEY'
]);
$msgClient->setSandbox(true);
$response = $msgClient->messages()->send([
[
'destination_address' => '+447711961111',
'source_address' => 'GeorgeLucas',
'content' => 'There is a civil war between the Galactic Empire and a Rebel Alliance.'
]
]);