| Server IP : 192.185.180.161 / Your IP : 216.73.216.153 Web Server : Apache System : Linux simka.websitewelcome.com 5.14.0-687.39.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Aug 18 06:09:16 EDT 2026 x86_64 User : xstream ( 1368) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home2/xstream/public_html/createsend-php-7-0/samples/transactional/ |
Upload File : |
<?php
require_once "../../csrest_transactional_timeline.php";
$client_id = "Your Client ID";
$auth = array("api_key" => "Your API Key");
$wrap = new CS_REST_Transactional_Timeline($auth, $client_id);
echo "\nGetting the statistics with the default parameters...\n";
$result = $wrap->statistics();
var_dump($result->response);
echo "\nGetting the statistics, filtered to a classic group...\n";
$result = $wrap->statistics(array(
"from" => "2015-01-01",
"to" => "2015-06-30",
"timezone" => "utc",
"group" => "PHP Test Group"
));
var_dump($result->response);
echo "\nGetting the statistics, filtered to a smart email...\n";
$smart_email_id = "94b2a1a5-6754-416b-a87f-1edb81c460a2"; #grab it from the URL
$result = $wrap->statistics(array(
"from" => "2015-01-01",
"to" => "2015-06-30",
"timezone" => "client",
"smartEmailID" => $smart_email_id
));
var_dump($result->response);
echo "\nGetting the most recent sent messages...\n";
$result = $wrap->messages();
$last_message_id = $result->response[0]->MessageID;
echo "\nHere's the first:\n";
var_dump($result->response[0]);
echo "\nGetting the most recent messages for a smart email, with all the options...\n";
$result = $wrap->messages(array(
"status" => 'all',
"count" => 200,
"sentBeforeID" => NULL, # message ID
"sentAfterID" => NULL, # message ID
"smartEmailID" => '94b2a1a5-6754-416b-a87f-1edb81c460a2',
));
$last_message_id = $result->response[0]->MessageID;
echo "\nHere's the first:\n";
var_dump($result->response[0]);
echo "\nGetting the most recent messages for a classic email, with all the options...\n";
$result = $wrap->messages(array(
"status" => 'all',
"count" => 200,
"sentBeforeID" => NULL, # message ID
"sentAfterID" => NULL, # message ID
"group" => 'PHP test group',
));
$last_message_id = $result->response[0]->MessageID;
echo "\nHere's the first:\n";
var_dump($result->response[0]);
echo "\nGetting the details of the most recent message...\n";
$result = $wrap->details($last_message_id);
var_dump($result->response);
echo "\nGetting the message details with details of opens and clicks...\n";
$result = $wrap->details($last_message_id, true);
var_dump($result->response);
echo "\nResending message...\n";
$result = $wrap->resend($last_message_id);
var_dump($result->response);