summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/accesssettings/accesssettings.php36
-rw-r--r--examples/apikeys/apikeys.php36
-rw-r--r--examples/asm/asm.php80
-rw-r--r--examples/browsers/browsers.php6
-rw-r--r--examples/campaigns/campaigns.php66
-rw-r--r--examples/categories/categories.php18
-rw-r--r--examples/clients/clients.php12
-rw-r--r--examples/contactdb/contactdb.php190
-rw-r--r--examples/devices/devices.php6
-rw-r--r--examples/geo/geo.php6
-rw-r--r--examples/ips/ips.php86
-rw-r--r--examples/mail/mail.php19
-rw-r--r--examples/mailboxproviders/mailboxproviders.php6
-rw-r--r--examples/mailsettings/mailsettings.php114
-rw-r--r--examples/partnersettings/partnersettings.php18
-rw-r--r--examples/scopes/scopes.php6
-rw-r--r--examples/stats/stats.php6
-rw-r--r--examples/subusers/subusers.php84
-rw-r--r--examples/suppression/suppression.php102
-rw-r--r--examples/templates/templates.php68
-rw-r--r--examples/trackingsettings/trackingsettings.php54
-rw-r--r--examples/user/user.php126
-rw-r--r--examples/whitelabel/whitelabel.php164
23 files changed, 655 insertions, 654 deletions
diff --git a/examples/accesssettings/accesssettings.php b/examples/accesssettings/accesssettings.php
index 8199195..13c12ac 100644
--- a/examples/accesssettings/accesssettings.php
+++ b/examples/accesssettings/accesssettings.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Retrieve all recent access attempts #
-# GET /access_settings/activity #
+////////////////////////////////////////////////////
+// Retrieve all recent access attempts #
+// GET /access_settings/activity #
$query_params = json_decode('{"limit": 1}');
$response = $sg->client->access_settings()->activity()->get(null, $query_params);
@@ -16,9 +16,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Add one or more IPs to the whitelist #
-# POST /access_settings/whitelist #
+////////////////////////////////////////////////////
+// Add one or more IPs to the whitelist #
+// POST /access_settings/whitelist #
$request_body = json_decode('{
"ips": [
@@ -38,27 +38,27 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a list of currently whitelisted IPs #
-# GET /access_settings/whitelist #
+////////////////////////////////////////////////////
+// Retrieve a list of currently whitelisted IPs #
+// GET /access_settings/whitelist #
$response = $sg->client->access_settings()->whitelist()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Remove one or more IPs from the whitelist #
-# DELETE /access_settings/whitelist #
+////////////////////////////////////////////////////
+// Remove one or more IPs from the whitelist #
+// DELETE /access_settings/whitelist #
$response = $sg->client->access_settings()->whitelist()->delete($request_body);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a specific whitelisted IP #
-# GET /access_settings/whitelist/{rule_id} #
+////////////////////////////////////////////////////
+// Retrieve a specific whitelisted IP #
+// GET /access_settings/whitelist/{rule_id} #
$rule_id = "test_url_param";
$response = $sg->client->access_settings()->whitelist()->_($rule_id)->get();
@@ -66,9 +66,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Remove a specific IP from the whitelist #
-# DELETE /access_settings/whitelist/{rule_id} #
+////////////////////////////////////////////////////
+// Remove a specific IP from the whitelist #
+// DELETE /access_settings/whitelist/{rule_id} #
$rule_id = "test_url_param";
$response = $sg->client->access_settings()->whitelist()->_($rule_id)->delete($request_body);
diff --git a/examples/apikeys/apikeys.php b/examples/apikeys/apikeys.php
index ec26642..2e02c5d 100644
--- a/examples/apikeys/apikeys.php
+++ b/examples/apikeys/apikeys.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Create API keys #
-# POST /api_keys #
+////////////////////////////////////////////////////
+// Create API keys #
+// POST /api_keys #
$request_body = json_decode('{
"name": "My API Key",
@@ -23,18 +23,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all API Keys belonging to the authenticated user #
-# GET /api_keys #
+////////////////////////////////////////////////////
+// Retrieve all API Keys belonging to the authenticated user #
+// GET /api_keys #
$response = $sg->client->api_keys()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update the name & scopes of an API Key #
-# PUT /api_keys/{api_key_id} #
+////////////////////////////////////////////////////
+// Update the name & scopes of an API Key #
+// PUT /api_keys/{api_key_id} #
$request_body = json_decode('{
"name": "A New Hope",
@@ -49,9 +49,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update API keys #
-# PATCH /api_keys/{api_key_id} #
+////////////////////////////////////////////////////
+// Update API keys #
+// PATCH /api_keys/{api_key_id} #
$request_body = json_decode('{
"name": "A New Hope"
@@ -62,9 +62,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve an existing API Key #
-# GET /api_keys/{api_key_id} #
+////////////////////////////////////////////////////
+// Retrieve an existing API Key #
+// GET /api_keys/{api_key_id} #
$api_key_id = "test_url_param";
$response = $sg->client->api_keys()->_($api_key_id)->get();
@@ -72,9 +72,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete API keys #
-# DELETE /api_keys/{api_key_id} #
+////////////////////////////////////////////////////
+// Delete API keys #
+// DELETE /api_keys/{api_key_id} #
$api_key_id = "test_url_param";
$response = $sg->client->api_keys()->_($api_key_id)->delete($request_body);
diff --git a/examples/asm/asm.php b/examples/asm/asm.php
index 233d968..e175509 100644
--- a/examples/asm/asm.php
+++ b/examples/asm/asm.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Create a new suppression group #
-# POST /asm/groups #
+////////////////////////////////////////////////////
+// Create a new suppression group #
+// POST /asm/groups #
$request_body = json_decode('{
"description": "Suggestions for products our users might like.",
@@ -20,9 +20,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve information about multiple suppression groups #
-# GET /asm/groups #
+////////////////////////////////////////////////////
+// Retrieve information about multiple suppression groups #
+// GET /asm/groups #
$query_params = json_decode('{"id": 1}');
$response = $sg->client->asm()->groups()->get(null, $query_params);
@@ -30,9 +30,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update a suppression group. #
-# PATCH /asm/groups/{group_id} #
+////////////////////////////////////////////////////
+// Update a suppression group. #
+// PATCH /asm/groups/{group_id} #
$request_body = json_decode('{
"description": "Suggestions for items our users might like.",
@@ -45,9 +45,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Get information on a single suppression group. #
-# GET /asm/groups/{group_id} #
+////////////////////////////////////////////////////
+// Get information on a single suppression group. #
+// GET /asm/groups/{group_id} #
$group_id = "test_url_param";
$response = $sg->client->asm()->groups()->_($group_id)->get();
@@ -55,9 +55,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a suppression group. #
-# DELETE /asm/groups/{group_id} #
+////////////////////////////////////////////////////
+// Delete a suppression group. #
+// DELETE /asm/groups/{group_id} #
$group_id = "test_url_param";
$response = $sg->client->asm()->groups()->_($group_id)->delete($request_body);
@@ -65,9 +65,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Add suppressions to a suppression group #
-# POST /asm/groups/{group_id}/suppressions #
+////////////////////////////////////////////////////
+// Add suppressions to a suppression group #
+// POST /asm/groups/{group_id}/suppressions #
$request_body = json_decode('{
"recipient_emails": [
@@ -81,9 +81,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all suppressions for a suppression group #
-# GET /asm/groups/{group_id}/suppressions #
+////////////////////////////////////////////////////
+// Retrieve all suppressions for a suppression group #
+// GET /asm/groups/{group_id}/suppressions #
$group_id = "test_url_param";
$response = $sg->client->asm()->groups()->_($group_id)->suppressions()->get();
@@ -91,29 +91,29 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a suppression from a suppression group #
-# DELETE /asm/groups/{group_id}/suppressions/{email} #
+////////////////////////////////////////////////////
+// Delete a suppression from a suppression group #
+// DELETE /asm/groups/{group_id}/suppressions/{email} #
$group_id = "test_url_param";
- $email = "test_url_param";
+$email = "test_url_param";
$response = $sg->client->asm()->groups()->_($group_id)->suppressions()->_($email)->delete($request_body);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all suppressions #
-# GET /asm/suppressions #
+////////////////////////////////////////////////////
+// Retrieve all suppressions #
+// GET /asm/suppressions #
$response = $sg->client->asm()->suppressions()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Add recipient addresses to the global suppression group. #
-# POST /asm/suppressions/global #
+////////////////////////////////////////////////////
+// Add recipient addresses to the global suppression group. #
+// POST /asm/suppressions/global #
$request_body = json_decode('{
"recipient_emails": [
@@ -126,9 +126,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a Global Suppression #
-# GET /asm/suppressions/global/{email} #
+////////////////////////////////////////////////////
+// Retrieve a Global Suppression #
+// GET /asm/suppressions/global/{email} #
$email = "test_url_param";
$response = $sg->client->asm()->suppressions()->global()->_($email)->get();
@@ -136,9 +136,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a Global Suppression #
-# DELETE /asm/suppressions/global/{email} #
+////////////////////////////////////////////////////
+// Delete a Global Suppression #
+// DELETE /asm/suppressions/global/{email} #
$email = "test_url_param";
$response = $sg->client->asm()->suppressions()->global()->_($email)->delete($request_body);
@@ -146,9 +146,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all suppression groups for an email address #
-# GET /asm/suppressions/{email} #
+////////////////////////////////////////////////////
+// Retrieve all suppression groups for an email address #
+// GET /asm/suppressions/{email} #
$email = "test_url_param";
$response = $sg->client->asm()->suppressions()->_($email)->get();
diff --git a/examples/browsers/browsers.php b/examples/browsers/browsers.php
index 0568dfc..c412160 100644
--- a/examples/browsers/browsers.php
+++ b/examples/browsers/browsers.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Retrieve email statistics by browser. #
-# GET /browsers/stats #
+////////////////////////////////////////////////////
+// Retrieve email statistics by browser. #
+// GET /browsers/stats #
$query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "browsers": "test_string", "limit": "test_string", "offset": "test_string", "start_date": "2016-01-01"}');
$response = $sg->client->browsers()->stats()->get(null, $query_params);
diff --git a/examples/campaigns/campaigns.php b/examples/campaigns/campaigns.php
index 0cfcdfb..184e850 100644
--- a/examples/campaigns/campaigns.php
+++ b/examples/campaigns/campaigns.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Create a Campaign #
-# POST /campaigns #
+////////////////////////////////////////////////////
+// Create a Campaign #
+// POST /campaigns #
$request_body = json_decode('{
"categories": [
@@ -35,9 +35,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all Campaigns #
-# GET /campaigns #
+////////////////////////////////////////////////////
+// Retrieve all Campaigns #
+// GET /campaigns #
$query_params = json_decode('{"limit": 0, "offset": 0}');
$response = $sg->client->campaigns()->get(null, $query_params);
@@ -45,9 +45,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update a Campaign #
-# PATCH /campaigns/{campaign_id} #
+////////////////////////////////////////////////////
+// Update a Campaign #
+// PATCH /campaigns/{campaign_id} #
$request_body = json_decode('{
"categories": [
@@ -64,9 +64,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a single campaign #
-# GET /campaigns/{campaign_id} #
+////////////////////////////////////////////////////
+// Retrieve a single campaign #
+// GET /campaigns/{campaign_id} #
$campaign_id = "test_url_param";
$response = $sg->client->campaigns()->_($campaign_id)->get();
@@ -74,9 +74,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a Campaign #
-# DELETE /campaigns/{campaign_id} #
+////////////////////////////////////////////////////
+// Delete a Campaign #
+// DELETE /campaigns/{campaign_id} #
$campaign_id = "test_url_param";
$response = $sg->client->campaigns()->_($campaign_id)->delete($request_body);
@@ -84,9 +84,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update a Scheduled Campaign #
-# PATCH /campaigns/{campaign_id}/schedules #
+////////////////////////////////////////////////////
+// Update a Scheduled Campaign #
+// PATCH /campaigns/{campaign_id}/schedules #
$request_body = json_decode('{
"send_at": 1489451436
@@ -97,9 +97,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Schedule a Campaign #
-# POST /campaigns/{campaign_id}/schedules #
+////////////////////////////////////////////////////
+// Schedule a Campaign #
+// POST /campaigns/{campaign_id}/schedules #
$request_body = json_decode('{
"send_at": 1489771528
@@ -110,9 +110,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# View Scheduled Time of a Campaign #
-# GET /campaigns/{campaign_id}/schedules #
+////////////////////////////////////////////////////
+// View Scheduled Time of a Campaign #
+// GET /campaigns/{campaign_id}/schedules #
$campaign_id = "test_url_param";
$response = $sg->client->campaigns()->_($campaign_id)->schedules()->get();
@@ -120,9 +120,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Unschedule a Scheduled Campaign #
-# DELETE /campaigns/{campaign_id}/schedules #
+////////////////////////////////////////////////////
+// Unschedule a Scheduled Campaign #
+// DELETE /campaigns/{campaign_id}/schedules #
$campaign_id = "test_url_param";
$response = $sg->client->campaigns()->_($campaign_id)->schedules()->delete($request_body);
@@ -130,9 +130,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Send a Campaign #
-# POST /campaigns/{campaign_id}/schedules/now #
+////////////////////////////////////////////////////
+// Send a Campaign #
+// POST /campaigns/{campaign_id}/schedules/now #
$request_body = json_decode('null');
$campaign_id = "test_url_param";
@@ -141,9 +141,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Send a Test Campaign #
-# POST /campaigns/{campaign_id}/schedules/test #
+////////////////////////////////////////////////////
+// Send a Test Campaign #
+// POST /campaigns/{campaign_id}/schedules/test #
$request_body = json_decode('{
"to": "your.email@example.com"
diff --git a/examples/categories/categories.php b/examples/categories/categories.php
index cf24a77..7fa9b1e 100644
--- a/examples/categories/categories.php
+++ b/examples/categories/categories.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Retrieve all categories #
-# GET /categories #
+////////////////////////////////////////////////////
+// Retrieve all categories #
+// GET /categories #
$query_params = json_decode('{"category": "test_string", "limit": 1, "offset": 1}');
$response = $sg->client->categories()->get(null, $query_params);
@@ -16,9 +16,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve Email Statistics for Categories #
-# GET /categories/stats #
+////////////////////////////////////////////////////
+// Retrieve Email Statistics for Categories #
+// GET /categories/stats #
$query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "categories": "test_string"}');
$response = $sg->client->categories()->stats()->get(null, $query_params);
@@ -26,9 +26,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve sums of email stats for each category [Needs: Stats object defined, has category ID?] #
-# GET /categories/stats/sums #
+////////////////////////////////////////////////////
+// Retrieve sums of email stats for each category [Needs: Stats object defined, has category ID?] #
+// GET /categories/stats/sums #
$query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "start_date": "2016-01-01", "sort_by_direction": "asc"}');
$response = $sg->client->categories()->stats()->sums()->get(null, $query_params);
diff --git a/examples/clients/clients.php b/examples/clients/clients.php
index 08c9cd2..ae09b7b 100644
--- a/examples/clients/clients.php
+++ b/examples/clients/clients.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Retrieve email statistics by client type. #
-# GET /clients/stats #
+////////////////////////////////////////////////////
+// Retrieve email statistics by client type. #
+// GET /clients/stats #
$query_params = json_decode('{"aggregated_by": "day", "start_date": "2016-01-01", "end_date": "2016-04-01"}');
$response = $sg->client->clients()->stats()->get(null, $query_params);
@@ -16,9 +16,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve stats by a specific client type. #
-# GET /clients/{client_type}/stats #
+////////////////////////////////////////////////////
+// Retrieve stats by a specific client type. #
+// GET /clients/{client_type}/stats #
$query_params = json_decode('{"aggregated_by": "day", "start_date": "2016-01-01", "end_date": "2016-04-01"}');
$client_type = "test_url_param";
diff --git a/examples/contactdb/contactdb.php b/examples/contactdb/contactdb.php
index 38652f9..4d0eb4a 100644
--- a/examples/contactdb/contactdb.php
+++ b/examples/contactdb/contactdb.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Create a Custom Field #
-# POST /contactdb/custom_fields #
+////////////////////////////////////////////////////
+// Create a Custom Field #
+// POST /contactdb/custom_fields #
$request_body = json_decode('{
"name": "pet",
@@ -19,18 +19,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all custom fields #
-# GET /contactdb/custom_fields #
+////////////////////////////////////////////////////
+// Retrieve all custom fields #
+// GET /contactdb/custom_fields #
$response = $sg->client->contactdb()->custom_fields()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a Custom Field #
-# GET /contactdb/custom_fields/{custom_field_id} #
+////////////////////////////////////////////////////
+// Retrieve a Custom Field #
+// GET /contactdb/custom_fields/{custom_field_id} #
$custom_field_id = "test_url_param";
$response = $sg->client->contactdb()->custom_fields()->_($custom_field_id)->get();
@@ -38,9 +38,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a Custom Field #
-# DELETE /contactdb/custom_fields/{custom_field_id} #
+////////////////////////////////////////////////////
+// Delete a Custom Field #
+// DELETE /contactdb/custom_fields/{custom_field_id} #
$custom_field_id = "test_url_param";
$response = $sg->client->contactdb()->custom_fields()->_($custom_field_id)->delete($request_body);
@@ -48,9 +48,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Create a List #
-# POST /contactdb/lists #
+////////////////////////////////////////////////////
+// Create a List #
+// POST /contactdb/lists #
$request_body = json_decode('{
"name": "your list name"
@@ -60,27 +60,27 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all lists #
-# GET /contactdb/lists #
+////////////////////////////////////////////////////
+// Retrieve all lists #
+// GET /contactdb/lists #
$response = $sg->client->contactdb()->lists()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete Multiple lists #
-# DELETE /contactdb/lists #
+////////////////////////////////////////////////////
+// Delete Multiple lists #
+// DELETE /contactdb/lists #
$response = $sg->client->contactdb()->lists()->delete($request_body);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update a List #
-# PATCH /contactdb/lists/{list_id} #
+////////////////////////////////////////////////////
+// Update a List #
+// PATCH /contactdb/lists/{list_id} #
$request_body = json_decode('{
"name": "newlistname"
@@ -92,9 +92,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a single list #
-# GET /contactdb/lists/{list_id} #
+////////////////////////////////////////////////////
+// Retrieve a single list #
+// GET /contactdb/lists/{list_id} #
$query_params = json_decode('{"list_id": 0}');
$list_id = "test_url_param";
@@ -103,9 +103,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a List #
-# DELETE /contactdb/lists/{list_id} #
+////////////////////////////////////////////////////
+// Delete a List #
+// DELETE /contactdb/lists/{list_id} #
$query_params = json_decode('{"delete_contacts": "true"}');
$list_id = "test_url_param";
@@ -114,9 +114,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Add Multiple Recipients to a List #
-# POST /contactdb/lists/{list_id}/recipients #
+////////////////////////////////////////////////////
+// Add Multiple Recipients to a List #
+// POST /contactdb/lists/{list_id}/recipients #
$request_body = json_decode('[
"recipient_id1",
@@ -128,9 +128,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all recipients on a List #
-# GET /contactdb/lists/{list_id}/recipients #
+////////////////////////////////////////////////////
+// Retrieve all recipients on a List #
+// GET /contactdb/lists/{list_id}/recipients #
$query_params = json_decode('{"page": 1, "page_size": 1, "list_id": 0}');
$list_id = "test_url_param";
@@ -139,33 +139,33 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Add a Single Recipient to a List #
-# POST /contactdb/lists/{list_id}/recipients/{recipient_id} #
+////////////////////////////////////////////////////
+// Add a Single Recipient to a List #
+// POST /contactdb/lists/{list_id}/recipients/{recipient_id} #
$request_body = json_decode('null');
$list_id = "test_url_param";
- $recipient_id = "test_url_param";
+$recipient_id = "test_url_param";
$response = $sg->client->contactdb()->lists()->_($list_id)->recipients()->_($recipient_id)->post($request_body);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a Single Recipient from a Single List #
-# DELETE /contactdb/lists/{list_id}/recipients/{recipient_id} #
+////////////////////////////////////////////////////
+// Delete a Single Recipient from a Single List #
+// DELETE /contactdb/lists/{list_id}/recipients/{recipient_id} #
$query_params = json_decode('{"recipient_id": 0, "list_id": 0}');
$list_id = "test_url_param";
- $recipient_id = "test_url_param";
+$recipient_id = "test_url_param";
$response = $sg->client->contactdb()->lists()->_($list_id)->recipients()->_($recipient_id)->delete($request_body, $query_params);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update Recipient #
-# PATCH /contactdb/recipients #
+////////////////////////////////////////////////////
+// Update Recipient #
+// PATCH /contactdb/recipients #
$request_body = json_decode('[
{
@@ -179,9 +179,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Add recipients #
-# POST /contactdb/recipients #
+////////////////////////////////////////////////////
+// Add recipients #
+// POST /contactdb/recipients #
$request_body = json_decode('[
{
@@ -202,9 +202,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve recipients #
-# GET /contactdb/recipients #
+////////////////////////////////////////////////////
+// Retrieve recipients #
+// GET /contactdb/recipients #
$query_params = json_decode('{"page": 1, "page_size": 1}');
$response = $sg->client->contactdb()->recipients()->get(null, $query_params);
@@ -212,36 +212,36 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete Recipient #
-# DELETE /contactdb/recipients #
+////////////////////////////////////////////////////
+// Delete Recipient #
+// DELETE /contactdb/recipients #
$response = $sg->client->contactdb()->recipients()->delete($request_body);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve the count of billable recipients #
-# GET /contactdb/recipients/billable_count #
+////////////////////////////////////////////////////
+// Retrieve the count of billable recipients #
+// GET /contactdb/recipients/billable_count #
$response = $sg->client->contactdb()->recipients()->billable_count()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a Count of Recipients #
-# GET /contactdb/recipients/count #
+////////////////////////////////////////////////////
+// Retrieve a Count of Recipients #
+// GET /contactdb/recipients/count #
$response = $sg->client->contactdb()->recipients()->count()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve recipients matching search criteria #
-# GET /contactdb/recipients/search #
+////////////////////////////////////////////////////
+// Retrieve recipients matching search criteria #
+// GET /contactdb/recipients/search #
$query_params = json_decode('{"{field_name}": "test_string"}');
$response = $sg->client->contactdb()->recipients()->search()->get(null, $query_params);
@@ -249,9 +249,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a single recipient #
-# GET /contactdb/recipients/{recipient_id} #
+////////////////////////////////////////////////////
+// Retrieve a single recipient #
+// GET /contactdb/recipients/{recipient_id} #
$recipient_id = "test_url_param";
$response = $sg->client->contactdb()->recipients()->_($recipient_id)->get();
@@ -259,9 +259,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a Recipient #
-# DELETE /contactdb/recipients/{recipient_id} #
+////////////////////////////////////////////////////
+// Delete a Recipient #
+// DELETE /contactdb/recipients/{recipient_id} #
$recipient_id = "test_url_param";
$response = $sg->client->contactdb()->recipients()->_($recipient_id)->delete($request_body);
@@ -269,9 +269,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve the lists that a recipient is on #
-# GET /contactdb/recipients/{recipient_id}/lists #
+////////////////////////////////////////////////////
+// Retrieve the lists that a recipient is on #
+// GET /contactdb/recipients/{recipient_id}/lists #
$recipient_id = "test_url_param";
$response = $sg->client->contactdb()->recipients()->_($recipient_id)->lists()->get();
@@ -279,18 +279,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve reserved fields #
-# GET /contactdb/reserved_fields #
+////////////////////////////////////////////////////
+// Retrieve reserved fields #
+// GET /contactdb/reserved_fields #
$response = $sg->client->contactdb()->reserved_fields()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Create a Segment #
-# POST /contactdb/segments #
+////////////////////////////////////////////////////
+// Create a Segment #
+// POST /contactdb/segments #
$request_body = json_decode('{
"conditions": [
@@ -321,18 +321,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all segments #
-# GET /contactdb/segments #
+////////////////////////////////////////////////////
+// Retrieve all segments #
+// GET /contactdb/segments #
$response = $sg->client->contactdb()->segments()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update a segment #
-# PATCH /contactdb/segments/{segment_id} #
+////////////////////////////////////////////////////
+// Update a segment #
+// PATCH /contactdb/segments/{segment_id} #
$request_body = json_decode('{
"conditions": [
@@ -353,9 +353,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a segment #
-# GET /contactdb/segments/{segment_id} #
+////////////////////////////////////////////////////
+// Retrieve a segment #
+// GET /contactdb/segments/{segment_id} #
$query_params = json_decode('{"segment_id": 0}');
$segment_id = "test_url_param";
@@ -364,9 +364,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a segment #
-# DELETE /contactdb/segments/{segment_id} #
+////////////////////////////////////////////////////
+// Delete a segment #
+// DELETE /contactdb/segments/{segment_id} #
$query_params = json_decode('{"delete_contacts": "true"}');
$segment_id = "test_url_param";
@@ -375,9 +375,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve recipients on a segment #
-# GET /contactdb/segments/{segment_id}/recipients #
+////////////////////////////////////////////////////
+// Retrieve recipients on a segment #
+// GET /contactdb/segments/{segment_id}/recipients #
$query_params = json_decode('{"page": 1, "page_size": 1}');
$segment_id = "test_url_param";
diff --git a/examples/devices/devices.php b/examples/devices/devices.php
index 6d474eb..308684f 100644
--- a/examples/devices/devices.php
+++ b/examples/devices/devices.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Retrieve email statistics by device type. #
-# GET /devices/stats #
+////////////////////////////////////////////////////
+// Retrieve email statistics by device type. #
+// GET /devices/stats #
$query_params = json_decode('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}');
$response = $sg->client->devices()->stats()->get(null, $query_params);
diff --git a/examples/geo/geo.php b/examples/geo/geo.php
index 67b9c2c..ab4c470 100644
--- a/examples/geo/geo.php
+++ b/examples/geo/geo.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Retrieve email statistics by country and state/province. #
-# GET /geo/stats #
+////////////////////////////////////////////////////
+// Retrieve email statistics by country and state/province. #
+// GET /geo/stats #
$query_params = json_decode('{"end_date": "2016-04-01", "country": "US", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01"}');
$response = $sg->client->geo()->stats()->get(null, $query_params);
diff --git a/examples/ips/ips.php b/examples/ips/ips.php
index d35efb9..19957d8 100644
--- a/examples/ips/ips.php
+++ b/examples/ips/ips.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Retrieve all IP addresses #
-# GET /ips #
+////////////////////////////////////////////////////
+// Retrieve all IP addresses #
+// GET /ips #
$query_params = json_decode('{"subuser": "test_string", "ip": "test_string", "limit": 1, "exclude_whitelabels": "true", "offset": 1}');
$response = $sg->client->ips()->get(null, $query_params);
@@ -16,18 +16,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all assigned IPs #
-# GET /ips/assigned #
+////////////////////////////////////////////////////
+// Retrieve all assigned IPs #
+// GET /ips/assigned #
$response = $sg->client->ips()->assigned()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Create an IP pool. #
-# POST /ips/pools #
+////////////////////////////////////////////////////
+// Create an IP pool. #
+// POST /ips/pools #
$request_body = json_decode('{
"name": "marketing"
@@ -37,18 +37,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all IP pools. #
-# GET /ips/pools #
+////////////////////////////////////////////////////
+// Retrieve all IP pools. #
+// GET /ips/pools #
$response = $sg->client->ips()->pools()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update an IP pools name. #
-# PUT /ips/pools/{pool_name} #
+////////////////////////////////////////////////////
+// Update an IP pools name. #
+// PUT /ips/pools/{pool_name} #
$request_body = json_decode('{
"name": "new_pool_name"
@@ -59,9 +59,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all IPs in a specified pool. #
-# GET /ips/pools/{pool_name} #
+////////////////////////////////////////////////////
+// Retrieve all IPs in a specified pool. #
+// GET /ips/pools/{pool_name} #
$pool_name = "test_url_param";
$response = $sg->client->ips()->pools()->_($pool_name)->get();
@@ -69,9 +69,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete an IP pool. #
-# DELETE /ips/pools/{pool_name} #
+////////////////////////////////////////////////////
+// Delete an IP pool. #
+// DELETE /ips/pools/{pool_name} #
$pool_name = "test_url_param";
$response = $sg->client->ips()->pools()->_($pool_name)->delete($request_body);
@@ -79,9 +79,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Add an IP address to a pool #
-# POST /ips/pools/{pool_name}/ips #
+////////////////////////////////////////////////////
+// Add an IP address to a pool #
+// POST /ips/pools/{pool_name}/ips #
$request_body = json_decode('{
"ip": "0.0.0.0"
@@ -92,20 +92,20 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Remove an IP address from a pool. #
-# DELETE /ips/pools/{pool_name}/ips/{ip} #
+////////////////////////////////////////////////////
+// Remove an IP address from a pool. #
+// DELETE /ips/pools/{pool_name}/ips/{ip} #
$pool_name = "test_url_param";
- $ip = "test_url_param";
+$ip = "test_url_param";
$response = $sg->client->ips()->pools()->_($pool_name)->ips()->_($ip)->delete($request_body);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Add an IP to warmup #
-# POST /ips/warmup #
+////////////////////////////////////////////////////
+// Add an IP to warmup #
+// POST /ips/warmup #
$request_body = json_decode('{
"ip": "0.0.0.0"
@@ -115,18 +115,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all IPs currently in warmup #
-# GET /ips/warmup #
+////////////////////////////////////////////////////
+// Retrieve all IPs currently in warmup #
+// GET /ips/warmup #
$response = $sg->client->ips()->warmup()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve warmup status for a specific IP address #
-# GET /ips/warmup/{ip_address} #
+////////////////////////////////////////////////////
+// Retrieve warmup status for a specific IP address #
+// GET /ips/warmup/{ip_address} #
$ip_address = "test_url_param";
$response = $sg->client->ips()->warmup()->_($ip_address)->get();
@@ -134,9 +134,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Remove an IP from warmup #
-# DELETE /ips/warmup/{ip_address} #
+////////////////////////////////////////////////////
+// Remove an IP from warmup #
+// DELETE /ips/warmup/{ip_address} #
$ip_address = "test_url_param";
$response = $sg->client->ips()->warmup()->_($ip_address)->delete($request_body);
@@ -144,9 +144,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all IP pools an IP address belongs to #
-# GET /ips/{ip_address} #
+////////////////////////////////////////////////////
+// Retrieve all IP pools an IP address belongs to #
+// GET /ips/{ip_address} #
$ip_address = "test_url_param";
$response = $sg->client->ips()->_($ip_address)->get();
diff --git a/examples/mail/mail.php b/examples/mail/mail.php
index 7bb7d4e..ea57555 100644
--- a/examples/mail/mail.php
+++ b/examples/mail/mail.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Create a batch ID #
-# POST /mail/batch #
+////////////////////////////////////////////////////
+// Create a batch ID #
+// POST /mail/batch #
$request_body = json_decode('null');
$response = $sg->client->mail()->batch()->post($request_body);
@@ -16,9 +16,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Validate batch ID #
-# GET /mail/batch/{batch_id} #
+////////////////////////////////////////////////////
+// Validate batch ID #
+// GET /mail/batch/{batch_id} #
$batch_id = "test_url_param";
$response = $sg->client->mail()->batch()->_($batch_id)->get();
@@ -26,9 +26,10 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# v3 Mail Send Beta #
-# POST /mail/send/beta #
+////////////////////////////////////////////////////
+// v3 Mail Send Beta #
+// POST /mail/send/beta #
+// This endpoint has a helper, check it out [here](https://github.com/sendgrid/sendgrid-php/blob/v3beta/lib/helpers/mail/README.md).
$request_body = json_decode('{
"asm": {
diff --git a/examples/mailboxproviders/mailboxproviders.php b/examples/mailboxproviders/mailboxproviders.php
index 8c2fe59..5b1f3cc 100644
--- a/examples/mailboxproviders/mailboxproviders.php
+++ b/examples/mailboxproviders/mailboxproviders.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Retrieve email statistics by mailbox provider. #
-# GET /mailbox_providers/stats #
+////////////////////////////////////////////////////
+// Retrieve email statistics by mailbox provider. #
+// GET /mailbox_providers/stats #
$query_params = json_decode('{"end_date": "2016-04-01", "mailbox_providers": "test_string", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01"}');
$response = $sg->client->mailbox_providers()->stats()->get(null, $query_params);
diff --git a/examples/mailsettings/mailsettings.php b/examples/mailsettings/mailsettings.php
index 6660866..3e9f75b 100644
--- a/examples/mailsettings/mailsettings.php
+++ b/examples/mailsettings/mailsettings.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Retrieve all mail settings #
-# GET /mail_settings #
+////////////////////////////////////////////////////
+// Retrieve all mail settings #
+// GET /mail_settings #
$query_params = json_decode('{"limit": 1, "offset": 1}');
$response = $sg->client->mail_settings()->get(null, $query_params);
@@ -16,9 +16,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update address whitelist mail settings #
-# PATCH /mail_settings/address_whitelist #
+////////////////////////////////////////////////////
+// Update address whitelist mail settings #
+// PATCH /mail_settings/address_whitelist #
$request_body = json_decode('{
"enabled": true,
@@ -32,18 +32,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve address whitelist mail settings #
-# GET /mail_settings/address_whitelist #
+////////////////////////////////////////////////////
+// Retrieve address whitelist mail settings #
+// GET /mail_settings/address_whitelist #
$response = $sg->client->mail_settings()->address_whitelist()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update BCC mail settings #
-# PATCH /mail_settings/bcc #
+////////////////////////////////////////////////////
+// Update BCC mail settings #
+// PATCH /mail_settings/bcc #
$request_body = json_decode('{
"email": "email@example.com",
@@ -54,18 +54,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all BCC mail settings #
-# GET /mail_settings/bcc #
+////////////////////////////////////////////////////
+// Retrieve all BCC mail settings #
+// GET /mail_settings/bcc #
$response = $sg->client->mail_settings()->bcc()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update bounce purge mail settings #
-# PATCH /mail_settings/bounce_purge #
+////////////////////////////////////////////////////
+// Update bounce purge mail settings #
+// PATCH /mail_settings/bounce_purge #
$request_body = json_decode('{
"enabled": true,
@@ -77,18 +77,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve bounce purge mail settings #
-# GET /mail_settings/bounce_purge #
+////////////////////////////////////////////////////
+// Retrieve bounce purge mail settings #
+// GET /mail_settings/bounce_purge #
$response = $sg->client->mail_settings()->bounce_purge()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update footer mail settings #
-# PATCH /mail_settings/footer #
+////////////////////////////////////////////////////
+// Update footer mail settings #
+// PATCH /mail_settings/footer #
$request_body = json_decode('{
"enabled": true,
@@ -100,18 +100,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve footer mail settings #
-# GET /mail_settings/footer #
+////////////////////////////////////////////////////
+// Retrieve footer mail settings #
+// GET /mail_settings/footer #
$response = $sg->client->mail_settings()->footer()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update forward bounce mail settings #
-# PATCH /mail_settings/forward_bounce #
+////////////////////////////////////////////////////
+// Update forward bounce mail settings #
+// PATCH /mail_settings/forward_bounce #
$request_body = json_decode('{
"email": "example@example.com",
@@ -122,18 +122,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve forward bounce mail settings #
-# GET /mail_settings/forward_bounce #
+////////////////////////////////////////////////////
+// Retrieve forward bounce mail settings #
+// GET /mail_settings/forward_bounce #
$response = $sg->client->mail_settings()->forward_bounce()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update forward spam mail settings #
-# PATCH /mail_settings/forward_spam #
+////////////////////////////////////////////////////
+// Update forward spam mail settings #
+// PATCH /mail_settings/forward_spam #
$request_body = json_decode('{
"email": "",
@@ -144,18 +144,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve forward spam mail settings #
-# GET /mail_settings/forward_spam #
+////////////////////////////////////////////////////
+// Retrieve forward spam mail settings #
+// GET /mail_settings/forward_spam #
$response = $sg->client->mail_settings()->forward_spam()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update plain content mail settings #
-# PATCH /mail_settings/plain_content #
+////////////////////////////////////////////////////
+// Update plain content mail settings #
+// PATCH /mail_settings/plain_content #
$request_body = json_decode('{
"enabled": false
@@ -165,18 +165,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve plain content mail settings #
-# GET /mail_settings/plain_content #
+////////////////////////////////////////////////////
+// Retrieve plain content mail settings #
+// GET /mail_settings/plain_content #
$response = $sg->client->mail_settings()->plain_content()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update spam check mail settings #
-# PATCH /mail_settings/spam_check #
+////////////////////////////////////////////////////
+// Update spam check mail settings #
+// PATCH /mail_settings/spam_check #
$request_body = json_decode('{
"enabled": true,
@@ -188,18 +188,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve spam check mail settings #
-# GET /mail_settings/spam_check #
+////////////////////////////////////////////////////
+// Retrieve spam check mail settings #
+// GET /mail_settings/spam_check #
$response = $sg->client->mail_settings()->spam_check()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update template mail settings #
-# PATCH /mail_settings/template #
+////////////////////////////////////////////////////
+// Update template mail settings #
+// PATCH /mail_settings/template #
$request_body = json_decode('{
"enabled": true,
@@ -210,9 +210,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve legacy template mail settings #
-# GET /mail_settings/template #
+////////////////////////////////////////////////////
+// Retrieve legacy template mail settings #
+// GET /mail_settings/template #
$response = $sg->client->mail_settings()->template()->get();
echo $response->statusCode();
diff --git a/examples/partnersettings/partnersettings.php b/examples/partnersettings/partnersettings.php
index cb46fea..79a652e 100644
--- a/examples/partnersettings/partnersettings.php
+++ b/examples/partnersettings/partnersettings.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Returns a list of all partner settings. #
-# GET /partner_settings #
+////////////////////////////////////////////////////
+// Returns a list of all partner settings. #
+// GET /partner_settings #
$query_params = json_decode('{"limit": 1, "offset": 1}');
$response = $sg->client->partner_settings()->get(null, $query_params);
@@ -16,9 +16,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Updates New Relic partner settings. #
-# PATCH /partner_settings/new_relic #
+////////////////////////////////////////////////////
+// Updates New Relic partner settings. #
+// PATCH /partner_settings/new_relic #
$request_body = json_decode('{
"enable_subuser_statistics": true,
@@ -30,9 +30,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Returns all New Relic partner settings. #
-# GET /partner_settings/new_relic #
+////////////////////////////////////////////////////
+// Returns all New Relic partner settings. #
+// GET /partner_settings/new_relic #
$response = $sg->client->partner_settings()->new_relic()->get();
echo $response->statusCode();
diff --git a/examples/scopes/scopes.php b/examples/scopes/scopes.php
index 3f8f9d5..ff2c066 100644
--- a/examples/scopes/scopes.php
+++ b/examples/scopes/scopes.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Retrieve a list of scopes for which this user has access. #
-# GET /scopes #
+////////////////////////////////////////////////////
+// Retrieve a list of scopes for which this user has access. #
+// GET /scopes #
$response = $sg->client->scopes()->get();
echo $response->statusCode();
diff --git a/examples/stats/stats.php b/examples/stats/stats.php
index 5e146d8..a5bbf60 100644
--- a/examples/stats/stats.php
+++ b/examples/stats/stats.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Retrieve global email statistics #
-# GET /stats #
+////////////////////////////////////////////////////
+// Retrieve global email statistics #
+// GET /stats #
$query_params = json_decode('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}');
$response = $sg->client->stats()->get(null, $query_params);
diff --git a/examples/subusers/subusers.php b/examples/subusers/subusers.php
index dd9de73..6ef2090 100644
--- a/examples/subusers/subusers.php
+++ b/examples/subusers/subusers.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Create Subuser #
-# POST /subusers #
+////////////////////////////////////////////////////
+// Create Subuser #
+// POST /subusers #
$request_body = json_decode('{
"email": "John@example.com",
@@ -24,9 +24,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# List all Subusers #
-# GET /subusers #
+////////////////////////////////////////////////////
+// List all Subusers #
+// GET /subusers #
$query_params = json_decode('{"username": "test_string", "limit": 0, "offset": 0}');
$response = $sg->client->subusers()->get(null, $query_params);
@@ -34,9 +34,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve Subuser Reputations #
-# GET /subusers/reputations #
+////////////////////////////////////////////////////
+// Retrieve Subuser Reputations #
+// GET /subusers/reputations #
$query_params = json_decode('{"usernames": "test_string"}');
$response = $sg->client->subusers()->reputations()->get(null, $query_params);
@@ -44,9 +44,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve email statistics for your subusers. #
-# GET /subusers/stats #
+////////////////////////////////////////////////////
+// Retrieve email statistics for your subusers. #
+// GET /subusers/stats #
$query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "subusers": "test_string"}');
$response = $sg->client->subusers()->stats()->get(null, $query_params);
@@ -54,9 +54,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve monthly stats for all subusers #
-# GET /subusers/stats/monthly #
+////////////////////////////////////////////////////
+// Retrieve monthly stats for all subusers #
+// GET /subusers/stats/monthly #
$query_params = json_decode('{"subuser": "test_string", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "date": "test_string", "sort_by_direction": "asc"}');
$response = $sg->client->subusers()->stats()->monthly()->get(null, $query_params);
@@ -64,9 +64,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve the totals for each email statistic metric for all subusers. #
-# GET /subusers/stats/sums #
+////////////////////////////////////////////////////
+// Retrieve the totals for each email statistic metric for all subusers. #
+// GET /subusers/stats/sums #
$query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "start_date": "2016-01-01", "sort_by_direction": "asc"}');
$response = $sg->client->subusers()->stats()->sums()->get(null, $query_params);
@@ -74,9 +74,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Enable/disable a subuser #
-# PATCH /subusers/{subuser_name} #
+////////////////////////////////////////////////////
+// Enable/disable a subuser #
+// PATCH /subusers/{subuser_name} #
$request_body = json_decode('{
"disabled": false
@@ -87,9 +87,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a subuser #
-# DELETE /subusers/{subuser_name} #
+////////////////////////////////////////////////////
+// Delete a subuser #
+// DELETE /subusers/{subuser_name} #
$subuser_name = "test_url_param";
$response = $sg->client->subusers()->_($subuser_name)->delete($request_body);
@@ -97,9 +97,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update IPs assigned to a subuser #
-# PUT /subusers/{subuser_name}/ips #
+////////////////////////////////////////////////////
+// Update IPs assigned to a subuser #
+// PUT /subusers/{subuser_name}/ips #
$request_body = json_decode('[
"127.0.0.1"
@@ -110,9 +110,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update Monitor Settings for a subuser #
-# PUT /subusers/{subuser_name}/monitor #
+////////////////////////////////////////////////////
+// Update Monitor Settings for a subuser #
+// PUT /subusers/{subuser_name}/monitor #
$request_body = json_decode('{
"email": "example@example.com",
@@ -124,9 +124,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Create monitor settings #
-# POST /subusers/{subuser_name}/monitor #
+////////////////////////////////////////////////////
+// Create monitor settings #
+// POST /subusers/{subuser_name}/monitor #
$request_body = json_decode('{
"email": "example@example.com",
@@ -138,9 +138,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve monitor settings for a subuser #
-# GET /subusers/{subuser_name}/monitor #
+////////////////////////////////////////////////////
+// Retrieve monitor settings for a subuser #
+// GET /subusers/{subuser_name}/monitor #
$subuser_name = "test_url_param";
$response = $sg->client->subusers()->_($subuser_name)->monitor()->get();
@@ -148,9 +148,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete monitor settings #
-# DELETE /subusers/{subuser_name}/monitor #
+////////////////////////////////////////////////////
+// Delete monitor settings #
+// DELETE /subusers/{subuser_name}/monitor #
$subuser_name = "test_url_param";
$response = $sg->client->subusers()->_($subuser_name)->monitor()->delete($request_body);
@@ -158,9 +158,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve the monthly email statistics for a single subuser #
-# GET /subusers/{subuser_name}/stats/monthly #
+////////////////////////////////////////////////////
+// Retrieve the monthly email statistics for a single subuser #
+// GET /subusers/{subuser_name}/stats/monthly #
$query_params = json_decode('{"date": "test_string", "sort_by_direction": "asc", "limit": 0, "sort_by_metric": "test_string", "offset": 1}');
$subuser_name = "test_url_param";
diff --git a/examples/suppression/suppression.php b/examples/suppression/suppression.php
index 1685826..16d1a38 100644
--- a/examples/suppression/suppression.php
+++ b/examples/suppression/suppression.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Retrieve all blocks #
-# GET /suppression/blocks #
+////////////////////////////////////////////////////
+// Retrieve all blocks #
+// GET /suppression/blocks #
$query_params = json_decode('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}');
$response = $sg->client->suppression()->blocks()->get(null, $query_params);
@@ -16,18 +16,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete blocks #
-# DELETE /suppression/blocks #
+////////////////////////////////////////////////////
+// Delete blocks #
+// DELETE /suppression/blocks #
$response = $sg->client->suppression()->blocks()->delete($request_body);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a specific block #
-# GET /suppression/blocks/{email} #
+////////////////////////////////////////////////////
+// Retrieve a specific block #
+// GET /suppression/blocks/{email} #
$email = "test_url_param";
$response = $sg->client->suppression()->blocks()->_($email)->get();
@@ -35,9 +35,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a specific block #
-# DELETE /suppression/blocks/{email} #
+////////////////////////////////////////////////////
+// Delete a specific block #
+// DELETE /suppression/blocks/{email} #
$email = "test_url_param";
$response = $sg->client->suppression()->blocks()->_($email)->delete($request_body);
@@ -45,9 +45,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all bounces #
-# GET /suppression/bounces #
+////////////////////////////////////////////////////
+// Retrieve all bounces #
+// GET /suppression/bounces #
$query_params = json_decode('{"start_time": 0, "end_time": 0}');
$response = $sg->client->suppression()->bounces()->get(null, $query_params);
@@ -55,18 +55,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete bounces #
-# DELETE /suppression/bounces #
+////////////////////////////////////////////////////
+// Delete bounces #
+// DELETE /suppression/bounces #
$response = $sg->client->suppression()->bounces()->delete($request_body);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a Bounce #
-# GET /suppression/bounces/{email} #
+////////////////////////////////////////////////////
+// Retrieve a Bounce #
+// GET /suppression/bounces/{email} #
$email = "test_url_param";
$response = $sg->client->suppression()->bounces()->_($email)->get();
@@ -74,9 +74,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a bounce #
-# DELETE /suppression/bounces/{email} #
+////////////////////////////////////////////////////
+// Delete a bounce #
+// DELETE /suppression/bounces/{email} #
$query_params = json_decode('{"email_address": "example@example.com"}');
$email = "test_url_param";
@@ -85,9 +85,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all invalid emails #
-# GET /suppression/invalid_emails #
+////////////////////////////////////////////////////
+// Retrieve all invalid emails #
+// GET /suppression/invalid_emails #
$query_params = json_decode('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}');
$response = $sg->client->suppression()->invalid_emails()->get(null, $query_params);
@@ -95,18 +95,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete invalid emails #
-# DELETE /suppression/invalid_emails #
+////////////////////////////////////////////////////
+// Delete invalid emails #
+// DELETE /suppression/invalid_emails #
$response = $sg->client->suppression()->invalid_emails()->delete($request_body);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a specific invalid email #
-# GET /suppression/invalid_emails/{email} #
+////////////////////////////////////////////////////
+// Retrieve a specific invalid email #
+// GET /suppression/invalid_emails/{email} #
$email = "test_url_param";
$response = $sg->client->suppression()->invalid_emails()->_($email)->get();
@@ -114,9 +114,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a specific invalid email #
-# DELETE /suppression/invalid_emails/{email} #
+////////////////////////////////////////////////////
+// Delete a specific invalid email #
+// DELETE /suppression/invalid_emails/{email} #
$email = "test_url_param";
$response = $sg->client->suppression()->invalid_emails()->_($email)->delete($request_body);
@@ -124,9 +124,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a specific spam report #
-# GET /suppression/spam_report/{email} #
+////////////////////////////////////////////////////
+// Retrieve a specific spam report #
+// GET /suppression/spam_report/{email} #
$email = "test_url_param";
$response = $sg->client->suppression()->spam_report()->_($email)->get();
@@ -134,9 +134,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a specific spam report #
-# DELETE /suppression/spam_report/{email} #
+////////////////////////////////////////////////////
+// Delete a specific spam report #
+// DELETE /suppression/spam_report/{email} #
$email = "test_url_param";
$response = $sg->client->suppression()->spam_report()->_($email)->delete($request_body);
@@ -144,9 +144,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all spam reports #
-# GET /suppression/spam_reports #
+////////////////////////////////////////////////////
+// Retrieve all spam reports #
+// GET /suppression/spam_reports #
$query_params = json_decode('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}');
$response = $sg->client->suppression()->spam_reports()->get(null, $query_params);
@@ -154,18 +154,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete spam reports #
-# DELETE /suppression/spam_reports #
+////////////////////////////////////////////////////
+// Delete spam reports #
+// DELETE /suppression/spam_reports #
$response = $sg->client->suppression()->spam_reports()->delete($request_body);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all global suppressions #
-# GET /suppression/unsubscribes #
+////////////////////////////////////////////////////
+// Retrieve all global suppressions #
+// GET /suppression/unsubscribes #
$query_params = json_decode('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}');
$response = $sg->client->suppression()->unsubscribes()->get(null, $query_params);
diff --git a/examples/templates/templates.php b/examples/templates/templates.php
index 93b9051..4a6e366 100644
--- a/examples/templates/templates.php
+++ b/examples/templates/templates.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Create a transactional template. #
-# POST /templates #
+////////////////////////////////////////////////////
+// Create a transactional template. #
+// POST /templates #
$request_body = json_decode('{
"name": "example_name"
@@ -18,18 +18,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all transactional templates. #
-# GET /templates #
+////////////////////////////////////////////////////
+// Retrieve all transactional templates. #
+// GET /templates #
$response = $sg->client->templates()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Edit a transactional template. #
-# PATCH /templates/{template_id} #
+////////////////////////////////////////////////////
+// Edit a transactional template. #
+// PATCH /templates/{template_id} #
$request_body = json_decode('{
"name": "new_example_name"
@@ -40,9 +40,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a single transactional template. #
-# GET /templates/{template_id} #
+////////////////////////////////////////////////////
+// Retrieve a single transactional template. #
+// GET /templates/{template_id} #
$template_id = "test_url_param";
$response = $sg->client->templates()->_($template_id)->get();
@@ -50,9 +50,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a template. #
-# DELETE /templates/{template_id} #
+////////////////////////////////////////////////////
+// Delete a template. #
+// DELETE /templates/{template_id} #
$template_id = "test_url_param";
$response = $sg->client->templates()->_($template_id)->delete($request_body);
@@ -60,9 +60,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Create a new transactional template version. #
-# POST /templates/{template_id}/versions #
+////////////////////////////////////////////////////
+// Create a new transactional template version. #
+// POST /templates/{template_id}/versions #
$request_body = json_decode('{
"active": 1,
@@ -78,9 +78,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Edit a transactional template version. #
-# PATCH /templates/{template_id}/versions/{version_id} #
+////////////////////////////////////////////////////
+// Edit a transactional template version. #
+// PATCH /templates/{template_id}/versions/{version_id} #
$request_body = json_decode('{
"active": 1,
@@ -90,41 +90,41 @@ $request_body = json_decode('{
"subject": "<%subject%>"
}');
$template_id = "test_url_param";
- $version_id = "test_url_param";
+$version_id = "test_url_param";
$response = $sg->client->templates()->_($template_id)->versions()->_($version_id)->patch($request_body);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a specific transactional template version. #
-# GET /templates/{template_id}/versions/{version_id} #
+////////////////////////////////////////////////////
+// Retrieve a specific transactional template version. #
+// GET /templates/{template_id}/versions/{version_id} #
$template_id = "test_url_param";
- $version_id = "test_url_param";
+$version_id = "test_url_param";
$response = $sg->client->templates()->_($template_id)->versions()->_($version_id)->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a transactional template version. #
-# DELETE /templates/{template_id}/versions/{version_id} #
+////////////////////////////////////////////////////
+// Delete a transactional template version. #
+// DELETE /templates/{template_id}/versions/{version_id} #
$template_id = "test_url_param";
- $version_id = "test_url_param";
+$version_id = "test_url_param";
$response = $sg->client->templates()->_($template_id)->versions()->_($version_id)->delete($request_body);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Activate a transactional template version. #
-# POST /templates/{template_id}/versions/{version_id}/activate #
+////////////////////////////////////////////////////
+// Activate a transactional template version. #
+// POST /templates/{template_id}/versions/{version_id}/activate #
$request_body = json_decode('null');
$template_id = "test_url_param";
- $version_id = "test_url_param";
+$version_id = "test_url_param";
$response = $sg->client->templates()->_($template_id)->versions()->_($version_id)->activate()->post($request_body);
echo $response->statusCode();
echo $response->body();
diff --git a/examples/trackingsettings/trackingsettings.php b/examples/trackingsettings/trackingsettings.php
index 8e9fd55..f6e5605 100644
--- a/examples/trackingsettings/trackingsettings.php
+++ b/examples/trackingsettings/trackingsettings.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Retrieve Tracking Settings #
-# GET /tracking_settings #
+////////////////////////////////////////////////////
+// Retrieve Tracking Settings #
+// GET /tracking_settings #
$query_params = json_decode('{"limit": 1, "offset": 1}');
$response = $sg->client->tracking_settings()->get(null, $query_params);
@@ -16,9 +16,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update Click Tracking Settings #
-# PATCH /tracking_settings/click #
+////////////////////////////////////////////////////
+// Update Click Tracking Settings #
+// PATCH /tracking_settings/click #
$request_body = json_decode('{
"enabled": true
@@ -28,18 +28,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve Click Track Settings #
-# GET /tracking_settings/click #
+////////////////////////////////////////////////////
+// Retrieve Click Track Settings #
+// GET /tracking_settings/click #
$response = $sg->client->tracking_settings()->click()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update Google Analytics Settings #
-# PATCH /tracking_settings/google_analytics #
+////////////////////////////////////////////////////
+// Update Google Analytics Settings #
+// PATCH /tracking_settings/google_analytics #
$request_body = json_decode('{
"enabled": true,
@@ -54,18 +54,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve Google Analytics Settings #
-# GET /tracking_settings/google_analytics #
+////////////////////////////////////////////////////
+// Retrieve Google Analytics Settings #
+// GET /tracking_settings/google_analytics #
$response = $sg->client->tracking_settings()->google_analytics()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update Open Tracking Settings #
-# PATCH /tracking_settings/open #
+////////////////////////////////////////////////////
+// Update Open Tracking Settings #
+// PATCH /tracking_settings/open #
$request_body = json_decode('{
"enabled": true
@@ -75,18 +75,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Get Open Tracking Settings #
-# GET /tracking_settings/open #
+////////////////////////////////////////////////////
+// Get Open Tracking Settings #
+// GET /tracking_settings/open #
$response = $sg->client->tracking_settings()->open()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update Subscription Tracking Settings #
-# PATCH /tracking_settings/subscription #
+////////////////////////////////////////////////////
+// Update Subscription Tracking Settings #
+// PATCH /tracking_settings/subscription #
$request_body = json_decode('{
"enabled": true,
@@ -101,9 +101,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve Subscription Tracking Settings #
-# GET /tracking_settings/subscription #
+////////////////////////////////////////////////////
+// Retrieve Subscription Tracking Settings #
+// GET /tracking_settings/subscription #
$response = $sg->client->tracking_settings()->subscription()->get();
echo $response->statusCode();
diff --git a/examples/user/user.php b/examples/user/user.php
index 82c4dac..a043fef 100644
--- a/examples/user/user.php
+++ b/examples/user/user.php
@@ -6,27 +6,27 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Get a user's account information. #
-# GET /user/account #
+////////////////////////////////////////////////////
+// Get a user's account information. #
+// GET /user/account #
$response = $sg->client->user()->account()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve your credit balance #
-# GET /user/credits #
+////////////////////////////////////////////////////
+// Retrieve your credit balance #
+// GET /user/credits #
$response = $sg->client->user()->credits()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update your account email address #
-# PUT /user/email #
+////////////////////////////////////////////////////
+// Update your account email address #
+// PUT /user/email #
$request_body = json_decode('{
"email": "example@example.com"
@@ -36,18 +36,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve your account email address #
-# GET /user/email #
+////////////////////////////////////////////////////
+// Retrieve your account email address #
+// GET /user/email #
$response = $sg->client->user()->email()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update your password #
-# PUT /user/password #
+////////////////////////////////////////////////////
+// Update your password #
+// PUT /user/password #
$request_body = json_decode('{
"new_password": "new_password",
@@ -58,9 +58,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update a user's profile #
-# PATCH /user/profile #
+////////////////////////////////////////////////////
+// Update a user's profile #
+// PATCH /user/profile #
$request_body = json_decode('{
"city": "Orange",
@@ -72,18 +72,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Get a user's profile #
-# GET /user/profile #
+////////////////////////////////////////////////////
+// Get a user's profile #
+// GET /user/profile #
$response = $sg->client->user()->profile()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Cancel or pause a scheduled send #
-# POST /user/scheduled_sends #
+////////////////////////////////////////////////////
+// Cancel or pause a scheduled send #
+// POST /user/scheduled_sends #
$request_body = json_decode('{
"batch_id": "YOUR_BATCH_ID",
@@ -94,18 +94,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all scheduled sends #
-# GET /user/scheduled_sends #
+////////////////////////////////////////////////////
+// Retrieve all scheduled sends #
+// GET /user/scheduled_sends #
$response = $sg->client->user()->scheduled_sends()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update user scheduled send information #
-# PATCH /user/scheduled_sends/{batch_id} #
+////////////////////////////////////////////////////
+// Update user scheduled send information #
+// PATCH /user/scheduled_sends/{batch_id} #
$request_body = json_decode('{
"status": "pause"
@@ -116,9 +116,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve scheduled send #
-# GET /user/scheduled_sends/{batch_id} #
+////////////////////////////////////////////////////
+// Retrieve scheduled send #
+// GET /user/scheduled_sends/{batch_id} #
$batch_id = "test_url_param";
$response = $sg->client->user()->scheduled_sends()->_($batch_id)->get();
@@ -126,9 +126,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a cancellation or pause of a scheduled send #
-# DELETE /user/scheduled_sends/{batch_id} #
+////////////////////////////////////////////////////
+// Delete a cancellation or pause of a scheduled send #
+// DELETE /user/scheduled_sends/{batch_id} #
$batch_id = "test_url_param";
$response = $sg->client->user()->scheduled_sends()->_($batch_id)->delete($request_body);
@@ -136,9 +136,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update Enforced TLS settings #
-# PATCH /user/settings/enforced_tls #
+////////////////////////////////////////////////////
+// Update Enforced TLS settings #
+// PATCH /user/settings/enforced_tls #
$request_body = json_decode('{
"require_tls": true,
@@ -149,18 +149,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve current Enforced TLS settings. #
-# GET /user/settings/enforced_tls #
+////////////////////////////////////////////////////
+// Retrieve current Enforced TLS settings. #
+// GET /user/settings/enforced_tls #
$response = $sg->client->user()->settings()->enforced_tls()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update your username #
-# PUT /user/username #
+////////////////////////////////////////////////////
+// Update your username #
+// PUT /user/username #
$request_body = json_decode('{
"username": "test_username"
@@ -170,18 +170,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve your username #
-# GET /user/username #
+////////////////////////////////////////////////////
+// Retrieve your username #
+// GET /user/username #
$response = $sg->client->user()->username()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update Event Notification Settings #
-# PATCH /user/webhooks/event/settings #
+////////////////////////////////////////////////////
+// Update Event Notification Settings #
+// PATCH /user/webhooks/event/settings #
$request_body = json_decode('{
"bounce": true,
@@ -203,18 +203,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve Event Webhook settings #
-# GET /user/webhooks/event/settings #
+////////////////////////////////////////////////////
+// Retrieve Event Webhook settings #
+// GET /user/webhooks/event/settings #
$response = $sg->client->user()->webhooks()->event()->settings()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Test Event Notification Settings #
-# POST /user/webhooks/event/test #
+////////////////////////////////////////////////////
+// Test Event Notification Settings #
+// POST /user/webhooks/event/test #
$request_body = json_decode('{
"url": "url"
@@ -224,18 +224,18 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve Parse Webhook settings #
-# GET /user/webhooks/parse/settings #
+////////////////////////////////////////////////////
+// Retrieve Parse Webhook settings #
+// GET /user/webhooks/parse/settings #
$response = $sg->client->user()->webhooks()->parse()->settings()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieves Inbound Parse Webhook statistics. #
-# GET /user/webhooks/parse/stats #
+////////////////////////////////////////////////////
+// Retrieves Inbound Parse Webhook statistics. #
+// GET /user/webhooks/parse/stats #
$query_params = json_decode('{"aggregated_by": "day", "limit": "test_string", "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": "test_string"}');
$response = $sg->client->user()->webhooks()->parse()->stats()->get(null, $query_params);
diff --git a/examples/whitelabel/whitelabel.php b/examples/whitelabel/whitelabel.php
index 8adac3a..c0ab694 100644
--- a/examples/whitelabel/whitelabel.php
+++ b/examples/whitelabel/whitelabel.php
@@ -6,9 +6,9 @@ require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
-##################################################
-# Create a domain whitelabel. #
-# POST /whitelabel/domains #
+////////////////////////////////////////////////////
+// Create a domain whitelabel. #
+// POST /whitelabel/domains #
$request_body = json_decode('{
"automatic_security": false,
@@ -27,9 +27,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# List all domain whitelabels. #
-# GET /whitelabel/domains #
+////////////////////////////////////////////////////
+// List all domain whitelabels. #
+// GET /whitelabel/domains #
$query_params = json_decode('{"username": "test_string", "domain": "test_string", "exclude_subusers": "true", "limit": 1, "offset": 1}');
$response = $sg->client->whitelabel()->domains()->get(null, $query_params);
@@ -37,36 +37,36 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Get the default domain whitelabel. #
-# GET /whitelabel/domains/default #
+////////////////////////////////////////////////////
+// Get the default domain whitelabel. #
+// GET /whitelabel/domains/default #
$response = $sg->client->whitelabel()->domains()->default()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# List the domain whitelabel associated with the given user. #
-# GET /whitelabel/domains/subuser #
+////////////////////////////////////////////////////
+// List the domain whitelabel associated with the given user. #
+// GET /whitelabel/domains/subuser #
$response = $sg->client->whitelabel()->domains()->subuser()->get();
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Disassociate a domain whitelabel from a given user. #
-# DELETE /whitelabel/domains/subuser #
+////////////////////////////////////////////////////
+// Disassociate a domain whitelabel from a given user. #
+// DELETE /whitelabel/domains/subuser #
$response = $sg->client->whitelabel()->domains()->subuser()->delete($request_body);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update a domain whitelabel. #
-# PATCH /whitelabel/domains/{domain_id} #
+////////////////////////////////////////////////////
+// Update a domain whitelabel. #
+// PATCH /whitelabel/domains/{domain_id} #
$request_body = json_decode('{
"custom_spf": true,
@@ -78,9 +78,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a domain whitelabel. #
-# GET /whitelabel/domains/{domain_id} #
+////////////////////////////////////////////////////
+// Retrieve a domain whitelabel. #
+// GET /whitelabel/domains/{domain_id} #
$domain_id = "test_url_param";
$response = $sg->client->whitelabel()->domains()->_($domain_id)->get();
@@ -88,9 +88,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a domain whitelabel. #
-# DELETE /whitelabel/domains/{domain_id} #
+////////////////////////////////////////////////////
+// Delete a domain whitelabel. #
+// DELETE /whitelabel/domains/{domain_id} #
$domain_id = "test_url_param";
$response = $sg->client->whitelabel()->domains()->_($domain_id)->delete($request_body);
@@ -98,9 +98,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Associate a domain whitelabel with a given user. #
-# POST /whitelabel/domains/{domain_id}/subuser #
+////////////////////////////////////////////////////
+// Associate a domain whitelabel with a given user. #
+// POST /whitelabel/domains/{domain_id}/subuser #
$request_body = json_decode('{
"username": "jane@example.com"
@@ -111,9 +111,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Add an IP to a domain whitelabel. #
-# POST /whitelabel/domains/{id}/ips #
+////////////////////////////////////////////////////
+// Add an IP to a domain whitelabel. #
+// POST /whitelabel/domains/{id}/ips #
$request_body = json_decode('{
"ip": "192.168.0.1"
@@ -124,20 +124,20 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Remove an IP from a domain whitelabel. #
-# DELETE /whitelabel/domains/{id}/ips/{ip} #
+////////////////////////////////////////////////////
+// Remove an IP from a domain whitelabel. #
+// DELETE /whitelabel/domains/{id}/ips/{ip} #
$id = "test_url_param";
- $ip = "test_url_param";
+$ip = "test_url_param";
$response = $sg->client->whitelabel()->domains()->_($id)->ips()->_($ip)->delete($request_body);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Validate a domain whitelabel. #
-# POST /whitelabel/domains/{id}/validate #
+////////////////////////////////////////////////////
+// Validate a domain whitelabel. #
+// POST /whitelabel/domains/{id}/validate #
$request_body = json_decode('null');
$id = "test_url_param";
@@ -146,9 +146,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Create an IP whitelabel #
-# POST /whitelabel/ips #
+////////////////////////////////////////////////////
+// Create an IP whitelabel #
+// POST /whitelabel/ips #
$request_body = json_decode('{
"domain": "example.com",
@@ -160,9 +160,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all IP whitelabels #
-# GET /whitelabel/ips #
+////////////////////////////////////////////////////
+// Retrieve all IP whitelabels #
+// GET /whitelabel/ips #
$query_params = json_decode('{"ip": "test_string", "limit": 1, "offset": 1}');
$response = $sg->client->whitelabel()->ips()->get(null, $query_params);
@@ -170,9 +170,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve an IP whitelabel #
-# GET /whitelabel/ips/{id} #
+////////////////////////////////////////////////////
+// Retrieve an IP whitelabel #
+// GET /whitelabel/ips/{id} #
$id = "test_url_param";
$response = $sg->client->whitelabel()->ips()->_($id)->get();
@@ -180,9 +180,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete an IP whitelabel #
-# DELETE /whitelabel/ips/{id} #
+////////////////////////////////////////////////////
+// Delete an IP whitelabel #
+// DELETE /whitelabel/ips/{id} #
$id = "test_url_param";
$response = $sg->client->whitelabel()->ips()->_($id)->delete($request_body);
@@ -190,9 +190,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Validate an IP whitelabel #
-# POST /whitelabel/ips/{id}/validate #
+////////////////////////////////////////////////////
+// Validate an IP whitelabel #
+// POST /whitelabel/ips/{id}/validate #
$request_body = json_decode('null');
$id = "test_url_param";
@@ -201,9 +201,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Create a Link Whitelabel #
-# POST /whitelabel/links #
+////////////////////////////////////////////////////
+// Create a Link Whitelabel #
+// POST /whitelabel/links #
$request_body = json_decode('{
"default": true,
@@ -216,9 +216,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve all link whitelabels #
-# GET /whitelabel/links #
+////////////////////////////////////////////////////
+// Retrieve all link whitelabels #
+// GET /whitelabel/links #
$query_params = json_decode('{"limit": 1}');
$response = $sg->client->whitelabel()->links()->get(null, $query_params);
@@ -226,9 +226,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a Default Link Whitelabel #
-# GET /whitelabel/links/default #
+////////////////////////////////////////////////////
+// Retrieve a Default Link Whitelabel #
+// GET /whitelabel/links/default #
$query_params = json_decode('{"domain": "test_string"}');
$response = $sg->client->whitelabel()->links()->default()->get(null, $query_params);
@@ -236,9 +236,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve Associated Link Whitelabel #
-# GET /whitelabel/links/subuser #
+////////////////////////////////////////////////////
+// Retrieve Associated Link Whitelabel #
+// GET /whitelabel/links/subuser #
$query_params = json_decode('{"username": "test_string"}');
$response = $sg->client->whitelabel()->links()->subuser()->get(null, $query_params);
@@ -246,9 +246,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Disassociate a Link Whitelabel #
-# DELETE /whitelabel/links/subuser #
+////////////////////////////////////////////////////
+// Disassociate a Link Whitelabel #
+// DELETE /whitelabel/links/subuser #
$query_params = json_decode('{"username": "test_string"}');
$response = $sg->client->whitelabel()->links()->subuser()->delete($request_body, $query_params);
@@ -256,9 +256,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Update a Link Whitelabel #
-# PATCH /whitelabel/links/{id} #
+////////////////////////////////////////////////////
+// Update a Link Whitelabel #
+// PATCH /whitelabel/links/{id} #
$request_body = json_decode('{
"default": true
@@ -269,9 +269,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Retrieve a Link Whitelabel #
-# GET /whitelabel/links/{id} #
+////////////////////////////////////////////////////
+// Retrieve a Link Whitelabel #
+// GET /whitelabel/links/{id} #
$id = "test_url_param";
$response = $sg->client->whitelabel()->links()->_($id)->get();
@@ -279,9 +279,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Delete a Link Whitelabel #
-# DELETE /whitelabel/links/{id} #
+////////////////////////////////////////////////////
+// Delete a Link Whitelabel #
+// DELETE /whitelabel/links/{id} #
$id = "test_url_param";
$response = $sg->client->whitelabel()->links()->_($id)->delete($request_body);
@@ -289,9 +289,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Validate a Link Whitelabel #
-# POST /whitelabel/links/{id}/validate #
+////////////////////////////////////////////////////
+// Validate a Link Whitelabel #
+// POST /whitelabel/links/{id}/validate #
$request_body = json_decode('null');
$id = "test_url_param";
@@ -300,9 +300,9 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
-##################################################
-# Associate a Link Whitelabel #
-# POST /whitelabel/links/{link_id}/subuser #
+////////////////////////////////////////////////////
+// Associate a Link Whitelabel #
+// POST /whitelabel/links/{link_id}/subuser #
$request_body = json_decode('{
"username": "jane@example.com"