summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElmer Thomas <elmer@thinkingserious.com>2016-06-08 14:11:01 -0700
committerElmer Thomas <elmer@thinkingserious.com>2016-06-08 14:11:01 -0700
commitd99a837f6ba2545fa7138b66db890247a510e4c2 (patch)
treeb64bf6cc9d80ec70d6bd5792553066b13bc7560b
parent6e4066dea876f7ca522bbd2b0e245b20da333c65 (diff)
downloadsendgrid-php-d99a837f6ba2545fa7138b66db890247a510e4c2.zip
sendgrid-php-d99a837f6ba2545fa7138b66db890247a510e4c2.tar.gz
sendgrid-php-d99a837f6ba2545fa7138b66db890247a510e4c2.tar.bz2
Clarify usage of vendor/autoload.php
-rw-r--r--README.md2
-rw-r--r--USAGE.md53
-rw-r--r--examples/accesssettings/accesssettings.php1
-rw-r--r--examples/apikeys/apikeys.php1
-rw-r--r--examples/asm/asm.php33
-rw-r--r--examples/browsers/browsers.php1
-rw-r--r--examples/campaigns/campaigns.php1
-rw-r--r--examples/categories/categories.php1
-rw-r--r--examples/clients/clients.php1
-rw-r--r--examples/contactdb/contactdb.php1
-rw-r--r--examples/devices/devices.php1
-rw-r--r--examples/geo/geo.php1
-rw-r--r--examples/helpers/mail/example.php1
-rw-r--r--examples/ips/ips.php1
-rw-r--r--examples/mail/mail.php1
-rw-r--r--examples/mailboxproviders/mailboxproviders.php1
-rw-r--r--examples/mailsettings/mailsettings.php1
-rw-r--r--examples/partnersettings/partnersettings.php1
-rw-r--r--examples/scopes/scopes.php1
-rw-r--r--examples/stats/stats.php1
-rw-r--r--examples/subusers/subusers.php1
-rw-r--r--examples/suppression/suppression.php1
-rw-r--r--examples/templates/templates.php1
-rw-r--r--examples/trackingsettings/trackingsettings.php1
-rw-r--r--examples/user/user.php1
-rw-r--r--examples/whitelabel/whitelabel.php1
26 files changed, 92 insertions, 19 deletions
diff --git a/README.md b/README.md
index 4292b5d..044900f 100644
--- a/README.md
+++ b/README.md
@@ -114,6 +114,7 @@ Previous versions of the library can be found in the [version index](https://sen
## Hello Email
```php
+// If you are using Composer
require 'vendor/autoload.php';
$from = new Email(null, "test@example.com");
@@ -134,6 +135,7 @@ echo $response->body();
## General v3 Web API Usage
```php
+// If you are using Composer
require 'vendor/autoload.php';
$apiKey = getenv('SENDGRID_API_KEY');
diff --git a/USAGE.md b/USAGE.md
index 5e56240..c1a542b 100644
--- a/USAGE.md
+++ b/USAGE.md
@@ -3,6 +3,7 @@ This documentation is based on our [OAI specification](https://github.com/sendgr
# INITIALIZATION
```php
+// If you are using Composer
require 'vendor/autoload.php';
@@ -298,9 +299,9 @@ echo $response->headers();
<a name="asm"></a>
# ASM
-## Create a Group
+## Create a new suppression group
-**This endoint allows you to create a new suppression group.**
+**This endpoint allows you to create a new suppression group.**
Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts.
@@ -312,29 +313,26 @@ Each user can create up to 25 different suppression groups.
```php
$request_body = json_decode('{
- "description": "A group description",
- "is_default": false,
- "name": "A group name"
+ "description": "Suggestions for products our users might like.",
+ "is_default": true,
+ "name": "Product Suggestions"
}');
$response = $sg->client->asm()->groups()->post($request_body);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
```
-## Retrieve all suppression groups associated with the user.
+## Retrieve information about multiple suppression groups
-**This endpoint allows you to retrieve a list of all suppression groups created by this user.**
+**This endpoint allows you to retrieve information about multiple suppression groups.**
-Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts.
-
-The **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions.
-
-Each user can create up to 25 different suppression groups.
+This endpoint will return information for each group ID that you include in your request. To add a group ID to your request, simply append `&id=` followed by the group ID.
### GET /asm/groups
```php
-$response = $sg->client->asm()->groups()->get();
+$query_params = json_decode('{"id": 1}');
+$response = $sg->client->asm()->groups()->get(null, $query_params);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
@@ -457,6 +455,20 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
```
+## Retrieve all suppressions
+
+**This endpoint allows you to retrieve a list of all suppressions.**
+
+Suppressions are email addresses that can be added to [groups](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html) to prevent certain types of emails from being delivered to those addresses.
+
+### GET /asm/suppressions
+
+```php
+$response = $sg->client->asm()->suppressions()->get();
+echo $response->statusCode();
+echo $response->body();
+echo $response->headers();
+```
## Add recipient addresses to the global suppression group.
**This endpoint allows you to add one or more email addresses to the global suppressions group.**
@@ -509,6 +521,21 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
```
+## Retrieve all suppression groups for an email address
+
+**This endpoint will return a list of all suppression groups, indicating if the given email address is suppressed for each group.**
+
+Suppressions are email addresses that can be added to [groups](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html) to prevent certain types of emails from being delivered to those addresses.
+
+### GET /asm/suppressions/{email}
+
+```php
+$email = "test_url_param";
+$response = $sg->client->asm()->suppressions()->_($email)->get();
+echo $response->statusCode();
+echo $response->body();
+echo $response->headers();
+```
<a name="browsers"></a>
# BROWSERS
diff --git a/examples/accesssettings/accesssettings.php b/examples/accesssettings/accesssettings.php
index 9676530..8199195 100644
--- a/examples/accesssettings/accesssettings.php
+++ b/examples/accesssettings/accesssettings.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/apikeys/apikeys.php b/examples/apikeys/apikeys.php
index ab21ec1..ec26642 100644
--- a/examples/apikeys/apikeys.php
+++ b/examples/apikeys/apikeys.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/asm/asm.php b/examples/asm/asm.php
index 4abcd33..233d968 100644
--- a/examples/asm/asm.php
+++ b/examples/asm/asm.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
@@ -6,13 +7,13 @@ $apiKey = getenv('SENDGRID_API_KEY');
$sg = new \SendGrid($apiKey);
##################################################
-# Create a Group #
+# Create a new suppression group #
# POST /asm/groups #
$request_body = json_decode('{
- "description": "A group description",
- "is_default": false,
- "name": "A group name"
+ "description": "Suggestions for products our users might like.",
+ "is_default": true,
+ "name": "Product Suggestions"
}');
$response = $sg->client->asm()->groups()->post($request_body);
echo $response->statusCode();
@@ -20,10 +21,11 @@ echo $response->body();
echo $response->headers();
##################################################
-# Retrieve all suppression groups associated with the user. #
+# Retrieve information about multiple suppression groups #
# GET /asm/groups #
-$response = $sg->client->asm()->groups()->get();
+$query_params = json_decode('{"id": 1}');
+$response = $sg->client->asm()->groups()->get(null, $query_params);
echo $response->statusCode();
echo $response->body();
echo $response->headers();
@@ -101,6 +103,15 @@ echo $response->body();
echo $response->headers();
##################################################
+# 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 #
@@ -135,3 +146,13 @@ echo $response->statusCode();
echo $response->body();
echo $response->headers();
+##################################################
+# Retrieve all suppression groups for an email address #
+# GET /asm/suppressions/{email} #
+
+$email = "test_url_param";
+$response = $sg->client->asm()->suppressions()->_($email)->get();
+echo $response->statusCode();
+echo $response->body();
+echo $response->headers();
+
diff --git a/examples/browsers/browsers.php b/examples/browsers/browsers.php
index 7b46c9c..0568dfc 100644
--- a/examples/browsers/browsers.php
+++ b/examples/browsers/browsers.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/campaigns/campaigns.php b/examples/campaigns/campaigns.php
index 943478b..0cfcdfb 100644
--- a/examples/campaigns/campaigns.php
+++ b/examples/campaigns/campaigns.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/categories/categories.php b/examples/categories/categories.php
index e080c8c..cf24a77 100644
--- a/examples/categories/categories.php
+++ b/examples/categories/categories.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/clients/clients.php b/examples/clients/clients.php
index b1b3016..08c9cd2 100644
--- a/examples/clients/clients.php
+++ b/examples/clients/clients.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/contactdb/contactdb.php b/examples/contactdb/contactdb.php
index 36ec79d..38652f9 100644
--- a/examples/contactdb/contactdb.php
+++ b/examples/contactdb/contactdb.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/devices/devices.php b/examples/devices/devices.php
index ac07d05..6d474eb 100644
--- a/examples/devices/devices.php
+++ b/examples/devices/devices.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/geo/geo.php b/examples/geo/geo.php
index d162035..67b9c2c 100644
--- a/examples/geo/geo.php
+++ b/examples/geo/geo.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/helpers/mail/example.php b/examples/helpers/mail/example.php
index 15e12de..ce3f062 100644
--- a/examples/helpers/mail/example.php
+++ b/examples/helpers/mail/example.php
@@ -1,6 +1,7 @@
<?php
namespace SendGrid;
+// If you are using Composer
require __DIR__ . '/../../../vendor/autoload.php';
diff --git a/examples/ips/ips.php b/examples/ips/ips.php
index cc16089..d35efb9 100644
--- a/examples/ips/ips.php
+++ b/examples/ips/ips.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/mail/mail.php b/examples/mail/mail.php
index fd9cea9..7bb7d4e 100644
--- a/examples/mail/mail.php
+++ b/examples/mail/mail.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/mailboxproviders/mailboxproviders.php b/examples/mailboxproviders/mailboxproviders.php
index 8f48029..8c2fe59 100644
--- a/examples/mailboxproviders/mailboxproviders.php
+++ b/examples/mailboxproviders/mailboxproviders.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/mailsettings/mailsettings.php b/examples/mailsettings/mailsettings.php
index 9762f84..6660866 100644
--- a/examples/mailsettings/mailsettings.php
+++ b/examples/mailsettings/mailsettings.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/partnersettings/partnersettings.php b/examples/partnersettings/partnersettings.php
index be86bf3..cb46fea 100644
--- a/examples/partnersettings/partnersettings.php
+++ b/examples/partnersettings/partnersettings.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/scopes/scopes.php b/examples/scopes/scopes.php
index 013e22f..3f8f9d5 100644
--- a/examples/scopes/scopes.php
+++ b/examples/scopes/scopes.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/stats/stats.php b/examples/stats/stats.php
index 938d8b1..5e146d8 100644
--- a/examples/stats/stats.php
+++ b/examples/stats/stats.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/subusers/subusers.php b/examples/subusers/subusers.php
index 5dff315..dd9de73 100644
--- a/examples/subusers/subusers.php
+++ b/examples/subusers/subusers.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/suppression/suppression.php b/examples/suppression/suppression.php
index eec6b4c..1685826 100644
--- a/examples/suppression/suppression.php
+++ b/examples/suppression/suppression.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/templates/templates.php b/examples/templates/templates.php
index 69151d1..93b9051 100644
--- a/examples/templates/templates.php
+++ b/examples/templates/templates.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/trackingsettings/trackingsettings.php b/examples/trackingsettings/trackingsettings.php
index 6c35b21..8e9fd55 100644
--- a/examples/trackingsettings/trackingsettings.php
+++ b/examples/trackingsettings/trackingsettings.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/user/user.php b/examples/user/user.php
index 43baff9..82c4dac 100644
--- a/examples/user/user.php
+++ b/examples/user/user.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';
diff --git a/examples/whitelabel/whitelabel.php b/examples/whitelabel/whitelabel.php
index 5ce112d..8adac3a 100644
--- a/examples/whitelabel/whitelabel.php
+++ b/examples/whitelabel/whitelabel.php
@@ -1,4 +1,5 @@
<?php
+// If you are using Composer
require 'vendor/autoload.php';