summaryrefslogtreecommitdiffstats
path: root/example_v3.php
diff options
context:
space:
mode:
authorElmer Thomas <elmer@ThinkingSerious.com>2015-12-15 13:36:09 -0800
committerElmer Thomas <elmer@ThinkingSerious.com>2015-12-15 13:36:09 -0800
commit7f69f89d92cd54db26b4f420da1f46ed456a1668 (patch)
treec3ae1aea8668751755ed1a876bba003f1e0e7ae9 /example_v3.php
parentebf68af9d4158450b6d673bf6d31ff5297057882 (diff)
parent2e7d3fcffd757c5ae1ef313fa2a8c3aa31ec29a0 (diff)
downloadsendgrid-php-4.0.3.zip
sendgrid-php-4.0.3.tar.gz
sendgrid-php-4.0.3.tar.bz2
Merge pull request #183 from sendgrid/statsv4.0.3
Add stats [GET] endpoint
Diffstat (limited to 'example_v3.php')
-rwxr-xr-xexample_v3.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/example_v3.php b/example_v3.php
index 33322db..47a0e2b 100755
--- a/example_v3.php
+++ b/example_v3.php
@@ -9,6 +9,31 @@ $sendgrid = new Client($sendgrid_apikey);
/*
+$start_date = "2015-12-01";
+$response = $sendgrid->global_stats->get($start_date);
+print("Status Code: " . $response->getStatusCode() . "\n");
+print("Body: " . $response->getBody() . "\n\n");
+
+$end_date = "2015-12-14";
+$response = $sendgrid->global_stats->get($start_date, $end_date);
+print("Status Code: " . $response->getStatusCode() . "\n");
+print("Body: " . $response->getBody() . "\n\n");
+
+$aggregated_by = "day";
+$response = $sendgrid->global_stats->get($start_date, $end_date, $aggregated_by);
+print("Status Code: " . $response->getStatusCode() . "\n");
+print("Body: " . $response->getBody() . "\n\n");
+
+$aggregated_by = "week";
+$response = $sendgrid->global_stats->get($start_date, $end_date, $aggregated_by);
+print("Status Code: " . $response->getStatusCode() . "\n");
+print("Body: " . $response->getBody() . "\n\n");
+
+$aggregated_by = "month";
+$response = $sendgrid->global_stats->get($start_date, $end_date, $aggregated_by);
+print("Status Code: " . $response->getStatusCode() . "\n");
+print("Body: " . $response->getBody() . "\n\n");
+
$group_id = 70;
$email = 'example@example.com';
$response = $sendgrid->asm_suppressions->delete($group_id, $email);