sendgrid-ruby 5.3.0 → 6.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/pr-lint.yml +15 -0
- data/.github/workflows/test-and-deploy.yml +120 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +8 -0
- data/.rubocop_todo.yml +127 -0
- data/CHANGELOG.md +261 -8
- data/CODE_OF_CONDUCT.md +57 -25
- data/CONTRIBUTING.md +24 -71
- data/Dockerfile +14 -0
- data/FIRST_TIMERS.md +53 -0
- data/Gemfile +0 -1
- data/LICENSE +21 -0
- data/Makefile +14 -0
- data/PULL_REQUEST_TEMPLATE.md +31 -0
- data/README.md +39 -43
- data/Rakefile +3 -4
- data/TROUBLESHOOTING.md +41 -21
- data/UPGRADE.md +5 -0
- data/USAGE.md +1231 -1122
- data/examples/accesssettings/accesssettings.rb +9 -12
- data/examples/alerts/alerts.rb +8 -11
- data/examples/apikeys/apikeys.rb +12 -15
- data/examples/asm/asm.rb +27 -30
- data/examples/browsers/browsers.rb +0 -3
- data/examples/campaigns/campaigns.rb +29 -32
- data/examples/categories/categories.rb +0 -3
- data/examples/clients/clients.rb +1 -4
- data/examples/contactdb/contactdb.rb +63 -66
- data/examples/dataresidency/setregion.rb +48 -0
- data/examples/devices/devices.rb +0 -3
- data/examples/emailactivity/emailactivity.rb +52 -0
- data/examples/geo/geo.rb +0 -3
- data/examples/helpers/eventwebhook/example.rb +16 -0
- data/examples/helpers/mail/example.rb +30 -19
- data/examples/helpers/settings/example.rb +1 -1
- data/examples/helpers/stats/example.rb +4 -4
- data/examples/ips/ips.rb +31 -21
- data/examples/mail/mail.rb +73 -76
- data/examples/mailboxproviders/mailboxproviders.rb +0 -3
- data/examples/mailsettings/mailsettings.rb +21 -24
- data/examples/partnersettings/partnersettings.rb +3 -6
- data/examples/scopes/scopes.rb +49 -5
- data/examples/{whitelabel/whitelabel.rb → senderauthentication/senderauthentication.rb} +68 -71
- data/examples/senders/senders.rb +28 -31
- data/examples/stats/stats.rb +0 -3
- data/examples/subusers/subusers.rb +17 -20
- data/examples/suppression/suppression.rb +23 -26
- data/examples/templates/templates.rb +29 -31
- data/examples/trackingsettings/trackingsettings.rb +14 -17
- data/examples/user/user.rb +41 -44
- data/lib/rack/sendgrid_webhook_verification.rb +55 -0
- data/lib/sendgrid/base_interface.rb +57 -0
- data/lib/sendgrid/helpers/eventwebhook/eventwebhook.rb +50 -0
- data/lib/sendgrid/helpers/inbound/README.md +26 -9
- data/lib/sendgrid/helpers/inbound/app.rb +15 -3
- data/lib/sendgrid/helpers/inbound/public/index.html +2 -2
- data/lib/sendgrid/helpers/inbound/sample_data/default_data.txt +2 -2
- data/lib/sendgrid/helpers/inbound/sample_data/raw_data.txt +2 -2
- data/lib/sendgrid/helpers/inbound/sample_data/raw_data_with_attachments.txt +2 -2
- data/lib/sendgrid/helpers/inbound/send.rb +5 -5
- data/lib/sendgrid/helpers/ip_management/ip_management.rb +17 -0
- data/lib/sendgrid/helpers/mail/README.md +4 -4
- data/lib/sendgrid/helpers/mail/asm.rb +4 -18
- data/lib/sendgrid/helpers/mail/attachment.rb +30 -38
- data/lib/sendgrid/helpers/mail/bcc_settings.rb +4 -18
- data/lib/sendgrid/helpers/mail/bypass_list_management.rb +6 -18
- data/lib/sendgrid/helpers/mail/category.rb +2 -12
- data/lib/sendgrid/helpers/mail/click_tracking.rb +4 -18
- data/lib/sendgrid/helpers/mail/content.rb +4 -18
- data/lib/sendgrid/helpers/mail/custom_arg.rb +4 -10
- data/lib/sendgrid/helpers/mail/email.rb +10 -20
- data/lib/sendgrid/helpers/mail/footer.rb +5 -27
- data/lib/sendgrid/helpers/mail/ganalytics.rb +9 -55
- data/lib/sendgrid/helpers/mail/header.rb +4 -10
- data/lib/sendgrid/helpers/mail/mail.rb +37 -87
- data/lib/sendgrid/helpers/mail/mail_settings.rb +7 -25
- data/lib/sendgrid/helpers/mail/open_tracking.rb +4 -18
- data/lib/sendgrid/helpers/mail/personalization.rb +38 -27
- data/lib/sendgrid/helpers/mail/section.rb +4 -10
- data/lib/sendgrid/helpers/mail/spam_check.rb +5 -27
- data/lib/sendgrid/helpers/mail/subscription_tracking.rb +6 -36
- data/lib/sendgrid/helpers/mail/substitution.rb +4 -10
- data/lib/sendgrid/helpers/mail/tracking_settings.rb +6 -20
- data/lib/sendgrid/helpers/permissions/scope.rb +28 -0
- data/lib/sendgrid/helpers/permissions/scopes.yml +309 -0
- data/lib/sendgrid/helpers/settings/README.md +3 -3
- data/lib/sendgrid/helpers/settings/settings.rb +1 -1
- data/lib/sendgrid/helpers/settings/tracking_settings_dto.rb +3 -5
- data/lib/sendgrid/helpers/stats/metrics.rb +5 -7
- data/lib/sendgrid/helpers/stats/stats_response.rb +1 -3
- data/lib/sendgrid/sendgrid.rb +21 -0
- data/lib/sendgrid/twilio_email.rb +21 -0
- data/lib/sendgrid/version.rb +1 -1
- data/lib/sendgrid-ruby.rb +7 -1
- data/mail_helper_v3.md +21 -21
- data/sendgrid-ruby.gemspec +12 -12
- data/spec/fixtures/event_webhook.rb +22 -0
- data/spec/rack/sendgrid_webhook_verification_spec.rb +142 -0
- data/spec/sendgrid/helpers/eventwebhook/eventwebhook_spec.rb +105 -0
- data/spec/sendgrid/helpers/ip_management/ip_management_spec.rb +12 -0
- data/spec/sendgrid/helpers/settings/mail_settings_dto_spec.rb +3 -3
- data/spec/sendgrid/helpers/settings/partner_settings_dto_spec.rb +3 -3
- data/spec/sendgrid/helpers/settings/settings_spec.rb +2 -2
- data/spec/sendgrid/helpers/settings/tracking_settings_dto_spec.rb +3 -3
- data/spec/sendgrid/helpers/settings/user_settings_dto_spec.rb +3 -3
- data/spec/sendgrid/helpers/stats/email_stats_spec.rb +22 -23
- data/spec/sendgrid/helpers/stats/metrics_spec.rb +19 -20
- data/spec/sendgrid/helpers/stats/stats_response_spec.rb +22 -23
- data/spec/sendgrid/sendgrid_spec.rb +11 -0
- data/spec/sendgrid/twilio_email_spec.rb +11 -0
- data/spec/spec_helper.rb +3 -1
- data/static/img/github-fork.png +0 -0
- data/static/img/github-sign-up.png +0 -0
- data/test/sendgrid/helpers/mail/test_attachment.rb +33 -0
- data/test/sendgrid/helpers/mail/test_category.rb +0 -2
- data/test/sendgrid/helpers/mail/test_data_residency.rb +44 -0
- data/test/sendgrid/helpers/mail/test_email.rb +17 -10
- data/test/sendgrid/helpers/mail/test_mail.rb +126 -119
- data/test/sendgrid/helpers/mail/test_personalizations.rb +145 -92
- data/test/sendgrid/permissions/test_scopes.rb +36 -0
- data/test/sendgrid/test_sendgrid-ruby.rb +1961 -1979
- data/twilio_sendgrid_logo.png +0 -0
- data/use-cases/README.md +17 -0
- data/use-cases/domain-authentication.md +5 -0
- data/use-cases/email-statistics.md +52 -0
- data/use-cases/legacy-templates.md +98 -0
- data/use-cases/personalizations.md +34 -0
- data/use-cases/sms.md +39 -0
- data/use-cases/transactional-templates.md +111 -0
- data/use-cases/twilio-email.md +13 -0
- data/use-cases/twilio-setup.md +54 -0
- metadata +99 -45
- data/.codeclimate.yml +0 -21
- data/.github/ISSUE_TEMPLATE +0 -17
- data/.github/PULL_REQUEST_TEMPLATE +0 -24
- data/.travis.yml +0 -29
- data/LICENSE.txt +0 -22
- data/USE_CASES.md +0 -147
- data/docker/Dockerfile +0 -12
- data/docker/README.md +0 -30
- data/lib/sendgrid/client.rb +0 -35
- data/test/prism.sh +0 -42
data/USAGE.md
CHANGED
@@ -21,6 +21,7 @@ sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
|
|
21
21
|
* [CLIENTS](#clients)
|
22
22
|
* [CONTACTDB](#contactdb)
|
23
23
|
* [DEVICES](#devices)
|
24
|
+
* [EMAIL ACTIVITY](#email-activity)
|
24
25
|
* [GEO](#geo)
|
25
26
|
* [IPS](#ips)
|
26
27
|
* [MAIL](#mail)
|
@@ -29,13 +30,13 @@ sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY'])
|
|
29
30
|
* [PARTNER SETTINGS](#partner-settings)
|
30
31
|
* [SCOPES](#scopes)
|
31
32
|
* [SENDERS](#senders)
|
33
|
+
* [SENDER AUTHENTICATION](#sender-authentication)
|
32
34
|
* [STATS](#stats)
|
33
35
|
* [SUBUSERS](#subusers)
|
34
36
|
* [SUPPRESSION](#suppression)
|
35
37
|
* [TEMPLATES](#templates)
|
36
38
|
* [TRACKING SETTINGS](#tracking-settings)
|
37
39
|
* [USER](#user)
|
38
|
-
* [WHITELABEL](#whitelabel)
|
39
40
|
|
40
41
|
|
41
42
|
<a name="access-settings"></a>
|
@@ -290,11 +291,11 @@ puts response.headers
|
|
290
291
|
|
291
292
|
**This endpoint allows you to create a new random API Key for the user.**
|
292
293
|
|
293
|
-
A JSON request body containing a "name" property is required. If number of maximum keys is reached, HTTP 403 will be returned.
|
294
|
+
A JSON request body containing a "name" property is required. If the number of maximum keys is reached, HTTP 403 will be returned.
|
294
295
|
|
295
296
|
There is a limit of 100 API Keys on your account.
|
296
297
|
|
297
|
-
The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
|
298
|
+
The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the Twilio SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
|
298
299
|
|
299
300
|
See the [API Key Permissions List](https://sendgrid.com/docs/API_Reference/Web_API_v3/API_Keys/api_key_permissions_list.html) for a list of all available scopes.
|
300
301
|
|
@@ -320,7 +321,7 @@ puts response.headers
|
|
320
321
|
|
321
322
|
**This endpoint allows you to retrieve all API Keys that belong to the authenticated user.**
|
322
323
|
|
323
|
-
The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
|
324
|
+
The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the Twilio SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
|
324
325
|
|
325
326
|
### GET /api_keys
|
326
327
|
|
@@ -339,7 +340,7 @@ puts response.headers
|
|
339
340
|
A JSON request body with a "name" property is required.
|
340
341
|
Most provide the list of all the scopes an api key should have.
|
341
342
|
|
342
|
-
The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
|
343
|
+
The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the Twilio SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
|
343
344
|
|
344
345
|
|
345
346
|
### PUT /api_keys/{api_key_id}
|
@@ -365,7 +366,7 @@ puts response.headers
|
|
365
366
|
|
366
367
|
A JSON request body with a "name" property is required.
|
367
368
|
|
368
|
-
The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
|
369
|
+
The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the Twilio SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
|
369
370
|
|
370
371
|
## URI Parameters
|
371
372
|
|
@@ -406,9 +407,9 @@ puts response.headers
|
|
406
407
|
|
407
408
|
**This endpoint allows you to revoke an existing API Key**
|
408
409
|
|
409
|
-
Authentications using this API Key will fail after this request is made, with some small propagation delay.If the API Key ID does not exist an HTTP 404 will be returned.
|
410
|
+
Authentications using this API Key will fail after this request is made, with some small propagation delay. If the API Key ID does not exist an HTTP 404 will be returned.
|
410
411
|
|
411
|
-
The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
|
412
|
+
The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the Twilio SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
|
412
413
|
|
413
414
|
## URI Parameters
|
414
415
|
|
@@ -967,7 +968,7 @@ puts response.headers
|
|
967
968
|
|
968
969
|
**This endpoint allows you to send a test campaign.**
|
969
970
|
|
970
|
-
To send to multiple addresses, use an array for the JSON "to" value ["one@address","two@address"]
|
971
|
+
To send to multiple addresses, use an array for the JSON "to" value ["one@address", "two@address"]
|
971
972
|
|
972
973
|
For more information:
|
973
974
|
|
@@ -1094,7 +1095,7 @@ puts response.headers
|
|
1094
1095
|
|
1095
1096
|
**This endpoint allows you to create a custom field.**
|
1096
1097
|
|
1097
|
-
The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1098
|
+
The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1098
1099
|
|
1099
1100
|
### POST /contactdb/custom_fields
|
1100
1101
|
|
@@ -1113,7 +1114,7 @@ puts response.headers
|
|
1113
1114
|
|
1114
1115
|
**This endpoint allows you to retrieve all custom fields.**
|
1115
1116
|
|
1116
|
-
The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1117
|
+
The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1117
1118
|
|
1118
1119
|
### GET /contactdb/custom_fields
|
1119
1120
|
|
@@ -1128,7 +1129,7 @@ puts response.headers
|
|
1128
1129
|
|
1129
1130
|
**This endpoint allows you to retrieve a custom field by ID.**
|
1130
1131
|
|
1131
|
-
The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1132
|
+
The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1132
1133
|
|
1133
1134
|
### GET /contactdb/custom_fields/{custom_field_id}
|
1134
1135
|
|
@@ -1144,7 +1145,7 @@ puts response.headers
|
|
1144
1145
|
|
1145
1146
|
**This endpoint allows you to delete a custom field by ID.**
|
1146
1147
|
|
1147
|
-
The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1148
|
+
The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1148
1149
|
|
1149
1150
|
### DELETE /contactdb/custom_fields/{custom_field_id}
|
1150
1151
|
|
@@ -1345,9 +1346,9 @@ puts response.headers
|
|
1345
1346
|
|
1346
1347
|
The body of an API call to this endpoint must include an array of one or more recipient objects.
|
1347
1348
|
|
1348
|
-
It is of note that you can add custom field data as parameters on recipient objects. We have provided an example using some of the default custom fields SendGrid provides.
|
1349
|
+
It is of note that you can add custom field data as parameters on recipient objects. We have provided an example using some of the default custom fields Twilio SendGrid provides.
|
1349
1350
|
|
1350
|
-
The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1351
|
+
The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1351
1352
|
|
1352
1353
|
### PATCH /contactdb/recipients
|
1353
1354
|
|
@@ -1369,7 +1370,7 @@ puts response.headers
|
|
1369
1370
|
|
1370
1371
|
**This endpoint allows you to add a Marketing Campaigns recipient.**
|
1371
1372
|
|
1372
|
-
It is of note that you can add custom field data as a parameter on this endpoint. We have provided an example using some of the default custom fields SendGrid provides.
|
1373
|
+
It is of note that you can add custom field data as a parameter on this endpoint. We have provided an example using some of the default custom fields Twilio SendGrid provides.
|
1373
1374
|
|
1374
1375
|
The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
|
1375
1376
|
|
@@ -1417,11 +1418,11 @@ puts response.headers
|
|
1417
1418
|
```
|
1418
1419
|
## Delete Recipient
|
1419
1420
|
|
1420
|
-
**This endpoint allows you to
|
1421
|
+
**This endpoint allows you to delete one or more recipients.**
|
1421
1422
|
|
1422
1423
|
The body of an API call to this endpoint must include an array of recipient IDs of the recipients you want to delete.
|
1423
1424
|
|
1424
|
-
The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1425
|
+
The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1425
1426
|
|
1426
1427
|
### DELETE /contactdb/recipients
|
1427
1428
|
|
@@ -1457,7 +1458,7 @@ puts response.headers
|
|
1457
1458
|
|
1458
1459
|
**This endpoint allows you to retrieve the total number of Marketing Campaigns recipients.**
|
1459
1460
|
|
1460
|
-
The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1461
|
+
The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1461
1462
|
|
1462
1463
|
### GET /contactdb/recipients/count
|
1463
1464
|
|
@@ -1481,7 +1482,7 @@ your epoch time to a date range encompassing the entire day. For example, an epo
|
|
1481
1482
|
Mon, 02 Feb 2015 00:06:40 GMT, but internally the system will search from Mon, 02 Feb 2015 00:00:00 GMT through
|
1482
1483
|
Mon, 02 Feb 2015 23:59:59 GMT.
|
1483
1484
|
|
1484
|
-
The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1485
|
+
The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1485
1486
|
|
1486
1487
|
### GET /contactdb/recipients/search
|
1487
1488
|
|
@@ -1529,7 +1530,7 @@ puts response.headers
|
|
1529
1530
|
|
1530
1531
|
**This endpoint allows you to retrieve the lists that a given recipient belongs to.**
|
1531
1532
|
|
1532
|
-
Each recipient can be on many lists. This endpoint gives you all of the lists that
|
1533
|
+
Each recipient can be on many lists. This endpoint gives you all of the lists that anyone recipient has been added to.
|
1533
1534
|
|
1534
1535
|
The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients.
|
1535
1536
|
|
@@ -1547,7 +1548,7 @@ puts response.headers
|
|
1547
1548
|
|
1548
1549
|
**This endpoint allows you to list all fields that are reserved and can't be used for custom field names.**
|
1549
1550
|
|
1550
|
-
The contactdb is a database of your contacts for [SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1551
|
+
The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html).
|
1551
1552
|
|
1552
1553
|
### GET /contactdb/reserved_fields
|
1553
1554
|
|
@@ -1686,7 +1687,7 @@ puts response.headers
|
|
1686
1687
|
```
|
1687
1688
|
## Delete a segment
|
1688
1689
|
|
1689
|
-
**This endpoint allows you to delete a segment from your
|
1690
|
+
**This endpoint allows you to delete a segment from your recipient's database.**
|
1690
1691
|
|
1691
1692
|
You also have the option to delete all the contacts from your Marketing Campaigns recipient database who were in this segment.
|
1692
1693
|
|
@@ -1736,10 +1737,10 @@ puts response.headers
|
|
1736
1737
|
## Available Device Types
|
1737
1738
|
| **Device** | **Description** | **Example** |
|
1738
1739
|
|---|---|---|
|
1739
|
-
| Desktop | Email software on desktop computer. | I.E., Outlook, Sparrow, or Apple Mail. |
|
1740
|
-
| Webmail |
|
1741
|
-
| Phone | A
|
1742
|
-
| Tablet | A tablet computer. | iPad,
|
1740
|
+
| Desktop | Email software on a desktop computer. | I.E., Outlook, Sparrow, or Apple Mail. |
|
1741
|
+
| Webmail | A web-based email client. | I.E., Yahoo, Google, AOL, or Outlook.com. |
|
1742
|
+
| Phone | A smartphone. | iPhone, Android, Blackberry, etc.
|
1743
|
+
| Tablet | A tablet computer. | iPad, Android-based tablet, etc. |
|
1743
1744
|
| Other | An unrecognized device. |
|
1744
1745
|
|
1745
1746
|
Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/index.html).
|
@@ -1754,6 +1755,112 @@ puts response.status_code
|
|
1754
1755
|
puts response.body
|
1755
1756
|
puts response.headers
|
1756
1757
|
```
|
1758
|
+
|
1759
|
+
<a name="email-activity"></a>
|
1760
|
+
# EMAIL ACTIVITY
|
1761
|
+
|
1762
|
+
## Filter all messages
|
1763
|
+
> In order to gain access to the Email Activity Feed API, you must purchase [additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity).
|
1764
|
+
|
1765
|
+
Filter all messages to search your Email Activity.
|
1766
|
+
|
1767
|
+
Queries may need to be [URL encoded](https://meyerweb.com/eric/tools/dencoder/). URL encoding depends on how you're using the API - if you are trying it out here, or using one of the Libraries, we handle the encoding for you. If you are using cURL, or your own implementation, you probably need to encode it.
|
1768
|
+
|
1769
|
+
Queries have this format:
|
1770
|
+
|
1771
|
+
`query={query_type}="{query_content}"`
|
1772
|
+
|
1773
|
+
encoded, this would look like this:
|
1774
|
+
|
1775
|
+
`query=type%3D%22query_content%22`
|
1776
|
+
|
1777
|
+
for example:
|
1778
|
+
|
1779
|
+
Filter by a specific email - `query=to_email%3D%22example%40example.com%22`
|
1780
|
+
|
1781
|
+
Filter by subject line - `query=subject%3d%22A%20Great%20Subject%22`
|
1782
|
+
|
1783
|
+
You can filter by other operators besides `=`. We also accept `!=`, `<`, and `>`.
|
1784
|
+
|
1785
|
+
For a tutorial on how to get started, check out [Getting Started with the Email Activity API](https://sendgrid.com/docs/API_Reference/Web_API_v3/Tutorials/getting_started_email_activity_api.html).
|
1786
|
+
|
1787
|
+
For information about building combined queries, see [Building compound Email Activity queries](https://sendgrid.com/docs/API_Reference/Web_API_v3/Tutorials/getting_started_email_activity_api.html#-Creating-compound-queries).
|
1788
|
+
|
1789
|
+
### GET /messages
|
1790
|
+
```ruby
|
1791
|
+
require 'erb'
|
1792
|
+
|
1793
|
+
filter_key = 'to_email'
|
1794
|
+
filter_operator = ERB::Util.url_encode('=')
|
1795
|
+
filter_value = 'testing@sendgrid.net'
|
1796
|
+
filter_value = ERB::Util.url_encode(format('"%s"', filter_value))
|
1797
|
+
query_params = {}
|
1798
|
+
query_params['query'] = format("%s%s%s", filter_key, filter_operator, filter_value)
|
1799
|
+
query_params['limit'] = '1'
|
1800
|
+
|
1801
|
+
params = query_params
|
1802
|
+
response = sg.client.messages.get(query_params: params)
|
1803
|
+
puts response.status_code
|
1804
|
+
puts response.body
|
1805
|
+
puts response.headers
|
1806
|
+
```
|
1807
|
+
|
1808
|
+
## Filter messages by message ID
|
1809
|
+
|
1810
|
+
> In order to gain access to the Email Activity Feed API, you must purchase [additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity).
|
1811
|
+
|
1812
|
+
Get all of the details about the specified message.
|
1813
|
+
|
1814
|
+
### GET /messages/{msg_id}
|
1815
|
+
|
1816
|
+
```ruby
|
1817
|
+
msg_id = "test_url_param"
|
1818
|
+
response = sg.client.messages._(msg_id).get()
|
1819
|
+
puts response.status_code
|
1820
|
+
puts response.body
|
1821
|
+
puts response.headers
|
1822
|
+
```
|
1823
|
+
|
1824
|
+
|
1825
|
+
## Request a CSV
|
1826
|
+
|
1827
|
+
### POST /messages/download
|
1828
|
+
|
1829
|
+
> In order to gain access to the Email Activity Feed API, you must purchase [additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity).
|
1830
|
+
|
1831
|
+
This request kicks of a process to generate a CSV file. When the file is generated, the email that is listed as the account owner gets an email that links out to the file that is ready for download. The link expires in 3 days.
|
1832
|
+
|
1833
|
+
The CSV fill contain the last 1 million messages. This endpoint will be rate limited to 1 request every 12 hours.
|
1834
|
+
|
1835
|
+
```ruby
|
1836
|
+
response = sg.client.messages.download.post()
|
1837
|
+
puts response.status_code
|
1838
|
+
puts response.body
|
1839
|
+
puts response.headers
|
1840
|
+
```
|
1841
|
+
|
1842
|
+
## Download CSV
|
1843
|
+
|
1844
|
+
### GET /messages/download/{download_uuid}
|
1845
|
+
|
1846
|
+
> In order to gain access to the Email Activity Feed API, you must purchase [additional email activity history](https://app.sendgrid.com/settings/billing/addons/email_activity).
|
1847
|
+
|
1848
|
+
Download the CSV that you requested with the POST Request a CSV.
|
1849
|
+
|
1850
|
+
When the file is generated, the email that is listed as the account owner gets an email that links out to the file that is ready for download. The link expires in 3 days.
|
1851
|
+
|
1852
|
+
The CSV fill contain the last 1 million messages. This endpoint will be rate limited to 1 request every 12 hours.
|
1853
|
+
|
1854
|
+
```ruby
|
1855
|
+
download_uuid = "test_url_param"
|
1856
|
+
response = sg.client.messages.download._(download_uuid).get
|
1857
|
+
puts response.status_code
|
1858
|
+
puts response.body
|
1859
|
+
puts response.headers
|
1860
|
+
```
|
1861
|
+
|
1862
|
+
|
1863
|
+
|
1757
1864
|
<a name="geo"></a>
|
1758
1865
|
# GEO
|
1759
1866
|
|
@@ -1782,7 +1889,7 @@ puts response.headers
|
|
1782
1889
|
|
1783
1890
|
**This endpoint allows you to retrieve a list of all assigned and unassigned IPs.**
|
1784
1891
|
|
1785
|
-
|
1892
|
+
The response includes warm up status, pools, assigned sub users, and authentication info. The start_date field corresponds to when warmup started for that IP.
|
1786
1893
|
|
1787
1894
|
A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it.
|
1788
1895
|
|
@@ -1817,9 +1924,9 @@ puts response.headers
|
|
1817
1924
|
|
1818
1925
|
**Each user can create up to 10 different IP pools.**
|
1819
1926
|
|
1820
|
-
IP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic.
|
1927
|
+
IP Pools allow you to group your dedicated Twilio SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic.
|
1821
1928
|
|
1822
|
-
IP pools can only be used with
|
1929
|
+
IP pools can only be used with authenticated IP addresses.
|
1823
1930
|
|
1824
1931
|
If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.
|
1825
1932
|
|
@@ -1839,9 +1946,9 @@ puts response.headers
|
|
1839
1946
|
|
1840
1947
|
**This endpoint allows you to retrieve all of your IP pools.**
|
1841
1948
|
|
1842
|
-
IP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic.
|
1949
|
+
IP Pools allow you to group your dedicated Twilio SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic.
|
1843
1950
|
|
1844
|
-
IP pools can only be used with
|
1951
|
+
IP pools can only be used with authenticated IP addresses.
|
1845
1952
|
|
1846
1953
|
If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.
|
1847
1954
|
|
@@ -1858,9 +1965,9 @@ puts response.headers
|
|
1858
1965
|
|
1859
1966
|
**This endpoint allows you to update the name of an IP pool.**
|
1860
1967
|
|
1861
|
-
IP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic.
|
1968
|
+
IP Pools allow you to group your dedicated Twilio SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic.
|
1862
1969
|
|
1863
|
-
IP pools can only be used with
|
1970
|
+
IP pools can only be used with authenticated IP addresses.
|
1864
1971
|
|
1865
1972
|
If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.
|
1866
1973
|
|
@@ -1881,9 +1988,9 @@ puts response.headers
|
|
1881
1988
|
|
1882
1989
|
**This endpoint allows you to list all of the IP addresses that are in a specific IP pool.**
|
1883
1990
|
|
1884
|
-
IP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic.
|
1991
|
+
IP Pools allow you to group your dedicated Twilio SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic.
|
1885
1992
|
|
1886
|
-
IP pools can only be used with
|
1993
|
+
IP pools can only be used with authenticated IP addresses.
|
1887
1994
|
|
1888
1995
|
If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.
|
1889
1996
|
|
@@ -1901,9 +2008,9 @@ puts response.headers
|
|
1901
2008
|
|
1902
2009
|
**This endpoint allows you to delete an IP pool.**
|
1903
2010
|
|
1904
|
-
IP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic.
|
2011
|
+
IP Pools allow you to group your dedicated Twilio SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic.
|
1905
2012
|
|
1906
|
-
IP pools can only be used with
|
2013
|
+
IP pools can only be used with authenticated IP addresses.
|
1907
2014
|
|
1908
2015
|
If an IP pool is NOT specified for an email, it will use any IP available, including ones in pools.
|
1909
2016
|
|
@@ -1961,7 +2068,7 @@ puts response.headers
|
|
1961
2068
|
|
1962
2069
|
**This endpoint allows you to enter an IP address into warmup mode.**
|
1963
2070
|
|
1964
|
-
SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how SendGrid limits your email traffic for IPs in warmup.
|
2071
|
+
Twilio SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how Twilio SendGrid limits your email traffic for IPs in warmup.
|
1965
2072
|
|
1966
2073
|
For more general information about warming up IPs, please see our [Classroom](https://sendgrid.com/docs/Classroom/Deliver/Delivery_Introduction/warming_up_ips.html).
|
1967
2074
|
|
@@ -1981,7 +2088,7 @@ puts response.headers
|
|
1981
2088
|
|
1982
2089
|
**This endpoint allows you to retrieve all of your IP addresses that are currently warming up.**
|
1983
2090
|
|
1984
|
-
SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how SendGrid limits your email traffic for IPs in warmup.
|
2091
|
+
Twilio SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how Twilio SendGrid limits your email traffic for IPs in warmup.
|
1985
2092
|
|
1986
2093
|
For more general information about warming up IPs, please see our [Classroom](https://sendgrid.com/docs/Classroom/Deliver/Delivery_Introduction/warming_up_ips.html).
|
1987
2094
|
|
@@ -1998,7 +2105,7 @@ puts response.headers
|
|
1998
2105
|
|
1999
2106
|
**This endpoint allows you to retrieve the warmup status for a specific IP address.**
|
2000
2107
|
|
2001
|
-
SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how SendGrid limits your email traffic for IPs in warmup.
|
2108
|
+
Twilio SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how Twilio SendGrid limits your email traffic for IPs in warmup.
|
2002
2109
|
|
2003
2110
|
For more general information about warming up IPs, please see our [Classroom](https://sendgrid.com/docs/Classroom/Deliver/Delivery_Introduction/warming_up_ips.html).
|
2004
2111
|
|
@@ -2016,7 +2123,7 @@ puts response.headers
|
|
2016
2123
|
|
2017
2124
|
**This endpoint allows you to remove an IP address from warmup mode.**
|
2018
2125
|
|
2019
|
-
SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how SendGrid limits your email traffic for IPs in warmup.
|
2126
|
+
Twilio SendGrid can automatically warm up dedicated IP addresses by limiting the amount of mail that can be sent through them per hour, with the limit determined by how long the IP address has been in warmup. See the [warmup schedule](https://sendgrid.com/docs/API_Reference/Web_API_v3/IP_Management/ip_warmup_schedule.html) for more details on how Twilio SendGrid limits your email traffic for IPs in warmup.
|
2020
2127
|
|
2021
2128
|
For more general information about warming up IPs, please see our [Classroom](https://sendgrid.com/docs/Classroom/Deliver/Delivery_Introduction/warming_up_ips.html).
|
2022
2129
|
|
@@ -2055,7 +2162,7 @@ puts response.headers
|
|
2055
2162
|
|
2056
2163
|
**This endpoint allows you to generate a new batch ID. This batch ID can be associated with scheduled sends via the mail/send endpoint.**
|
2057
2164
|
|
2058
|
-
If you set the SMTPAPI header `batch_id`, it allows you to then associate multiple scheduled mail/send requests together with the same ID. Then at
|
2165
|
+
If you set the SMTPAPI header `batch_id`, it allows you to then associate multiple scheduled mail/send requests together with the same ID. Then at any time up to 10 minutes before the scheduled date, you can cancel all of the mail/send requests that have this batch ID by calling the Cancel Scheduled Send endpoint.
|
2059
2166
|
|
2060
2167
|
More Information:
|
2061
2168
|
|
@@ -2074,7 +2181,7 @@ puts response.headers
|
|
2074
2181
|
|
2075
2182
|
**This endpoint allows you to validate a batch ID.**
|
2076
2183
|
|
2077
|
-
If you set the SMTPAPI header `batch_id`, it allows you to then associate multiple scheduled mail/send requests together with the same ID. Then at
|
2184
|
+
If you set the SMTPAPI header `batch_id`, it allows you to then associate multiple scheduled mail/send requests together with the same ID. Then at any time up to 10 minutes before the scheduled date, you can cancel all of the mail/send requests that have this batch ID by calling the Cancel Scheduled Send endpoint.
|
2078
2185
|
|
2079
2186
|
More Information:
|
2080
2187
|
|
@@ -2092,7 +2199,7 @@ puts response.headers
|
|
2092
2199
|
```
|
2093
2200
|
## v3 Mail Send
|
2094
2201
|
|
2095
|
-
This endpoint allows you to send email over
|
2202
|
+
This endpoint allows you to send an email over Twilio SendGrid's v3 Web API, the most recent version of our API. If you are looking for documentation about the v2 Mail Send endpoint, please see our [v2 API Reference](https://sendgrid.com/docs/API_Reference/Web_API/mail.html).
|
2096
2203
|
|
2097
2204
|
* Top level parameters are referred to as "global".
|
2098
2205
|
* Individual fields within the personalizations array will override any other global, or message level, parameters that are defined outside of personalizations.
|
@@ -2103,7 +2210,7 @@ For more detailed information about how to use the v3 Mail Send endpoint, please
|
|
2103
2210
|
|
2104
2211
|
### POST /mail/send
|
2105
2212
|
|
2106
|
-
This endpoint has a helper, check it out [here](
|
2213
|
+
This endpoint has a helper, check it out [here](lib/sendgrid/helpers/mail/README.md).
|
2107
2214
|
|
2108
2215
|
```ruby
|
2109
2216
|
data = JSON.parse('{
|
@@ -2157,8 +2264,8 @@ data = JSON.parse('{
|
|
2157
2264
|
},
|
2158
2265
|
"footer": {
|
2159
2266
|
"enable": true,
|
2160
|
-
"html": "<p>Thanks</br>The SendGrid Team</p>",
|
2161
|
-
"text": "Thanks,/n The SendGrid Team"
|
2267
|
+
"html": "<p>Thanks</br>The Twilio SendGrid Team</p>",
|
2268
|
+
"text": "Thanks,/n The Twilio SendGrid Team"
|
2162
2269
|
},
|
2163
2270
|
"sandbox_mode": {
|
2164
2271
|
"enable": false
|
@@ -2256,7 +2363,7 @@ puts response.headers
|
|
2256
2363
|
|
2257
2364
|
**This endpoint allows you to retrieve a list of all mail settings.**
|
2258
2365
|
|
2259
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2366
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2260
2367
|
|
2261
2368
|
### GET /mail_settings
|
2262
2369
|
|
@@ -2274,7 +2381,7 @@ puts response.headers
|
|
2274
2381
|
|
2275
2382
|
The address whitelist setting whitelists a specified email address or domain for which mail should never be suppressed. For example, you own the domain example.com, and one or more of your recipients use email@example.com addresses, by placing example.com in the address whitelist setting, all bounces, blocks, and unsubscribes logged for that domain will be ignored and sent as if under normal sending conditions.
|
2276
2383
|
|
2277
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2384
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2278
2385
|
|
2279
2386
|
### PATCH /mail_settings/address_whitelist
|
2280
2387
|
|
@@ -2298,7 +2405,7 @@ puts response.headers
|
|
2298
2405
|
|
2299
2406
|
The address whitelist setting whitelists a specified email address or domain for which mail should never be suppressed. For example, you own the domain example.com, and one or more of your recipients use email@example.com addresses, by placing example.com in the address whitelist setting, all bounces, blocks, and unsubscribes logged for that domain will be ignored and sent as if under normal sending conditions.
|
2300
2407
|
|
2301
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2408
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2302
2409
|
|
2303
2410
|
### GET /mail_settings/address_whitelist
|
2304
2411
|
|
@@ -2313,9 +2420,9 @@ puts response.headers
|
|
2313
2420
|
|
2314
2421
|
**This endpoint allows you to update your current BCC mail settings.**
|
2315
2422
|
|
2316
|
-
When the BCC mail setting is enabled, SendGrid will automatically send a blind carbon copy (BCC) to an address for every email sent without adding that address to the header. Please note that only one email address may be entered in this field
|
2423
|
+
When the BCC mail setting is enabled, Twilio SendGrid will automatically send a blind carbon copy (BCC) to an address for every email sent without adding that address to the header. Please note that only one email address may be entered in this field if you wish to distribute BCCs to multiple addresses you will need to create a distribution group or use forwarding rules.
|
2317
2424
|
|
2318
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2425
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2319
2426
|
|
2320
2427
|
### PATCH /mail_settings/bcc
|
2321
2428
|
|
@@ -2334,9 +2441,9 @@ puts response.headers
|
|
2334
2441
|
|
2335
2442
|
**This endpoint allows you to retrieve your current BCC mail settings.**
|
2336
2443
|
|
2337
|
-
When the BCC mail setting is enabled, SendGrid will automatically send a blind carbon copy (BCC) to an address for every email sent without adding that address to the header. Please note that only one email address may be entered in this field
|
2444
|
+
When the BCC mail setting is enabled, Twilio SendGrid will automatically send a blind carbon copy (BCC) to an address for every email sent without adding that address to the header. Please note that only one email address may be entered in this field if you wish to distribute BCCs to multiple addresses you will need to create a distribution group or use forwarding rules.
|
2338
2445
|
|
2339
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2446
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2340
2447
|
|
2341
2448
|
### GET /mail_settings/bcc
|
2342
2449
|
|
@@ -2351,9 +2458,9 @@ puts response.headers
|
|
2351
2458
|
|
2352
2459
|
**This endpoint allows you to update your current bounce purge settings.**
|
2353
2460
|
|
2354
|
-
This setting allows you to set a schedule for SendGrid to automatically delete contacts from your soft and hard bounce suppression lists.
|
2461
|
+
This setting allows you to set a schedule for Twilio SendGrid to automatically delete contacts from your soft and hard bounce suppression lists.
|
2355
2462
|
|
2356
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2463
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2357
2464
|
|
2358
2465
|
### PATCH /mail_settings/bounce_purge
|
2359
2466
|
|
@@ -2373,9 +2480,9 @@ puts response.headers
|
|
2373
2480
|
|
2374
2481
|
**This endpoint allows you to retrieve your current bounce purge settings.**
|
2375
2482
|
|
2376
|
-
This setting allows you to set a schedule for SendGrid to automatically delete contacts from your soft and hard bounce suppression lists.
|
2483
|
+
This setting allows you to set a schedule for Twilio SendGrid to automatically delete contacts from your soft and hard bounce suppression lists.
|
2377
2484
|
|
2378
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2485
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2379
2486
|
|
2380
2487
|
### GET /mail_settings/bounce_purge
|
2381
2488
|
|
@@ -2392,7 +2499,7 @@ puts response.headers
|
|
2392
2499
|
|
2393
2500
|
The footer setting will insert a custom footer at the bottom of the text and HTML bodies. Use the embedded HTML editor and plain text entry fields to create the content of the footers to be inserted into your emails.
|
2394
2501
|
|
2395
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2502
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2396
2503
|
|
2397
2504
|
### PATCH /mail_settings/footer
|
2398
2505
|
|
@@ -2414,7 +2521,7 @@ puts response.headers
|
|
2414
2521
|
|
2415
2522
|
The footer setting will insert a custom footer at the bottom of the text and HTML bodies. Use the embedded HTML editor and plain text entry fields to create the content of the footers to be inserted into your emails.
|
2416
2523
|
|
2417
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2524
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2418
2525
|
|
2419
2526
|
### GET /mail_settings/footer
|
2420
2527
|
|
@@ -2431,7 +2538,7 @@ puts response.headers
|
|
2431
2538
|
|
2432
2539
|
Activating this setting allows you to specify an email address to which bounce reports are forwarded.
|
2433
2540
|
|
2434
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2541
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2435
2542
|
|
2436
2543
|
### PATCH /mail_settings/forward_bounce
|
2437
2544
|
|
@@ -2452,7 +2559,7 @@ puts response.headers
|
|
2452
2559
|
|
2453
2560
|
Activating this setting allows you to specify an email address to which bounce reports are forwarded.
|
2454
2561
|
|
2455
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2562
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2456
2563
|
|
2457
2564
|
### GET /mail_settings/forward_bounce
|
2458
2565
|
|
@@ -2469,7 +2576,7 @@ puts response.headers
|
|
2469
2576
|
|
2470
2577
|
Enabling the forward spam setting allows you to specify an email address to which spam reports will be forwarded.
|
2471
2578
|
|
2472
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2579
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2473
2580
|
|
2474
2581
|
### PATCH /mail_settings/forward_spam
|
2475
2582
|
|
@@ -2490,7 +2597,7 @@ puts response.headers
|
|
2490
2597
|
|
2491
2598
|
Enabling the forward spam setting allows you to specify an email address to which spam reports will be forwarded.
|
2492
2599
|
|
2493
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2600
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2494
2601
|
|
2495
2602
|
### GET /mail_settings/forward_spam
|
2496
2603
|
|
@@ -2507,7 +2614,7 @@ puts response.headers
|
|
2507
2614
|
|
2508
2615
|
The plain content setting will automatically convert any plain text emails that you send to HTML before sending.
|
2509
2616
|
|
2510
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2617
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2511
2618
|
|
2512
2619
|
### PATCH /mail_settings/plain_content
|
2513
2620
|
|
@@ -2527,7 +2634,7 @@ puts response.headers
|
|
2527
2634
|
|
2528
2635
|
The plain content setting will automatically convert any plain text emails that you send to HTML before sending.
|
2529
2636
|
|
2530
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2637
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2531
2638
|
|
2532
2639
|
### GET /mail_settings/plain_content
|
2533
2640
|
|
@@ -2544,7 +2651,7 @@ puts response.headers
|
|
2544
2651
|
|
2545
2652
|
The spam checker filter notifies you when emails are detected that exceed a predefined spam threshold.
|
2546
2653
|
|
2547
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2654
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2548
2655
|
|
2549
2656
|
### PATCH /mail_settings/spam_check
|
2550
2657
|
|
@@ -2566,7 +2673,7 @@ puts response.headers
|
|
2566
2673
|
|
2567
2674
|
The spam checker filter notifies you when emails are detected that exceed a predefined spam threshold.
|
2568
2675
|
|
2569
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2676
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2570
2677
|
|
2571
2678
|
### GET /mail_settings/spam_check
|
2572
2679
|
|
@@ -2585,7 +2692,7 @@ This setting refers to our original email templates. We currently support more f
|
|
2585
2692
|
|
2586
2693
|
The legacy email template setting wraps an HTML template around your email content. This can be useful for sending out marketing email and/or other HTML formatted messages.
|
2587
2694
|
|
2588
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2695
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2589
2696
|
|
2590
2697
|
### PATCH /mail_settings/template
|
2591
2698
|
|
@@ -2608,7 +2715,7 @@ This setting refers to our original email templates. We currently support more f
|
|
2608
2715
|
|
2609
2716
|
The legacy email template setting wraps an HTML template around your email content. This can be useful for sending out marketing email and/or other HTML formatted messages.
|
2610
2717
|
|
2611
|
-
Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over
|
2718
|
+
Mail settings allow you to tell Twilio SendGrid specific things to do to every email that you send to your recipients over Twilio SendGrid's [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html).
|
2612
2719
|
|
2613
2720
|
### GET /mail_settings/template
|
2614
2721
|
|
@@ -2647,7 +2754,7 @@ puts response.headers
|
|
2647
2754
|
|
2648
2755
|
**This endpoint allows you to retrieve a list of all partner settings that you can enable.**
|
2649
2756
|
|
2650
|
-
Our partner settings allow you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/partners.html).
|
2757
|
+
Our partner settings allow you to integrate your Twilio SendGrid account with our partners to increase your Twilio SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/partners.html).
|
2651
2758
|
|
2652
2759
|
### GET /partner_settings
|
2653
2760
|
|
@@ -2663,9 +2770,9 @@ puts response.headers
|
|
2663
2770
|
|
2664
2771
|
**This endpoint allows you to update or change your New Relic partner settings.**
|
2665
2772
|
|
2666
|
-
Our partner settings allow you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/partners.html).
|
2773
|
+
Our partner settings allow you to integrate your Twilio SendGrid account with our partners to increase your Twilio SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/partners.html).
|
2667
2774
|
|
2668
|
-
By integrating with New Relic, you can send your SendGrid email statistics to your New Relic Dashboard. If you enable this setting, your stats will be sent to New Relic every 5 minutes. You will need your New Relic License Key to enable this setting. For more information, please see our [Classroom](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/new_relic.html).
|
2775
|
+
By integrating with New Relic, you can send your Twilio SendGrid email statistics to your New Relic Dashboard. If you enable this setting, your stats will be sent to New Relic every 5 minutes. You will need your New Relic License Key to enable this setting. For more information, please see our [Classroom](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/new_relic.html).
|
2669
2776
|
|
2670
2777
|
### PATCH /partner_settings/new_relic
|
2671
2778
|
|
@@ -2685,9 +2792,9 @@ puts response.headers
|
|
2685
2792
|
|
2686
2793
|
**This endpoint allows you to retrieve your current New Relic partner settings.**
|
2687
2794
|
|
2688
|
-
Our partner settings allow you to integrate your SendGrid account with our partners to increase your SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/partners.html).
|
2795
|
+
Our partner settings allow you to integrate your Twilio SendGrid account with our partners to increase your Twilio SendGrid experience and functionality. For more information about our partners, and how you can begin integrating with them, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/partners.html).
|
2689
2796
|
|
2690
|
-
By integrating with New Relic, you can send your SendGrid email statistics to your New Relic Dashboard. If you enable this setting, your stats will be sent to New Relic every 5 minutes. You will need your New Relic License Key to enable this setting. For more information, please see our [Classroom](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/new_relic.html).
|
2797
|
+
By integrating with New Relic, you can send your Twilio SendGrid email statistics to your New Relic Dashboard. If you enable this setting, your stats will be sent to New Relic every 5 minutes. You will need your New Relic License Key to enable this setting. For more information, please see our [Classroom](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/new_relic.html).
|
2691
2798
|
|
2692
2799
|
### GET /partner_settings/new_relic
|
2693
2800
|
|
@@ -2705,7 +2812,7 @@ puts response.headers
|
|
2705
2812
|
|
2706
2813
|
**This endpoint returns a list of all scopes that this user has access to.**
|
2707
2814
|
|
2708
|
-
API Keys can be used to authenticate the use of [
|
2815
|
+
API Keys can be used to authenticate the use of [Twilio SendGrid's v3 Web API](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html), or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html). API Keys may be assigned certain permissions, or scopes, that limit which API endpoints they are able to access. For a more detailed explanation of how you can use API Key permissions, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/api_keys.html#-API-Key-Permissions) or [Classroom](https://sendgrid.com/docs/Classroom/Basics/API/api_key_permissions.html).
|
2709
2816
|
|
2710
2817
|
### GET /scopes
|
2711
2818
|
|
@@ -2725,7 +2832,7 @@ puts response.headers
|
|
2725
2832
|
|
2726
2833
|
*You may create up to 100 unique sender identities.*
|
2727
2834
|
|
2728
|
-
Sender Identities are required to be verified before use. If your domain has been
|
2835
|
+
Sender Identities are required to be verified before use. If your domain has been authenticated, it will auto verify on creation. Otherwise, an email will be sent to the `from.email`.
|
2729
2836
|
|
2730
2837
|
### POST /senders
|
2731
2838
|
|
@@ -2757,7 +2864,7 @@ puts response.headers
|
|
2757
2864
|
|
2758
2865
|
**This endpoint allows you to retrieve a list of all sender identities that have been created for your account.**
|
2759
2866
|
|
2760
|
-
Sender Identities are required to be verified before use. If your domain has been
|
2867
|
+
Sender Identities are required to be verified before use. If your domain has been authenticated, it will auto verify on creation. Otherwise, an email will be sent to the `from.email`.
|
2761
2868
|
|
2762
2869
|
### GET /senders
|
2763
2870
|
|
@@ -2772,7 +2879,7 @@ puts response.headers
|
|
2772
2879
|
|
2773
2880
|
**This endpoint allows you to update a sender identity.**
|
2774
2881
|
|
2775
|
-
Updates to `from.email` require re-verification. If your domain has been
|
2882
|
+
Updates to `from.email` require re-verification. If your domain has been authenticated, it will auto verify on creation. Otherwise, an email will be sent to the `from.email`.
|
2776
2883
|
|
2777
2884
|
Partial updates are allowed, but fields that are marked as "required" in the POST (create) endpoint must not be nil if that field is included in the PATCH request.
|
2778
2885
|
|
@@ -2807,7 +2914,7 @@ puts response.headers
|
|
2807
2914
|
|
2808
2915
|
**This endpoint allows you to retrieve a specific sender identity.**
|
2809
2916
|
|
2810
|
-
Sender Identities are required to be verified before use. If your domain has been
|
2917
|
+
Sender Identities are required to be verified before use. If your domain has been authenticated, it will auto verify on creation. Otherwise, an email will be sent to the `from.email`.
|
2811
2918
|
|
2812
2919
|
### GET /senders/{sender_id}
|
2813
2920
|
|
@@ -2823,7 +2930,7 @@ puts response.headers
|
|
2823
2930
|
|
2824
2931
|
**This endpoint allows you to delete one of your sender identities.**
|
2825
2932
|
|
2826
|
-
Sender Identities are required to be verified before use. If your domain has been
|
2933
|
+
Sender Identities are required to be verified before use. If your domain has been authenticated, it will auto verify on creation. Otherwise, an email will be sent to the `from.email`.
|
2827
2934
|
|
2828
2935
|
### DELETE /senders/{sender_id}
|
2829
2936
|
|
@@ -2839,7 +2946,7 @@ puts response.headers
|
|
2839
2946
|
|
2840
2947
|
**This endpoint allows you to resend a sender identity verification email.**
|
2841
2948
|
|
2842
|
-
Sender Identities are required to be verified before use. If your domain has been
|
2949
|
+
Sender Identities are required to be verified before use. If your domain has been authenticated, it will auto verify on creation. Otherwise, an email will be sent to the `from.email`.
|
2843
2950
|
|
2844
2951
|
### POST /senders/{sender_id}/resend_verification
|
2845
2952
|
|
@@ -2851,2184 +2958,2186 @@ puts response.status_code
|
|
2851
2958
|
puts response.body
|
2852
2959
|
puts response.headers
|
2853
2960
|
```
|
2854
|
-
<a name="stats"></a>
|
2855
|
-
# STATS
|
2856
|
-
|
2857
|
-
## Retrieve global email statistics
|
2858
|
-
|
2859
|
-
**This endpoint allows you to retrieve all of your global email statistics between a given date range.**
|
2860
|
-
|
2861
|
-
Parent accounts will see aggregated stats for their account and all subuser accounts. Subuser accounts will only see their own stats.
|
2862
|
-
|
2863
|
-
### GET /stats
|
2864
2961
|
|
2962
|
+
<a name="sender-authentication"></a>
|
2963
|
+
# SENDER AUTHENTICATION
|
2865
2964
|
|
2866
|
-
|
2867
|
-
params = JSON.parse('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}')
|
2868
|
-
response = sg.client.stats.get(query_params: params)
|
2869
|
-
puts response.status_code
|
2870
|
-
puts response.body
|
2871
|
-
puts response.headers
|
2872
|
-
```
|
2873
|
-
<a name="subusers"></a>
|
2874
|
-
# SUBUSERS
|
2965
|
+
## Create an authenticated domain.
|
2875
2966
|
|
2876
|
-
|
2967
|
+
**This endpoint allows you to create a domain authentication for one of your domains.**
|
2877
2968
|
|
2878
|
-
|
2969
|
+
If you are creating a domain authentication that you would like a subuser to use, you have two options:
|
2970
|
+
1. Use the "username" parameter. This allows you to create am authenticated subuser. This means the subuser is able to see and modify the created authentication.
|
2971
|
+
2. Use the Association workflow (see Associate Domain section). This allows you to assign a domain authentication created by the parent to a subuser. This means the subuser will default to the assigned domain authentication, but will not be able to see or modify that authentication. However, if the subuser creates their own domain authentication it will overwrite the assigned domain authentication.
|
2879
2972
|
|
2880
|
-
|
2973
|
+
A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
|
2881
2974
|
|
2882
|
-
|
2883
|
-
* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)
|
2975
|
+
For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
|
2884
2976
|
|
2885
|
-
### POST /
|
2977
|
+
### POST /whitelabel/domains
|
2886
2978
|
|
2887
2979
|
|
2888
2980
|
```ruby
|
2889
2981
|
data = JSON.parse('{
|
2890
|
-
"
|
2982
|
+
"automatic_security": false,
|
2983
|
+
"custom_spf": true,
|
2984
|
+
"default": true,
|
2985
|
+
"domain": "example.com",
|
2891
2986
|
"ips": [
|
2892
|
-
"
|
2893
|
-
"
|
2987
|
+
"192.168.1.1",
|
2988
|
+
"192.168.1.2"
|
2894
2989
|
],
|
2895
|
-
"
|
2896
|
-
"username": "
|
2990
|
+
"subdomain": "news",
|
2991
|
+
"username": "john@example.com"
|
2897
2992
|
}')
|
2898
|
-
response = sg.client.
|
2993
|
+
response = sg.client.whitelabel.domains.post(request_body: data)
|
2899
2994
|
puts response.status_code
|
2900
2995
|
puts response.body
|
2901
2996
|
puts response.headers
|
2902
2997
|
```
|
2903
|
-
## List all
|
2904
|
-
|
2905
|
-
This endpoint allows you to retrieve a list of all of your subusers. You can choose to retrieve specific subusers as well as limit the results that come back from the API.
|
2906
|
-
|
2907
|
-
For more information about Subusers:
|
2908
|
-
|
2909
|
-
* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)
|
2910
|
-
* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)
|
2911
|
-
|
2912
|
-
### GET /subusers
|
2998
|
+
## List all domain authentications.
|
2913
2999
|
|
3000
|
+
**This endpoint allows you to retrieve a list of all domain authentications you have created.**
|
2914
3001
|
|
2915
|
-
|
2916
|
-
params = JSON.parse('{"username": "test_string", "limit": 1, "offset": 1}')
|
2917
|
-
response = sg.client.subusers.get(query_params: params)
|
2918
|
-
puts response.status_code
|
2919
|
-
puts response.body
|
2920
|
-
puts response.headers
|
2921
|
-
```
|
2922
|
-
## Retrieve Subuser Reputations
|
3002
|
+
A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
|
2923
3003
|
|
2924
|
-
|
3004
|
+
For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
|
2925
3005
|
|
2926
|
-
This endpoint allows you to request the reputations for your subusers.
|
2927
3006
|
|
2928
|
-
### GET /
|
3007
|
+
### GET /whitelabel/domains
|
2929
3008
|
|
2930
3009
|
|
2931
3010
|
```ruby
|
2932
|
-
params = JSON.parse('{"
|
2933
|
-
response = sg.client.
|
3011
|
+
params = JSON.parse('{"username": "test_string", "domain": "test_string", "exclude_subusers": "true", "limit": 1, "offset": 1}')
|
3012
|
+
response = sg.client.whitelabel.domains.get(query_params: params)
|
2934
3013
|
puts response.status_code
|
2935
3014
|
puts response.body
|
2936
3015
|
puts response.headers
|
2937
3016
|
```
|
2938
|
-
##
|
3017
|
+
## Get the default domain authentication.
|
2939
3018
|
|
2940
|
-
**This endpoint allows you to retrieve the
|
3019
|
+
**This endpoint allows you to retrieve the default authentication for a domain.**
|
2941
3020
|
|
2942
|
-
You
|
3021
|
+
A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
|
2943
3022
|
|
2944
|
-
|
3023
|
+
For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
|
2945
3024
|
|
2946
|
-
|
3025
|
+
## URI Parameters
|
3026
|
+
| URI Parameter | Type | Description |
|
3027
|
+
|---|---|---|
|
3028
|
+
| domain | string |The domain to find a default domain whitelabel for. |
|
2947
3029
|
|
2948
|
-
### GET /
|
3030
|
+
### GET /whitelabel/domains/default
|
2949
3031
|
|
2950
3032
|
|
2951
3033
|
```ruby
|
2952
|
-
|
2953
|
-
response = sg.client.subusers.stats.get(query_params: params)
|
3034
|
+
response = sg.client.whitelabel.domains.default.get()
|
2954
3035
|
puts response.status_code
|
2955
3036
|
puts response.body
|
2956
3037
|
puts response.headers
|
2957
3038
|
```
|
2958
|
-
##
|
3039
|
+
## List the domain authentication associated with the given user.
|
2959
3040
|
|
2960
|
-
**This endpoint allows you to retrieve the
|
3041
|
+
**This endpoint allows you to retrieve all of the domain authentications that have been assigned to a specific subuser.**
|
2961
3042
|
|
2962
|
-
|
3043
|
+
A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
|
2963
3044
|
|
2964
|
-
|
2965
|
-
`bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`.
|
3045
|
+
Domain authentications can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's authenticated domains. To associate a domain authentication with a subuser, the parent account must first create the domain authentication and validate it. The parent may then associate the domain authentication via the subuser management tools.
|
2966
3046
|
|
2967
|
-
For more information, see our [User Guide](https://sendgrid.com/docs/
|
3047
|
+
For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
|
2968
3048
|
|
2969
|
-
|
3049
|
+
## URI Parameters
|
3050
|
+
| URI Parameter | Type | Description |
|
3051
|
+
|---|---|---|
|
3052
|
+
| username | string | Username of the subuser to find associated whitelabels for. |
|
3053
|
+
|
3054
|
+
### GET /whitelabel/domains/subuser
|
2970
3055
|
|
2971
3056
|
|
2972
3057
|
```ruby
|
2973
|
-
|
2974
|
-
response = sg.client.subusers.stats.monthly.get(query_params: params)
|
3058
|
+
response = sg.client.whitelabel.domains.subuser.get()
|
2975
3059
|
puts response.status_code
|
2976
3060
|
puts response.body
|
2977
3061
|
puts response.headers
|
2978
3062
|
```
|
2979
|
-
##
|
3063
|
+
## Disassociate a domain authentication from a given user.
|
2980
3064
|
|
2981
|
-
**This endpoint allows you to
|
3065
|
+
**This endpoint allows you to disassociate a specific domain authentication from a subuser.**
|
2982
3066
|
|
3067
|
+
A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
|
2983
3068
|
|
2984
|
-
|
3069
|
+
Domain authentications can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's authenticated domains. To associate a domain authentication with a subuser, the parent account must first create the domain authentication and validate it. The parent may then associate the domain authentication via the subuser management tools.
|
2985
3070
|
|
2986
|
-
For more information, see our [User Guide](https://sendgrid.com/docs/
|
3071
|
+
For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
|
2987
3072
|
|
2988
|
-
|
3073
|
+
## URI Parameters
|
3074
|
+
| URI Parameter | Type | Required? | Description |
|
3075
|
+
|---|---|---|---|
|
3076
|
+
| username | string | required | Username for the subuser to find associated whitelabels for. |
|
3077
|
+
|
3078
|
+
### DELETE /whitelabel/domains/subuser
|
2989
3079
|
|
2990
3080
|
|
2991
3081
|
```ruby
|
2992
|
-
|
2993
|
-
response = sg.client.subusers.stats.sums.get(query_params: params)
|
3082
|
+
response = sg.client.whitelabel.domains.subuser.delete()
|
2994
3083
|
puts response.status_code
|
2995
3084
|
puts response.body
|
2996
3085
|
puts response.headers
|
2997
3086
|
```
|
2998
|
-
##
|
3087
|
+
## Update a domain authentication.
|
2999
3088
|
|
3000
|
-
This endpoint allows you to
|
3089
|
+
**This endpoint allows you to update the settings for a domain authentication.**
|
3001
3090
|
|
3002
|
-
|
3091
|
+
A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
|
3003
3092
|
|
3004
|
-
|
3005
|
-
* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)
|
3093
|
+
For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
|
3006
3094
|
|
3007
|
-
### PATCH /
|
3095
|
+
### PATCH /whitelabel/domains/{domain_id}
|
3008
3096
|
|
3009
3097
|
|
3010
3098
|
```ruby
|
3011
3099
|
data = JSON.parse('{
|
3012
|
-
"
|
3100
|
+
"custom_spf": true,
|
3101
|
+
"default": false
|
3013
3102
|
}')
|
3014
|
-
|
3015
|
-
response = sg.client.
|
3103
|
+
domain_id = "test_url_param"
|
3104
|
+
response = sg.client.whitelabel.domains._(domain_id).patch(request_body: data)
|
3016
3105
|
puts response.status_code
|
3017
3106
|
puts response.body
|
3018
3107
|
puts response.headers
|
3019
3108
|
```
|
3020
|
-
##
|
3109
|
+
## Retrieve a domain authentication.
|
3021
3110
|
|
3022
|
-
This endpoint allows you to
|
3111
|
+
**This endpoint allows you to retrieve a specific domain authentication.**
|
3023
3112
|
|
3024
|
-
|
3113
|
+
A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
|
3025
3114
|
|
3026
|
-
|
3027
|
-
* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)
|
3115
|
+
For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
|
3028
3116
|
|
3029
|
-
|
3117
|
+
|
3118
|
+
### GET /whitelabel/domains/{domain_id}
|
3030
3119
|
|
3031
3120
|
|
3032
3121
|
```ruby
|
3033
|
-
|
3034
|
-
response = sg.client.
|
3122
|
+
domain_id = "test_url_param"
|
3123
|
+
response = sg.client.whitelabel.domains._(domain_id).get()
|
3035
3124
|
puts response.status_code
|
3036
3125
|
puts response.body
|
3037
3126
|
puts response.headers
|
3038
3127
|
```
|
3039
|
-
##
|
3128
|
+
## Delete a domain authentication.
|
3040
3129
|
|
3041
|
-
|
3130
|
+
**This endpoint allows you to delete a domain authentication.**
|
3042
3131
|
|
3043
|
-
|
3132
|
+
A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
|
3044
3133
|
|
3045
|
-
|
3046
|
-
* [IPs can be whitelabeled](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/ips.html)
|
3134
|
+
For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
|
3047
3135
|
|
3048
|
-
###
|
3136
|
+
### DELETE /whitelabel/domains/{domain_id}
|
3049
3137
|
|
3050
3138
|
|
3051
3139
|
```ruby
|
3052
|
-
|
3053
|
-
|
3054
|
-
]')
|
3055
|
-
subuser_name = "test_url_param"
|
3056
|
-
response = sg.client.subusers._(subuser_name).ips.put(request_body: data)
|
3140
|
+
domain_id = "test_url_param"
|
3141
|
+
response = sg.client.whitelabel.domains._(domain_id).delete()
|
3057
3142
|
puts response.status_code
|
3058
3143
|
puts response.body
|
3059
3144
|
puts response.headers
|
3060
3145
|
```
|
3061
|
-
##
|
3146
|
+
## Associate a domain authentication with a given user.
|
3062
3147
|
|
3063
|
-
|
3148
|
+
**This endpoint allows you to associate a specific domain authentication with a subuser.**
|
3064
3149
|
|
3065
|
-
|
3150
|
+
A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
|
3151
|
+
|
3152
|
+
Domain authentications can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's authenticated domains. To associate a domain authentication with a subuser, the parent account must first create the domain authentication and validate it. The parent may then associate the domain authentication via the subuser management tools.
|
3153
|
+
|
3154
|
+
For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
|
3155
|
+
|
3156
|
+
## URI Parameters
|
3157
|
+
| URI Parameter | Type | Description |
|
3158
|
+
|---|---|---|
|
3159
|
+
| domain_id | integer | ID of the domain whitelabel to associate with the subuser. |
|
3160
|
+
|
3161
|
+
### POST /whitelabel/domains/{domain_id}/subuser
|
3066
3162
|
|
3067
3163
|
|
3068
3164
|
```ruby
|
3069
3165
|
data = JSON.parse('{
|
3070
|
-
"
|
3071
|
-
"frequency": 500
|
3166
|
+
"username": "jane@example.com"
|
3072
3167
|
}')
|
3073
|
-
|
3074
|
-
response = sg.client.
|
3168
|
+
domain_id = "test_url_param"
|
3169
|
+
response = sg.client.whitelabel.domains._(domain_id).subuser.post(request_body: data)
|
3075
3170
|
puts response.status_code
|
3076
3171
|
puts response.body
|
3077
3172
|
puts response.headers
|
3078
3173
|
```
|
3079
|
-
##
|
3174
|
+
## Add an IP to a domain authentication.
|
3080
3175
|
|
3081
|
-
|
3176
|
+
**This endpoint allows you to add an IP address to a domain authentication.**
|
3082
3177
|
|
3083
|
-
|
3178
|
+
A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
|
3179
|
+
|
3180
|
+
For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
|
3181
|
+
|
3182
|
+
## URI Parameters
|
3183
|
+
| URI Parameter | Type | Description |
|
3184
|
+
|---|---|---|
|
3185
|
+
| id | integer | ID of the domain to which you are adding an IP |
|
3186
|
+
|
3187
|
+
### POST /whitelabel/domains/{id}/ips
|
3084
3188
|
|
3085
3189
|
|
3086
3190
|
```ruby
|
3087
3191
|
data = JSON.parse('{
|
3088
|
-
"
|
3089
|
-
"frequency": 50000
|
3192
|
+
"ip": "192.168.0.1"
|
3090
3193
|
}')
|
3091
|
-
|
3092
|
-
response = sg.client.
|
3194
|
+
id = "test_url_param"
|
3195
|
+
response = sg.client.whitelabel.domains._(id).ips.post(request_body: data)
|
3093
3196
|
puts response.status_code
|
3094
3197
|
puts response.body
|
3095
3198
|
puts response.headers
|
3096
3199
|
```
|
3097
|
-
##
|
3200
|
+
## Remove an IP from a domain authentication.
|
3098
3201
|
|
3099
|
-
|
3202
|
+
**This endpoint allows you to remove a domain's IP address from that domain's authentication.**
|
3100
3203
|
|
3101
|
-
|
3204
|
+
A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
|
3102
3205
|
|
3206
|
+
For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
|
3103
3207
|
|
3104
|
-
|
3105
|
-
|
3106
|
-
|
3107
|
-
|
3108
|
-
|
3109
|
-
puts response.headers
|
3110
|
-
```
|
3111
|
-
## Delete monitor settings
|
3112
|
-
|
3113
|
-
Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.
|
3208
|
+
## URI Parameters
|
3209
|
+
| URI Parameter | Type | Description |
|
3210
|
+
|---|---|---|
|
3211
|
+
| id | integer | ID of the domain whitelabel to delete the IP from. |
|
3212
|
+
| ip | string | IP to remove from the domain whitelabel. |
|
3114
3213
|
|
3115
|
-
### DELETE /
|
3214
|
+
### DELETE /whitelabel/domains/{id}/ips/{ip}
|
3116
3215
|
|
3117
3216
|
|
3118
3217
|
```ruby
|
3119
|
-
|
3120
|
-
|
3218
|
+
id = "test_url_param"
|
3219
|
+
ip = "test_url_param"
|
3220
|
+
response = sg.client.whitelabel.domains._(id).ips._(ip).delete()
|
3121
3221
|
puts response.status_code
|
3122
3222
|
puts response.body
|
3123
3223
|
puts response.headers
|
3124
3224
|
```
|
3125
|
-
##
|
3225
|
+
## Validate a domain authentication.
|
3126
3226
|
|
3127
|
-
**This endpoint allows you to
|
3227
|
+
**This endpoint allows you to validate a domain authentication. If it fails, it will return an error message describing why the domain could not be validated.**
|
3128
3228
|
|
3129
|
-
|
3229
|
+
A domain authentication allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Authenticating a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that Twilio SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, Twilio SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
|
3130
3230
|
|
3131
|
-
|
3132
|
-
`bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`.
|
3231
|
+
For more information on domain authentication, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/)
|
3133
3232
|
|
3134
|
-
|
3233
|
+
## URI Parameters
|
3234
|
+
| URI Parameter | Type | Description |
|
3235
|
+
|---|---|---|
|
3236
|
+
| id | integer |ID of the domain whitelabel to validate. |
|
3135
3237
|
|
3136
|
-
###
|
3238
|
+
### POST /whitelabel/domains/{id}/validate
|
3137
3239
|
|
3138
3240
|
|
3139
3241
|
```ruby
|
3140
|
-
|
3141
|
-
|
3142
|
-
response = sg.client.subusers._(subuser_name).stats.monthly.get(query_params: params)
|
3242
|
+
id = "test_url_param"
|
3243
|
+
response = sg.client.whitelabel.domains._(id).validate.post()
|
3143
3244
|
puts response.status_code
|
3144
3245
|
puts response.body
|
3145
3246
|
puts response.headers
|
3146
3247
|
```
|
3147
|
-
|
3148
|
-
# SUPPRESSION
|
3248
|
+
## Create reverse DNS record
|
3149
3249
|
|
3150
|
-
|
3250
|
+
**This endpoint allows you to create a reverse DNS record.**
|
3151
3251
|
|
3152
|
-
|
3252
|
+
When creating a reverse DNS record, you should use the same subdomain that you used when you created a domain authentication.
|
3153
3253
|
|
3154
|
-
|
3254
|
+
Reverse DNS consists of a subdomain and domain that will be used to generate a record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.
|
3155
3255
|
|
3156
|
-
For more information, please see our [User Guide](https://sendgrid.com/docs/
|
3256
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/).
|
3157
3257
|
|
3158
|
-
###
|
3258
|
+
### POST /whitelabel/ips
|
3159
3259
|
|
3160
3260
|
|
3161
3261
|
```ruby
|
3162
|
-
|
3163
|
-
|
3262
|
+
data = JSON.parse('{
|
3263
|
+
"domain": "example.com",
|
3264
|
+
"ip": "192.168.1.1",
|
3265
|
+
"subdomain": "email"
|
3266
|
+
}')
|
3267
|
+
response = sg.client.whitelabel.ips.post(request_body: data)
|
3164
3268
|
puts response.status_code
|
3165
3269
|
puts response.body
|
3166
3270
|
puts response.headers
|
3167
3271
|
```
|
3168
|
-
##
|
3272
|
+
## Retrieve all reverse DNS records
|
3169
3273
|
|
3170
|
-
**This endpoint allows you to
|
3171
|
-
|
3172
|
-
There are two options for deleting blocked emails:
|
3274
|
+
**This endpoint allows you to retrieve all of the reverse DNS records that have been created by this account.**
|
3173
3275
|
|
3174
|
-
|
3175
|
-
2. You can delete some blocked emails by specifying the email addresses in an array in the request body.
|
3276
|
+
You may include a search key by using the "ip" parameter. This enables you to perform a prefix search for a given IP segment (e.g. "192.").
|
3176
3277
|
|
3177
|
-
|
3278
|
+
Reverse DNS consists of a subdomain and domain that will be used to generate a record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.
|
3178
3279
|
|
3179
|
-
For more information, please see our [User Guide](https://sendgrid.com/docs/
|
3280
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/).
|
3180
3281
|
|
3181
|
-
###
|
3282
|
+
### GET /whitelabel/ips
|
3182
3283
|
|
3183
3284
|
|
3184
3285
|
```ruby
|
3185
|
-
|
3186
|
-
|
3187
|
-
"emails": [
|
3188
|
-
"example1@example.com",
|
3189
|
-
"example2@example.com"
|
3190
|
-
]
|
3191
|
-
}')
|
3192
|
-
response = sg.client.suppression.blocks.delete(request_body: data)
|
3286
|
+
params = JSON.parse('{"ip": "test_string", "limit": 1, "offset": 1}')
|
3287
|
+
response = sg.client.whitelabel.ips.get(query_params: params)
|
3193
3288
|
puts response.status_code
|
3194
3289
|
puts response.body
|
3195
3290
|
puts response.headers
|
3196
3291
|
```
|
3197
|
-
## Retrieve
|
3292
|
+
## Retrieve an reverse DNS record
|
3198
3293
|
|
3199
|
-
**This endpoint allows you to retrieve a
|
3294
|
+
**This endpoint allows you to retrieve a reverse DNS record.**
|
3200
3295
|
|
3201
|
-
|
3296
|
+
Reverse DNS consists of a subdomain and domain that will be used to generate a record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.
|
3202
3297
|
|
3203
|
-
For more information, please see our [User Guide](https://sendgrid.com/docs/
|
3298
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/).
|
3204
3299
|
|
3205
|
-
### GET /
|
3300
|
+
### GET /whitelabel/ips/{id}
|
3206
3301
|
|
3207
3302
|
|
3208
3303
|
```ruby
|
3209
|
-
|
3210
|
-
response = sg.client.
|
3304
|
+
id = "test_url_param"
|
3305
|
+
response = sg.client.whitelabel.ips._(id).get()
|
3211
3306
|
puts response.status_code
|
3212
3307
|
puts response.body
|
3213
3308
|
puts response.headers
|
3214
3309
|
```
|
3215
|
-
## Delete
|
3310
|
+
## Delete an reverse DNS record
|
3216
3311
|
|
3217
|
-
**This endpoint allows you to delete a
|
3312
|
+
**This endpoint allows you to delete a reverse DNS record.**
|
3218
3313
|
|
3219
|
-
|
3314
|
+
Reverse DNS consists of a subdomain and domain that will be used to generate a record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.
|
3220
3315
|
|
3221
|
-
For more information, please see our [User Guide](https://sendgrid.com/docs/
|
3316
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/).
|
3222
3317
|
|
3223
|
-
### DELETE /
|
3318
|
+
### DELETE /whitelabel/ips/{id}
|
3224
3319
|
|
3225
3320
|
|
3226
3321
|
```ruby
|
3227
|
-
|
3228
|
-
response = sg.client.
|
3322
|
+
id = "test_url_param"
|
3323
|
+
response = sg.client.whitelabel.ips._(id).delete()
|
3229
3324
|
puts response.status_code
|
3230
3325
|
puts response.body
|
3231
3326
|
puts response.headers
|
3232
3327
|
```
|
3233
|
-
##
|
3234
|
-
|
3235
|
-
**This endpoint allows you to retrieve all of your bounces.**
|
3328
|
+
## Validate a reverse DNS record
|
3236
3329
|
|
3237
|
-
|
3330
|
+
**This endpoint allows you to validate a reverse DNS record.**
|
3238
3331
|
|
3239
|
-
|
3332
|
+
Reverse DNS consists of a subdomain and domain that will be used to generate a record for a given IP. Once Twilio SendGrid has verified that the appropriate A record for the IP has been created, the appropriate reverse DNS record for the IP is generated.
|
3240
3333
|
|
3241
|
-
|
3242
|
-
* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
|
3334
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/).
|
3243
3335
|
|
3244
|
-
###
|
3336
|
+
### POST /whitelabel/ips/{id}/validate
|
3245
3337
|
|
3246
3338
|
|
3247
3339
|
```ruby
|
3248
|
-
|
3249
|
-
response = sg.client.
|
3340
|
+
id = "test_url_param"
|
3341
|
+
response = sg.client.whitelabel.ips._(id).validate.post()
|
3250
3342
|
puts response.status_code
|
3251
3343
|
puts response.body
|
3252
3344
|
puts response.headers
|
3253
3345
|
```
|
3254
|
-
##
|
3255
|
-
|
3256
|
-
**This endpoint allows you to delete all of your bounces. You can also use this endpoint to remove a specific email address from your bounce list.**
|
3346
|
+
## Create a Branded Link
|
3257
3347
|
|
3258
|
-
|
3259
|
-
|
3260
|
-
For more information see:
|
3348
|
+
**This endpoint allows you to create a new link branding.**
|
3261
3349
|
|
3262
|
-
|
3263
|
-
* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
|
3264
|
-
* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)
|
3350
|
+
Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
|
3265
3351
|
|
3266
|
-
|
3352
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
|
3267
3353
|
|
3268
|
-
###
|
3354
|
+
### POST /whitelabel/links
|
3269
3355
|
|
3270
3356
|
|
3271
3357
|
```ruby
|
3272
3358
|
data = JSON.parse('{
|
3273
|
-
"
|
3274
|
-
"
|
3275
|
-
|
3276
|
-
"example2@example.com"
|
3277
|
-
]
|
3359
|
+
"default": true,
|
3360
|
+
"domain": "example.com",
|
3361
|
+
"subdomain": "mail"
|
3278
3362
|
}')
|
3279
|
-
|
3363
|
+
params = JSON.parse('{"limit": 1, "offset": 1}')
|
3364
|
+
response = sg.client.whitelabel.links.post(request_body: data, query_params: params)
|
3280
3365
|
puts response.status_code
|
3281
3366
|
puts response.body
|
3282
3367
|
puts response.headers
|
3283
3368
|
```
|
3284
|
-
## Retrieve
|
3285
|
-
|
3286
|
-
**This endpoint allows you to retrieve a specific bounce for a given email address.**
|
3369
|
+
## Retrieve all link brandings
|
3287
3370
|
|
3288
|
-
|
3371
|
+
**This endpoint allows you to retrieve all link brandings.**
|
3289
3372
|
|
3290
|
-
|
3373
|
+
Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
|
3291
3374
|
|
3292
|
-
|
3293
|
-
* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
|
3294
|
-
* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)
|
3375
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
|
3295
3376
|
|
3296
|
-
### GET /
|
3377
|
+
### GET /whitelabel/links
|
3297
3378
|
|
3298
3379
|
|
3299
3380
|
```ruby
|
3300
|
-
|
3301
|
-
response = sg.client.
|
3381
|
+
params = JSON.parse('{"limit": 1}')
|
3382
|
+
response = sg.client.whitelabel.links.get(query_params: params)
|
3302
3383
|
puts response.status_code
|
3303
3384
|
puts response.body
|
3304
3385
|
puts response.headers
|
3305
3386
|
```
|
3306
|
-
##
|
3387
|
+
## Retrieve a Default Link Branding
|
3307
3388
|
|
3308
|
-
**This endpoint allows you to
|
3389
|
+
**This endpoint allows you to retrieve the default link branding.**
|
3309
3390
|
|
3310
|
-
|
3391
|
+
Default link branding is the actual link branding to be used when sending messages. If there are multiple link brandings, the default is determined by the following order:
|
3392
|
+
<ul>
|
3393
|
+
<li>Validated link branding marked as "default"</li>
|
3394
|
+
<li>Legacy link brands (migrated from the whitelabel wizard)</li>
|
3395
|
+
<li>Default Twilio SendGrid link whitelabel (i.e. 100.ct.sendgrid.net)</li>
|
3396
|
+
</ul>
|
3311
3397
|
|
3312
|
-
|
3398
|
+
Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
|
3313
3399
|
|
3314
|
-
|
3315
|
-
* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
|
3316
|
-
* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)
|
3400
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
|
3317
3401
|
|
3318
|
-
###
|
3402
|
+
### GET /whitelabel/links/default
|
3319
3403
|
|
3320
3404
|
|
3321
3405
|
```ruby
|
3322
|
-
params = JSON.parse('{"
|
3323
|
-
|
3324
|
-
response = sg.client.suppression.bounces._(email).delete(query_params: params)
|
3406
|
+
params = JSON.parse('{"domain": "test_string"}')
|
3407
|
+
response = sg.client.whitelabel.links.default.get(query_params: params)
|
3325
3408
|
puts response.status_code
|
3326
3409
|
puts response.body
|
3327
3410
|
puts response.headers
|
3328
3411
|
```
|
3329
|
-
## Retrieve
|
3412
|
+
## Retrieve Associated Link Branding
|
3330
3413
|
|
3331
|
-
**This endpoint allows you to retrieve
|
3414
|
+
**This endpoint allows you to retrieve the associated link branding for a subuser.**
|
3332
3415
|
|
3333
|
-
|
3416
|
+
Link branding can be associated with subusers from the parent account. This functionality allows
|
3417
|
+
subusers to send mail using their parent's link brands. To associate a link branding, the parent account
|
3418
|
+
must first create a branded link and validate it. The parent may then associate that branded link with a subuser via the API or the Subuser Management page in the user interface.
|
3334
3419
|
|
3335
|
-
|
3420
|
+
Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
|
3336
3421
|
|
3337
|
-
For more information, please see our [User Guide](https://sendgrid.com/docs/
|
3422
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
|
3338
3423
|
|
3339
|
-
### GET /
|
3424
|
+
### GET /whitelabel/links/subuser
|
3340
3425
|
|
3341
3426
|
|
3342
3427
|
```ruby
|
3343
|
-
params = JSON.parse('{"
|
3344
|
-
response = sg.client.
|
3428
|
+
params = JSON.parse('{"username": "test_string"}')
|
3429
|
+
response = sg.client.whitelabel.links.subuser.get(query_params: params)
|
3345
3430
|
puts response.status_code
|
3346
3431
|
puts response.body
|
3347
3432
|
puts response.headers
|
3348
3433
|
```
|
3349
|
-
##
|
3350
|
-
|
3351
|
-
**This endpoint allows you to remove email addresses from your invalid email address list.**
|
3352
|
-
|
3353
|
-
There are two options for deleting invalid email addresses:
|
3434
|
+
## Disassociate a Link Branding
|
3354
3435
|
|
3355
|
-
|
3356
|
-
2) You can delete some invalid email addresses by specifying certain addresses in an array in the request body.
|
3436
|
+
**This endpoint allows you to disassociate a link branding from a subuser.**
|
3357
3437
|
|
3358
|
-
|
3438
|
+
Link branding can be associated with subusers from the parent account. This functionality allows
|
3439
|
+
subusers to send mail using their parent's link brands. To associate a link branding, the parent account
|
3440
|
+
must first create a branded link and validate it. The parent may then associate that branded link with a subuser via the API or the Subuser Management page in the user interface.
|
3359
3441
|
|
3360
|
-
|
3442
|
+
Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
|
3361
3443
|
|
3362
|
-
For more information, please see our [User Guide](https://sendgrid.com/docs/
|
3444
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
|
3363
3445
|
|
3364
|
-
### DELETE /
|
3446
|
+
### DELETE /whitelabel/links/subuser
|
3365
3447
|
|
3366
3448
|
|
3367
3449
|
```ruby
|
3368
|
-
|
3369
|
-
|
3370
|
-
"emails": [
|
3371
|
-
"example1@example.com",
|
3372
|
-
"example2@example.com"
|
3373
|
-
]
|
3374
|
-
}')
|
3375
|
-
response = sg.client.suppression.invalid_emails.delete(request_body: data)
|
3450
|
+
params = JSON.parse('{"username": "test_string"}')
|
3451
|
+
response = sg.client.whitelabel.links.subuser.delete(query_params: params)
|
3376
3452
|
puts response.status_code
|
3377
3453
|
puts response.body
|
3378
3454
|
puts response.headers
|
3379
3455
|
```
|
3380
|
-
##
|
3381
|
-
|
3382
|
-
**This endpoint allows you to retrieve a specific invalid email addresses.**
|
3456
|
+
## Update a Link Branding
|
3383
3457
|
|
3384
|
-
|
3458
|
+
**This endpoint allows you to update a specific link branding. You can use this endpoint to change a branded link's default status.**
|
3385
3459
|
|
3386
|
-
|
3460
|
+
Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
|
3387
3461
|
|
3388
|
-
For more information, please see our [User Guide](https://sendgrid.com/docs/
|
3462
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
|
3389
3463
|
|
3390
|
-
###
|
3464
|
+
### PATCH /whitelabel/links/{id}
|
3391
3465
|
|
3392
3466
|
|
3393
3467
|
```ruby
|
3394
|
-
|
3395
|
-
|
3468
|
+
data = JSON.parse('{
|
3469
|
+
"default": true
|
3470
|
+
}')
|
3471
|
+
id = "test_url_param"
|
3472
|
+
response = sg.client.whitelabel.links._(id).patch(request_body: data)
|
3396
3473
|
puts response.status_code
|
3397
3474
|
puts response.body
|
3398
3475
|
puts response.headers
|
3399
3476
|
```
|
3400
|
-
##
|
3401
|
-
|
3402
|
-
**This endpoint allows you to remove a specific email address from the invalid email address list.**
|
3477
|
+
## Retrieve a Link Branding
|
3403
3478
|
|
3404
|
-
|
3479
|
+
**This endpoint allows you to retrieve a specific link branding.**
|
3405
3480
|
|
3406
|
-
|
3481
|
+
Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
|
3407
3482
|
|
3408
|
-
For more information, please see our [User Guide](https://sendgrid.com/docs/
|
3483
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
|
3409
3484
|
|
3410
|
-
###
|
3485
|
+
### GET /whitelabel/links/{id}
|
3411
3486
|
|
3412
3487
|
|
3413
3488
|
```ruby
|
3414
|
-
|
3415
|
-
response = sg.client.
|
3489
|
+
id = "test_url_param"
|
3490
|
+
response = sg.client.whitelabel.links._(id).get()
|
3416
3491
|
puts response.status_code
|
3417
3492
|
puts response.body
|
3418
3493
|
puts response.headers
|
3419
3494
|
```
|
3420
|
-
##
|
3495
|
+
## Delete a Link Branding
|
3421
3496
|
|
3422
|
-
**This endpoint allows you to
|
3497
|
+
**This endpoint allows you to delete a link branding.**
|
3423
3498
|
|
3424
|
-
|
3499
|
+
Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
|
3425
3500
|
|
3426
|
-
For more information, please see our [User Guide](https://sendgrid.com/docs/
|
3501
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
|
3427
3502
|
|
3428
|
-
###
|
3503
|
+
### DELETE /whitelabel/links/{id}
|
3429
3504
|
|
3430
3505
|
|
3431
3506
|
```ruby
|
3432
|
-
|
3433
|
-
response = sg.client.
|
3507
|
+
id = "test_url_param"
|
3508
|
+
response = sg.client.whitelabel.links._(id).delete()
|
3434
3509
|
puts response.status_code
|
3435
3510
|
puts response.body
|
3436
3511
|
puts response.headers
|
3437
3512
|
```
|
3438
|
-
##
|
3513
|
+
## Validate a Link Branding
|
3439
3514
|
|
3440
|
-
**This endpoint allows you to
|
3515
|
+
**This endpoint allows you to validate a link branding.**
|
3441
3516
|
|
3442
|
-
|
3517
|
+
Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
|
3443
3518
|
|
3444
|
-
For more information, please see our [User Guide](https://sendgrid.com/docs/
|
3519
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
|
3445
3520
|
|
3446
|
-
###
|
3521
|
+
### POST /whitelabel/links/{id}/validate
|
3447
3522
|
|
3448
3523
|
|
3449
3524
|
```ruby
|
3450
|
-
|
3451
|
-
response = sg.client.
|
3525
|
+
id = "test_url_param"
|
3526
|
+
response = sg.client.whitelabel.links._(id).validate.post()
|
3452
3527
|
puts response.status_code
|
3453
3528
|
puts response.body
|
3454
3529
|
puts response.headers
|
3455
3530
|
```
|
3456
|
-
##
|
3531
|
+
## Associate a Link Branding
|
3457
3532
|
|
3458
|
-
**This endpoint allows you to
|
3533
|
+
**This endpoint allows you to associate a link branding with a subuser account.**
|
3459
3534
|
|
3460
|
-
|
3535
|
+
Link branding can be associated with subusers from the parent account. This functionality allows
|
3536
|
+
subusers to send mail using their parent's link brands. To associate a link branding, the parent account
|
3537
|
+
must first create a branded link and validate it. The parent may then associate that branded link with a subuser via the API or the Subuser Management page in the user interface.
|
3461
3538
|
|
3462
|
-
|
3539
|
+
Email link branding allow all of the click-tracked links you send in your emails to include the URL of your domain instead of sendgrid.net.
|
3463
3540
|
|
3464
|
-
|
3541
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-link-branding/).
|
3542
|
+
|
3543
|
+
### POST /whitelabel/links/{link_id}/subuser
|
3465
3544
|
|
3466
3545
|
|
3467
3546
|
```ruby
|
3468
|
-
|
3469
|
-
|
3547
|
+
data = JSON.parse('{
|
3548
|
+
"username": "jane@example.com"
|
3549
|
+
}')
|
3550
|
+
link_id = "test_url_param"
|
3551
|
+
response = sg.client.whitelabel.links._(link_id).subuser.post(request_body: data)
|
3470
3552
|
puts response.status_code
|
3471
3553
|
puts response.body
|
3472
3554
|
puts response.headers
|
3473
3555
|
```
|
3474
|
-
## Delete spam reports
|
3475
|
-
|
3476
|
-
**This endpoint allows you to delete your spam reports.**
|
3477
3556
|
|
3478
|
-
|
3557
|
+
<a name="stats"></a>
|
3558
|
+
# STATS
|
3479
3559
|
|
3480
|
-
|
3481
|
-
2) You can delete some spam reports by specifying the email addresses in an array in the request body.
|
3560
|
+
## Retrieve global email statistics
|
3482
3561
|
|
3483
|
-
|
3562
|
+
**This endpoint allows you to retrieve all of your global email statistics between a given date range.**
|
3484
3563
|
|
3485
|
-
|
3564
|
+
Parent accounts will see aggregated stats for their account and all subuser accounts. Subuser accounts will only see their own stats.
|
3486
3565
|
|
3487
|
-
###
|
3566
|
+
### GET /stats
|
3488
3567
|
|
3489
3568
|
|
3490
3569
|
```ruby
|
3491
|
-
|
3492
|
-
|
3493
|
-
"emails": [
|
3494
|
-
"example1@example.com",
|
3495
|
-
"example2@example.com"
|
3496
|
-
]
|
3497
|
-
}')
|
3498
|
-
response = sg.client.suppression.spam_reports.delete(request_body: data)
|
3570
|
+
params = JSON.parse('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}')
|
3571
|
+
response = sg.client.stats.get(query_params: params)
|
3499
3572
|
puts response.status_code
|
3500
3573
|
puts response.body
|
3501
3574
|
puts response.headers
|
3502
3575
|
```
|
3503
|
-
|
3576
|
+
<a name="subusers"></a>
|
3577
|
+
# SUBUSERS
|
3504
3578
|
|
3505
|
-
|
3579
|
+
## Create Subuser
|
3506
3580
|
|
3507
|
-
|
3581
|
+
This endpoint allows you to retrieve a list of all of your subusers. You can choose to retrieve specific subusers as well as limit the results that come back from the API.
|
3508
3582
|
|
3509
|
-
|
3583
|
+
For more information about Subusers:
|
3584
|
+
|
3585
|
+
* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)
|
3586
|
+
* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)
|
3587
|
+
|
3588
|
+
### POST /subusers
|
3510
3589
|
|
3511
3590
|
|
3512
3591
|
```ruby
|
3513
|
-
|
3514
|
-
|
3592
|
+
data = JSON.parse('{
|
3593
|
+
"email": "John@example.com",
|
3594
|
+
"ips": [
|
3595
|
+
"1.1.1.1",
|
3596
|
+
"2.2.2.2"
|
3597
|
+
],
|
3598
|
+
"password": "johns_password",
|
3599
|
+
"username": "John@example.com"
|
3600
|
+
}')
|
3601
|
+
response = sg.client.subusers.post(request_body: data)
|
3515
3602
|
puts response.status_code
|
3516
3603
|
puts response.body
|
3517
3604
|
puts response.headers
|
3518
3605
|
```
|
3519
|
-
|
3520
|
-
# TEMPLATES
|
3521
|
-
|
3522
|
-
## Create a transactional template.
|
3606
|
+
## List all Subusers
|
3523
3607
|
|
3524
|
-
|
3608
|
+
This endpoint allows you to retrieve a list of all of your subusers. You can choose to retrieve specific subusers as well as limit the results that come back from the API.
|
3525
3609
|
|
3526
|
-
|
3610
|
+
For more information about Subusers:
|
3527
3611
|
|
3528
|
-
|
3612
|
+
* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)
|
3613
|
+
* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)
|
3529
3614
|
|
3530
|
-
###
|
3615
|
+
### GET /subusers
|
3531
3616
|
|
3532
3617
|
|
3533
3618
|
```ruby
|
3534
|
-
|
3535
|
-
|
3536
|
-
}')
|
3537
|
-
response = sg.client.templates.post(request_body: data)
|
3619
|
+
params = JSON.parse('{"username": "test_string", "limit": 1, "offset": 1}')
|
3620
|
+
response = sg.client.subusers.get(query_params: params)
|
3538
3621
|
puts response.status_code
|
3539
3622
|
puts response.body
|
3540
3623
|
puts response.headers
|
3541
3624
|
```
|
3542
|
-
## Retrieve
|
3543
|
-
|
3544
|
-
**This endpoint allows you to retrieve all transactional templates.**
|
3625
|
+
## Retrieve Subuser Reputations
|
3545
3626
|
|
3546
|
-
|
3627
|
+
Subuser sender reputations give a good idea how well a sender is doing with regards to how recipients and recipient servers react to the mail that is being received. When a bounce, spam report, or other negative action happens on a sent email, it will affect your sender rating.
|
3547
3628
|
|
3548
|
-
|
3629
|
+
This endpoint allows you to request the reputations for your subusers.
|
3549
3630
|
|
3550
|
-
### GET /
|
3631
|
+
### GET /subusers/reputations
|
3551
3632
|
|
3552
3633
|
|
3553
3634
|
```ruby
|
3554
|
-
|
3635
|
+
params = JSON.parse('{"usernames": "test_string"}')
|
3636
|
+
response = sg.client.subusers.reputations.get(query_params: params)
|
3555
3637
|
puts response.status_code
|
3556
3638
|
puts response.body
|
3557
3639
|
puts response.headers
|
3558
3640
|
```
|
3559
|
-
## Edit a transactional template.
|
3560
3641
|
|
3561
|
-
|
3642
|
+
## Retrieve email statistics for your subusers.
|
3562
3643
|
|
3563
|
-
|
3644
|
+
**This endpoint allows you to retrieve the email statistics for the given subusers.**
|
3564
3645
|
|
3565
|
-
|
3646
|
+
You may retrieve statistics for up to 10 different subusers by including an additional _subusers_ parameter for each additional subuser.
|
3566
3647
|
|
3648
|
+
While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings.
|
3567
3649
|
|
3568
|
-
|
3650
|
+
For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).
|
3651
|
+
|
3652
|
+
### GET /subusers/stats
|
3569
3653
|
|
3570
3654
|
|
3571
3655
|
```ruby
|
3572
|
-
|
3573
|
-
|
3574
|
-
}')
|
3575
|
-
template_id = "test_url_param"
|
3576
|
-
response = sg.client.templates._(template_id).patch(request_body: data)
|
3656
|
+
params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "subusers": "test_string"}')
|
3657
|
+
response = sg.client.subusers.stats.get(query_params: params)
|
3577
3658
|
puts response.status_code
|
3578
3659
|
puts response.body
|
3579
3660
|
puts response.headers
|
3580
3661
|
```
|
3581
|
-
## Retrieve
|
3662
|
+
## Retrieve monthly stats for all subusers
|
3582
3663
|
|
3583
|
-
**This endpoint allows you to retrieve
|
3664
|
+
**This endpoint allows you to retrieve the monthly email statistics for all subusers over the given date range.**
|
3584
3665
|
|
3585
|
-
|
3666
|
+
While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats for your subusers. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings.
|
3586
3667
|
|
3587
|
-
|
3668
|
+
When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics:
|
3669
|
+
`bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`.
|
3588
3670
|
|
3671
|
+
For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).
|
3589
3672
|
|
3590
|
-
### GET /
|
3673
|
+
### GET /subusers/stats/monthly
|
3591
3674
|
|
3592
3675
|
|
3593
3676
|
```ruby
|
3594
|
-
|
3595
|
-
response = sg.client.
|
3677
|
+
params = JSON.parse('{"subuser": "test_string", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "date": "test_string", "sort_by_direction": "asc"}')
|
3678
|
+
response = sg.client.subusers.stats.monthly.get(query_params: params)
|
3596
3679
|
puts response.status_code
|
3597
3680
|
puts response.body
|
3598
3681
|
puts response.headers
|
3599
3682
|
```
|
3600
|
-
##
|
3683
|
+
## Retrieve the totals for each email statistic metric for all subusers.
|
3601
3684
|
|
3602
|
-
**This endpoint allows you to
|
3685
|
+
**This endpoint allows you to retrieve the total sums of each email statistic metric for all subusers over the given date range.**
|
3603
3686
|
|
3604
|
-
Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts.
|
3605
3687
|
|
3606
|
-
|
3688
|
+
While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings.
|
3607
3689
|
|
3690
|
+
For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).
|
3608
3691
|
|
3609
|
-
###
|
3692
|
+
### GET /subusers/stats/sums
|
3610
3693
|
|
3611
3694
|
|
3612
3695
|
```ruby
|
3613
|
-
|
3614
|
-
response = sg.client.
|
3696
|
+
params = JSON.parse('{"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"}')
|
3697
|
+
response = sg.client.subusers.stats.sums.get(query_params: params)
|
3615
3698
|
puts response.status_code
|
3616
3699
|
puts response.body
|
3617
3700
|
puts response.headers
|
3618
3701
|
```
|
3619
|
-
##
|
3620
|
-
|
3621
|
-
**This endpoint allows you to create a new version of a template.**
|
3622
|
-
|
3623
|
-
Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across all templates.
|
3702
|
+
## Enable/disable a subuser
|
3624
3703
|
|
3625
|
-
|
3704
|
+
This endpoint allows you to enable or disable a subuser.
|
3705
|
+
For more information about Subusers:
|
3626
3706
|
|
3707
|
+
* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)
|
3708
|
+
* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)
|
3627
3709
|
|
3628
|
-
###
|
3710
|
+
### PATCH /subusers/{subuser_name}
|
3629
3711
|
|
3630
3712
|
|
3631
3713
|
```ruby
|
3632
3714
|
data = JSON.parse('{
|
3633
|
-
"
|
3634
|
-
"html_content": "<%body%>",
|
3635
|
-
"name": "example_version_name",
|
3636
|
-
"plain_content": "<%body%>",
|
3637
|
-
"subject": "<%subject%>",
|
3638
|
-
"template_id": "ddb96bbc-9b92-425e-8979-99464621b543"
|
3715
|
+
"disabled": false
|
3639
3716
|
}')
|
3640
|
-
|
3641
|
-
response = sg.client.
|
3717
|
+
subuser_name = "test_url_param"
|
3718
|
+
response = sg.client.subusers._(subuser_name).patch(request_body: data)
|
3642
3719
|
puts response.status_code
|
3643
3720
|
puts response.body
|
3644
3721
|
puts response.headers
|
3645
3722
|
```
|
3646
|
-
##
|
3647
|
-
|
3648
|
-
**This endpoint allows you to edit a version of one of your transactional templates.**
|
3723
|
+
## Delete a subuser
|
3649
3724
|
|
3650
|
-
|
3725
|
+
This endpoint allows you to delete a subuser. This is a permanent action, once deleted a subuser cannot be retrieved.
|
3651
3726
|
|
3652
|
-
For more information about
|
3727
|
+
For more information about Subusers:
|
3653
3728
|
|
3654
|
-
|
3655
|
-
|
3656
|
-
|---|---|---|
|
3657
|
-
| template_id | string | The ID of the original template |
|
3658
|
-
| version_id | string | The ID of the template version |
|
3729
|
+
* [User Guide > Subusers](https://sendgrid.com/docs/User_Guide/Settings/Subusers/index.html)
|
3730
|
+
* [Classroom > How do I add more subusers to my account?](https://sendgrid.com/docs/Classroom/Basics/Account/how_do_i_add_more_subusers_to_my_account.html)
|
3659
3731
|
|
3660
|
-
###
|
3732
|
+
### DELETE /subusers/{subuser_name}
|
3661
3733
|
|
3662
3734
|
|
3663
3735
|
```ruby
|
3664
|
-
|
3665
|
-
|
3666
|
-
"html_content": "<%body%>",
|
3667
|
-
"name": "updated_example_name",
|
3668
|
-
"plain_content": "<%body%>",
|
3669
|
-
"subject": "<%subject%>"
|
3670
|
-
}')
|
3671
|
-
template_id = "test_url_param"
|
3672
|
-
version_id = "test_url_param"
|
3673
|
-
response = sg.client.templates._(template_id).versions._(version_id).patch(request_body: data)
|
3736
|
+
subuser_name = "test_url_param"
|
3737
|
+
response = sg.client.subusers._(subuser_name).delete()
|
3674
3738
|
puts response.status_code
|
3675
3739
|
puts response.body
|
3676
3740
|
puts response.headers
|
3677
3741
|
```
|
3678
|
-
##
|
3742
|
+
## Update IPs assigned to a subuser
|
3679
3743
|
|
3680
|
-
|
3744
|
+
Each subuser should be assigned to an IP address, from which all of this subuser's mail will be sent. Often, this is the same IP as the parent account, but each subuser can have their own, or multiple, IP addresses as well.
|
3681
3745
|
|
3682
|
-
|
3746
|
+
More information:
|
3683
3747
|
|
3684
|
-
|
3748
|
+
* [How to request more IPs](https://sendgrid.com/docs/Classroom/Basics/Account/adding_an_additional_dedicated_ip_to_your_account.html)
|
3749
|
+
* [How to setup reverse DNS](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/)
|
3685
3750
|
|
3686
|
-
|
3687
|
-
| URI Parameter | Type | Description |
|
3688
|
-
|---|---|---|
|
3689
|
-
| template_id | string | The ID of the original template |
|
3690
|
-
| version_id | string | The ID of the template version |
|
3751
|
+
### PUT /subusers/{subuser_name}/ips
|
3691
3752
|
|
3692
|
-
|
3753
|
+
|
3754
|
+
```ruby
|
3755
|
+
data = JSON.parse('[
|
3756
|
+
"127.0.0.1"
|
3757
|
+
]')
|
3758
|
+
subuser_name = "test_url_param"
|
3759
|
+
response = sg.client.subusers._(subuser_name).ips.put(request_body: data)
|
3760
|
+
puts response.status_code
|
3761
|
+
puts response.body
|
3762
|
+
puts response.headers
|
3763
|
+
```
|
3764
|
+
## Update Monitor Settings for a subuser
|
3765
|
+
|
3766
|
+
Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.
|
3767
|
+
|
3768
|
+
### PUT /subusers/{subuser_name}/monitor
|
3693
3769
|
|
3694
3770
|
|
3695
3771
|
```ruby
|
3696
|
-
|
3697
|
-
|
3698
|
-
|
3772
|
+
data = JSON.parse('{
|
3773
|
+
"email": "example@example.com",
|
3774
|
+
"frequency": 500
|
3775
|
+
}')
|
3776
|
+
subuser_name = "test_url_param"
|
3777
|
+
response = sg.client.subusers._(subuser_name).monitor.put(request_body: data)
|
3699
3778
|
puts response.status_code
|
3700
3779
|
puts response.body
|
3701
3780
|
puts response.headers
|
3702
3781
|
```
|
3703
|
-
##
|
3782
|
+
## Create monitor settings
|
3704
3783
|
|
3705
|
-
|
3784
|
+
Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.
|
3706
3785
|
|
3707
|
-
|
3786
|
+
### POST /subusers/{subuser_name}/monitor
|
3708
3787
|
|
3709
|
-
For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
|
3710
3788
|
|
3711
|
-
|
3712
|
-
|
3713
|
-
|
3714
|
-
|
3715
|
-
|
3789
|
+
```ruby
|
3790
|
+
data = JSON.parse('{
|
3791
|
+
"email": "example@example.com",
|
3792
|
+
"frequency": 50000
|
3793
|
+
}')
|
3794
|
+
subuser_name = "test_url_param"
|
3795
|
+
response = sg.client.subusers._(subuser_name).monitor.post(request_body: data)
|
3796
|
+
puts response.status_code
|
3797
|
+
puts response.body
|
3798
|
+
puts response.headers
|
3799
|
+
```
|
3800
|
+
## Retrieve monitor settings for a subuser
|
3716
3801
|
|
3717
|
-
|
3802
|
+
Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.
|
3803
|
+
|
3804
|
+
### GET /subusers/{subuser_name}/monitor
|
3718
3805
|
|
3719
3806
|
|
3720
3807
|
```ruby
|
3721
|
-
|
3722
|
-
|
3723
|
-
response = sg.client.templates._(template_id).versions._(version_id).delete()
|
3808
|
+
subuser_name = "test_url_param"
|
3809
|
+
response = sg.client.subusers._(subuser_name).monitor.get()
|
3724
3810
|
puts response.status_code
|
3725
3811
|
puts response.body
|
3726
3812
|
puts response.headers
|
3727
3813
|
```
|
3728
|
-
##
|
3814
|
+
## Delete monitor settings
|
3729
3815
|
|
3730
|
-
|
3816
|
+
Subuser monitor settings allow you to receive a sample of an outgoing message by a specific customer at a specific frequency of emails.
|
3731
3817
|
|
3732
|
-
|
3818
|
+
### DELETE /subusers/{subuser_name}/monitor
|
3733
3819
|
|
3734
3820
|
|
3735
|
-
|
3821
|
+
```ruby
|
3822
|
+
subuser_name = "test_url_param"
|
3823
|
+
response = sg.client.subusers._(subuser_name).monitor.delete()
|
3824
|
+
puts response.status_code
|
3825
|
+
puts response.body
|
3826
|
+
puts response.headers
|
3827
|
+
```
|
3828
|
+
## Retrieve the monthly email statistics for a single subuser
|
3736
3829
|
|
3737
|
-
|
3738
|
-
| URI Parameter | Type | Description |
|
3739
|
-
|---|---|---|
|
3740
|
-
| template_id | string | The ID of the original template |
|
3741
|
-
| version_id | string | The ID of the template version |
|
3830
|
+
**This endpoint allows you to retrieve the monthly email statistics for a specific subuser.**
|
3742
3831
|
|
3743
|
-
|
3832
|
+
While you can always view the statistics for all email activity on your account, subuser statistics enable you to view specific segments of your stats for your subusers. Emails sent, bounces, and spam reports are always tracked for subusers. Unsubscribes, clicks, and opens are tracked if you have enabled the required settings.
|
3833
|
+
|
3834
|
+
When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics:
|
3835
|
+
`bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`.
|
3836
|
+
|
3837
|
+
For more information, see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/subuser.html).
|
3838
|
+
|
3839
|
+
### GET /subusers/{subuser_name}/stats/monthly
|
3744
3840
|
|
3745
3841
|
|
3746
3842
|
```ruby
|
3747
|
-
|
3748
|
-
|
3749
|
-
response = sg.client.
|
3843
|
+
params = JSON.parse('{"date": "test_string", "sort_by_direction": "asc", "limit": 1, "sort_by_metric": "test_string", "offset": 1}')
|
3844
|
+
subuser_name = "test_url_param"
|
3845
|
+
response = sg.client.subusers._(subuser_name).stats.monthly.get(query_params: params)
|
3750
3846
|
puts response.status_code
|
3751
3847
|
puts response.body
|
3752
3848
|
puts response.headers
|
3753
3849
|
```
|
3754
|
-
<a name="
|
3755
|
-
#
|
3850
|
+
<a name="suppression"></a>
|
3851
|
+
# SUPPRESSION
|
3756
3852
|
|
3757
|
-
## Retrieve
|
3853
|
+
## Retrieve all blocks
|
3758
3854
|
|
3759
|
-
**This endpoint allows you to retrieve a list of all
|
3855
|
+
**This endpoint allows you to retrieve a list of all email addresses that are currently on your blocks list.**
|
3760
3856
|
|
3761
|
-
|
3857
|
+
[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server.
|
3762
3858
|
|
3763
|
-
For more information
|
3859
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).
|
3764
3860
|
|
3765
|
-
### GET /
|
3861
|
+
### GET /suppression/blocks
|
3766
3862
|
|
3767
3863
|
|
3768
3864
|
```ruby
|
3769
|
-
params = JSON.parse('{"limit": 1, "offset": 1}')
|
3770
|
-
response = sg.client.
|
3865
|
+
params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
|
3866
|
+
response = sg.client.suppression.blocks.get(query_params: params)
|
3771
3867
|
puts response.status_code
|
3772
3868
|
puts response.body
|
3773
3869
|
puts response.headers
|
3774
3870
|
```
|
3775
|
-
##
|
3871
|
+
## Delete blocks
|
3776
3872
|
|
3777
|
-
**This endpoint allows you to
|
3873
|
+
**This endpoint allows you to delete all email addresses on your blocks list.**
|
3778
3874
|
|
3779
|
-
|
3875
|
+
There are two options for deleting blocked emails:
|
3780
3876
|
|
3781
|
-
|
3877
|
+
1. You can delete all blocked emails by setting `delete_all` to true in the request body.
|
3878
|
+
2. You can delete some blocked emails by specifying the email addresses in an array in the request body.
|
3782
3879
|
|
3783
|
-
|
3880
|
+
[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server.
|
3881
|
+
|
3882
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).
|
3883
|
+
|
3884
|
+
### DELETE /suppression/blocks
|
3784
3885
|
|
3785
3886
|
|
3786
3887
|
```ruby
|
3787
3888
|
data = JSON.parse('{
|
3788
|
-
"
|
3889
|
+
"delete_all": false,
|
3890
|
+
"emails": [
|
3891
|
+
"example1@example.com",
|
3892
|
+
"example2@example.com"
|
3893
|
+
]
|
3789
3894
|
}')
|
3790
|
-
response = sg.client.
|
3895
|
+
response = sg.client.suppression.blocks.delete(request_body: data)
|
3791
3896
|
puts response.status_code
|
3792
3897
|
puts response.body
|
3793
3898
|
puts response.headers
|
3794
3899
|
```
|
3795
|
-
## Retrieve
|
3900
|
+
## Retrieve a specific block
|
3796
3901
|
|
3797
|
-
**This endpoint allows you to retrieve
|
3902
|
+
**This endpoint allows you to retrieve a specific email address from your blocks list.**
|
3798
3903
|
|
3799
|
-
|
3904
|
+
[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server.
|
3800
3905
|
|
3801
|
-
For more information
|
3906
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).
|
3802
3907
|
|
3803
|
-
### GET /
|
3908
|
+
### GET /suppression/blocks/{email}
|
3804
3909
|
|
3805
3910
|
|
3806
3911
|
```ruby
|
3807
|
-
|
3912
|
+
email = "test_url_param"
|
3913
|
+
response = sg.client.suppression.blocks._(email).get()
|
3808
3914
|
puts response.status_code
|
3809
3915
|
puts response.body
|
3810
3916
|
puts response.headers
|
3811
3917
|
```
|
3812
|
-
##
|
3813
|
-
|
3814
|
-
**This endpoint allows you to update your current setting for Google Analytics.**
|
3815
|
-
|
3816
|
-
For more information about using Google Analytics, please refer to [Googles URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on ["Best Practices for Campaign Building"](https://support.google.com/analytics/answer/1037445).
|
3918
|
+
## Delete a specific block
|
3817
3919
|
|
3818
|
-
|
3920
|
+
**This endpoint allows you to delete a specific email address from your blocks list.**
|
3819
3921
|
|
3820
|
-
|
3922
|
+
[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server.
|
3821
3923
|
|
3822
|
-
For more information
|
3924
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html).
|
3823
3925
|
|
3824
|
-
###
|
3926
|
+
### DELETE /suppression/blocks/{email}
|
3825
3927
|
|
3826
3928
|
|
3827
3929
|
```ruby
|
3828
|
-
|
3829
|
-
|
3830
|
-
"utm_campaign": "website",
|
3831
|
-
"utm_content": "",
|
3832
|
-
"utm_medium": "email",
|
3833
|
-
"utm_source": "sendgrid.com",
|
3834
|
-
"utm_term": ""
|
3835
|
-
}')
|
3836
|
-
response = sg.client.tracking_settings.google_analytics.patch(request_body: data)
|
3930
|
+
email = "test_url_param"
|
3931
|
+
response = sg.client.suppression.blocks._(email).delete()
|
3837
3932
|
puts response.status_code
|
3838
3933
|
puts response.body
|
3839
3934
|
puts response.headers
|
3840
3935
|
```
|
3841
|
-
## Retrieve
|
3842
|
-
|
3843
|
-
**This endpoint allows you to retrieve your current setting for Google Analytics.**
|
3936
|
+
## Retrieve all bounces
|
3844
3937
|
|
3845
|
-
|
3938
|
+
**This endpoint allows you to retrieve all of your bounces.**
|
3846
3939
|
|
3847
|
-
|
3940
|
+
Bounces are messages that are returned to the server that sent it.
|
3848
3941
|
|
3849
|
-
|
3942
|
+
For more information see:
|
3850
3943
|
|
3851
|
-
|
3944
|
+
* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information
|
3945
|
+
* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
|
3852
3946
|
|
3853
|
-
### GET /
|
3947
|
+
### GET /suppression/bounces
|
3854
3948
|
|
3855
3949
|
|
3856
3950
|
```ruby
|
3857
|
-
|
3951
|
+
params = JSON.parse('{"start_time": 1, "end_time": 1}')
|
3952
|
+
response = sg.client.suppression.bounces.get(query_params: params)
|
3858
3953
|
puts response.status_code
|
3859
3954
|
puts response.body
|
3860
3955
|
puts response.headers
|
3861
3956
|
```
|
3862
|
-
##
|
3957
|
+
## Delete bounces
|
3863
3958
|
|
3864
|
-
**This endpoint allows you to
|
3959
|
+
**This endpoint allows you to delete all of your bounces. You can also use this endpoint to remove a specific email address from your bounce list.**
|
3865
3960
|
|
3866
|
-
|
3961
|
+
Bounces are messages that are returned to the server that sent it.
|
3867
3962
|
|
3868
|
-
|
3963
|
+
For more information see:
|
3869
3964
|
|
3870
|
-
|
3965
|
+
* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information
|
3966
|
+
* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
|
3967
|
+
* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)
|
3871
3968
|
|
3872
|
-
|
3969
|
+
Note: the `delete_all` and `emails` parameters should be used independently of each other as they have different purposes.
|
3970
|
+
|
3971
|
+
### DELETE /suppression/bounces
|
3873
3972
|
|
3874
3973
|
|
3875
3974
|
```ruby
|
3876
3975
|
data = JSON.parse('{
|
3877
|
-
"
|
3976
|
+
"delete_all": true,
|
3977
|
+
"emails": [
|
3978
|
+
"example@example.com",
|
3979
|
+
"example2@example.com"
|
3980
|
+
]
|
3878
3981
|
}')
|
3879
|
-
response = sg.client.
|
3982
|
+
response = sg.client.suppression.bounces.delete(request_body: data)
|
3880
3983
|
puts response.status_code
|
3881
3984
|
puts response.body
|
3882
3985
|
puts response.headers
|
3883
3986
|
```
|
3884
|
-
##
|
3987
|
+
## Retrieve a Bounce
|
3885
3988
|
|
3886
|
-
**This endpoint allows you to retrieve
|
3989
|
+
**This endpoint allows you to retrieve a specific bounce for a given email address.**
|
3887
3990
|
|
3888
|
-
|
3991
|
+
Bounces are messages that are returned to the server that sent it.
|
3889
3992
|
|
3890
|
-
|
3993
|
+
For more information see:
|
3891
3994
|
|
3892
|
-
|
3995
|
+
* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information
|
3996
|
+
* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
|
3997
|
+
* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)
|
3893
3998
|
|
3894
|
-
### GET /
|
3999
|
+
### GET /suppression/bounces/{email}
|
3895
4000
|
|
3896
4001
|
|
3897
4002
|
```ruby
|
3898
|
-
|
4003
|
+
email = "test_url_param"
|
4004
|
+
response = sg.client.suppression.bounces._(email).get()
|
3899
4005
|
puts response.status_code
|
3900
4006
|
puts response.body
|
3901
4007
|
puts response.headers
|
3902
4008
|
```
|
3903
|
-
##
|
4009
|
+
## Delete a bounce
|
3904
4010
|
|
3905
|
-
**This endpoint allows you to
|
4011
|
+
**This endpoint allows you to remove an email address from your bounce list.**
|
3906
4012
|
|
3907
|
-
|
4013
|
+
Bounces are messages that are returned to the server that sent it. This endpoint allows you to delete a single email address from your bounce list.
|
3908
4014
|
|
3909
|
-
|
4015
|
+
For more information see:
|
3910
4016
|
|
3911
|
-
|
4017
|
+
* [User Guide > Bounces](https://sendgrid.com/docs/User_Guide/Suppressions/bounces.html) for more information
|
4018
|
+
* [Glossary > Bounces](https://sendgrid.com/docs/Glossary/Bounces.html)
|
4019
|
+
* [Classroom > List Scrubbing Guide](https://sendgrid.com/docs/Classroom/Deliver/list_scrubbing.html)
|
3912
4020
|
|
3913
|
-
###
|
4021
|
+
### DELETE /suppression/bounces/{email}
|
3914
4022
|
|
3915
4023
|
|
3916
4024
|
```ruby
|
3917
|
-
|
3918
|
-
|
3919
|
-
|
3920
|
-
"landing": "landing page html",
|
3921
|
-
"plain_content": "text content",
|
3922
|
-
"replace": "replacement tag",
|
3923
|
-
"url": "url"
|
3924
|
-
}')
|
3925
|
-
response = sg.client.tracking_settings.subscription.patch(request_body: data)
|
4025
|
+
params = JSON.parse('{"email_address": "example@example.com"}')
|
4026
|
+
email = "test_url_param"
|
4027
|
+
response = sg.client.suppression.bounces._(email).delete(query_params: params)
|
3926
4028
|
puts response.status_code
|
3927
4029
|
puts response.body
|
3928
4030
|
puts response.headers
|
3929
4031
|
```
|
3930
|
-
## Retrieve
|
4032
|
+
## Retrieve all invalid emails
|
3931
4033
|
|
3932
|
-
**This endpoint allows you to retrieve
|
4034
|
+
**This endpoint allows you to retrieve a list of all invalid email addresses.**
|
3933
4035
|
|
3934
|
-
|
4036
|
+
An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipient's mail server.
|
3935
4037
|
|
3936
|
-
|
4038
|
+
Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server.
|
3937
4039
|
|
3938
|
-
For more information
|
4040
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).
|
3939
4041
|
|
3940
|
-
### GET /
|
4042
|
+
### GET /suppression/invalid_emails
|
3941
4043
|
|
3942
4044
|
|
3943
4045
|
```ruby
|
3944
|
-
|
4046
|
+
params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
|
4047
|
+
response = sg.client.suppression.invalid_emails.get(query_params: params)
|
3945
4048
|
puts response.status_code
|
3946
4049
|
puts response.body
|
3947
4050
|
puts response.headers
|
3948
4051
|
```
|
3949
|
-
|
3950
|
-
# USER
|
4052
|
+
## Delete invalid emails
|
3951
4053
|
|
3952
|
-
|
4054
|
+
**This endpoint allows you to remove email addresses from your invalid email address list.**
|
3953
4055
|
|
3954
|
-
|
4056
|
+
There are two options for deleting invalid email addresses:
|
3955
4057
|
|
3956
|
-
|
4058
|
+
1) You can delete all invalid email addresses by setting `delete_all` to true in the request body.
|
4059
|
+
2) You can delete some invalid email addresses by specifying certain addresses in an array in the request body.
|
3957
4060
|
|
3958
|
-
|
4061
|
+
An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipient's mail server.
|
3959
4062
|
|
3960
|
-
|
4063
|
+
Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server.
|
3961
4064
|
|
3962
|
-
|
4065
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).
|
3963
4066
|
|
3964
|
-
###
|
4067
|
+
### DELETE /suppression/invalid_emails
|
3965
4068
|
|
3966
4069
|
|
3967
4070
|
```ruby
|
3968
|
-
|
4071
|
+
data = JSON.parse('{
|
4072
|
+
"delete_all": false,
|
4073
|
+
"emails": [
|
4074
|
+
"example1@example.com",
|
4075
|
+
"example2@example.com"
|
4076
|
+
]
|
4077
|
+
}')
|
4078
|
+
response = sg.client.suppression.invalid_emails.delete(request_body: data)
|
3969
4079
|
puts response.status_code
|
3970
4080
|
puts response.body
|
3971
4081
|
puts response.headers
|
3972
4082
|
```
|
3973
|
-
## Retrieve
|
4083
|
+
## Retrieve a specific invalid email
|
3974
4084
|
|
3975
|
-
**This endpoint allows you to retrieve
|
4085
|
+
**This endpoint allows you to retrieve a specific invalid email address.**
|
3976
4086
|
|
3977
|
-
|
4087
|
+
An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipient's mail server.
|
3978
4088
|
|
3979
|
-
|
4089
|
+
Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server.
|
4090
|
+
|
4091
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).
|
4092
|
+
|
4093
|
+
### GET /suppression/invalid_emails/{email}
|
3980
4094
|
|
3981
4095
|
|
3982
4096
|
```ruby
|
3983
|
-
|
4097
|
+
email = "test_url_param"
|
4098
|
+
response = sg.client.suppression.invalid_emails._(email).get()
|
3984
4099
|
puts response.status_code
|
3985
4100
|
puts response.body
|
3986
4101
|
puts response.headers
|
3987
4102
|
```
|
3988
|
-
##
|
4103
|
+
## Delete a specific invalid email
|
3989
4104
|
|
3990
|
-
**This endpoint allows you to
|
4105
|
+
**This endpoint allows you to remove a specific email address from the invalid email address list.**
|
3991
4106
|
|
3992
|
-
|
4107
|
+
An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipient's mail server.
|
3993
4108
|
|
3994
|
-
|
4109
|
+
Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server.
|
4110
|
+
|
4111
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html).
|
4112
|
+
|
4113
|
+
### DELETE /suppression/invalid_emails/{email}
|
4114
|
+
|
4115
|
+
|
4116
|
+
```ruby
|
4117
|
+
email = "test_url_param"
|
4118
|
+
response = sg.client.suppression.invalid_emails._(email).delete()
|
4119
|
+
puts response.status_code
|
4120
|
+
puts response.body
|
4121
|
+
puts response.headers
|
4122
|
+
```
|
4123
|
+
## Retrieve a specific spam report
|
4124
|
+
|
4125
|
+
**This endpoint allows you to retrieve a specific spam report.**
|
4126
|
+
|
4127
|
+
[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid.
|
3995
4128
|
|
3996
|
-
|
4129
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).
|
3997
4130
|
|
3998
|
-
###
|
4131
|
+
### GET /suppression/spam_report/{email}
|
3999
4132
|
|
4000
4133
|
|
4001
4134
|
```ruby
|
4002
|
-
|
4003
|
-
|
4004
|
-
}')
|
4005
|
-
response = sg.client.user.email.put(request_body: data)
|
4135
|
+
email = "test_url_param"
|
4136
|
+
response = sg.client.suppression.spam_reports._(email).get()
|
4006
4137
|
puts response.status_code
|
4007
4138
|
puts response.body
|
4008
4139
|
puts response.headers
|
4009
4140
|
```
|
4010
|
-
##
|
4011
|
-
|
4012
|
-
**This endpoint allows you to retrieve the email address currently on file for your account.**
|
4141
|
+
## Delete a specific spam report
|
4013
4142
|
|
4014
|
-
|
4143
|
+
**This endpoint allows you to delete a specific spam report.**
|
4015
4144
|
|
4016
|
-
|
4145
|
+
[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid.
|
4017
4146
|
|
4018
|
-
|
4147
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).
|
4019
4148
|
|
4020
|
-
###
|
4149
|
+
### DELETE /suppression/spam_report/{email}
|
4021
4150
|
|
4022
4151
|
|
4023
4152
|
```ruby
|
4024
|
-
|
4153
|
+
email = "test_url_param"
|
4154
|
+
response = sg.client.suppression.spam_reports._(email).delete()
|
4025
4155
|
puts response.status_code
|
4026
4156
|
puts response.body
|
4027
4157
|
puts response.headers
|
4028
4158
|
```
|
4029
|
-
##
|
4030
|
-
|
4031
|
-
**This endpoint allows you to update your password.**
|
4159
|
+
## Retrieve all spam reports
|
4032
4160
|
|
4033
|
-
|
4161
|
+
**This endpoint allows you to retrieve all spam reports.**
|
4034
4162
|
|
4035
|
-
|
4163
|
+
[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid.
|
4036
4164
|
|
4037
|
-
|
4165
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).
|
4038
4166
|
|
4039
|
-
###
|
4167
|
+
### GET /suppression/spam_reports
|
4040
4168
|
|
4041
4169
|
|
4042
4170
|
```ruby
|
4043
|
-
|
4044
|
-
|
4045
|
-
"old_password": "old_password"
|
4046
|
-
}')
|
4047
|
-
response = sg.client.user.password.put(request_body: data)
|
4171
|
+
params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
|
4172
|
+
response = sg.client.suppression.spam_reports.get(query_params: params)
|
4048
4173
|
puts response.status_code
|
4049
4174
|
puts response.body
|
4050
4175
|
puts response.headers
|
4051
4176
|
```
|
4052
|
-
##
|
4177
|
+
## Delete spam reports
|
4053
4178
|
|
4054
|
-
**This endpoint allows you to
|
4179
|
+
**This endpoint allows you to delete your spam reports.**
|
4055
4180
|
|
4056
|
-
|
4181
|
+
There are two options for deleting spam reports:
|
4057
4182
|
|
4058
|
-
|
4183
|
+
1) You can delete all spam reports by setting "delete_all" to true in the request body.
|
4184
|
+
2) You can delete some spam reports by specifying the email addresses in an array in the request body.
|
4059
4185
|
|
4060
|
-
|
4186
|
+
[Spam reports](https://sendgrid.com/docs/Glossary/spam_reports.html) happen when a recipient indicates that they think your email is [spam](https://sendgrid.com/docs/Glossary/spam.html) and then their email provider reports this to SendGrid.
|
4061
4187
|
|
4062
|
-
|
4188
|
+
For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/spam_reports.html).
|
4063
4189
|
|
4064
|
-
###
|
4190
|
+
### DELETE /suppression/spam_reports
|
4065
4191
|
|
4066
4192
|
|
4067
4193
|
```ruby
|
4068
4194
|
data = JSON.parse('{
|
4069
|
-
"
|
4070
|
-
"
|
4071
|
-
|
4195
|
+
"delete_all": false,
|
4196
|
+
"emails": [
|
4197
|
+
"example1@example.com",
|
4198
|
+
"example2@example.com"
|
4199
|
+
]
|
4072
4200
|
}')
|
4073
|
-
response = sg.client.
|
4201
|
+
response = sg.client.suppression.spam_reports.delete(request_body: data)
|
4074
4202
|
puts response.status_code
|
4075
4203
|
puts response.body
|
4076
4204
|
puts response.headers
|
4077
4205
|
```
|
4078
|
-
##
|
4079
|
-
|
4080
|
-
Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to.
|
4206
|
+
## Retrieve all global suppressions
|
4081
4207
|
|
4082
|
-
|
4208
|
+
**This endpoint allows you to retrieve a list of all email address that are globally suppressed.**
|
4083
4209
|
|
4084
|
-
|
4210
|
+
A global suppression (or global unsubscribe) is an email address of a recipient who does not want to receive any of your messages. A globally suppressed recipient will be removed from any email you send. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/global_unsubscribes.html).
|
4085
4211
|
|
4086
|
-
### GET /
|
4212
|
+
### GET /suppression/unsubscribes
|
4087
4213
|
|
4088
4214
|
|
4089
4215
|
```ruby
|
4090
|
-
|
4216
|
+
params = JSON.parse('{"start_time": 1, "limit": 1, "end_time": 1, "offset": 1}')
|
4217
|
+
response = sg.client.suppression.unsubscribes.get(query_params: params)
|
4091
4218
|
puts response.status_code
|
4092
4219
|
puts response.body
|
4093
4220
|
puts response.headers
|
4094
4221
|
```
|
4095
|
-
|
4222
|
+
<a name="templates"></a>
|
4223
|
+
# TEMPLATES
|
4096
4224
|
|
4097
|
-
|
4225
|
+
## Create a transactional template.
|
4098
4226
|
|
4099
|
-
|
4100
|
-
be returned.
|
4227
|
+
**This endpoint allows you to create a transactional template.**
|
4101
4228
|
|
4102
|
-
|
4229
|
+
Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts.
|
4103
4230
|
|
4104
|
-
|
4231
|
+
Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
|
4232
|
+
|
4233
|
+
### POST /templates
|
4105
4234
|
|
4106
4235
|
|
4107
4236
|
```ruby
|
4108
4237
|
data = JSON.parse('{
|
4109
|
-
"
|
4110
|
-
"status": "pause"
|
4238
|
+
"name": "example_name"
|
4111
4239
|
}')
|
4112
|
-
response = sg.client.
|
4240
|
+
response = sg.client.templates.post(request_body: data)
|
4113
4241
|
puts response.status_code
|
4114
4242
|
puts response.body
|
4115
4243
|
puts response.headers
|
4116
4244
|
```
|
4117
|
-
## Retrieve all
|
4245
|
+
## Retrieve all transactional templates.
|
4118
4246
|
|
4119
|
-
**This endpoint allows you to retrieve all
|
4247
|
+
**This endpoint allows you to retrieve all transactional templates.**
|
4120
4248
|
|
4121
|
-
|
4249
|
+
Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts.
|
4122
4250
|
|
4123
|
-
|
4251
|
+
Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
|
4124
4252
|
|
4253
|
+
### GET /templates
|
4125
4254
|
|
4126
4255
|
```ruby
|
4127
|
-
|
4256
|
+
params = JSON.parse('{"generations": "legacy,dynamic"}')
|
4257
|
+
response = sg.client.templates.get(query_params: params)
|
4128
4258
|
puts response.status_code
|
4129
4259
|
puts response.body
|
4130
4260
|
puts response.headers
|
4131
4261
|
```
|
4132
|
-
##
|
4262
|
+
## Edit a transactional template.
|
4133
4263
|
|
4134
|
-
**This endpoint allows you to
|
4264
|
+
**This endpoint allows you to edit a transactional template.**
|
4265
|
+
|
4266
|
+
Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts.
|
4267
|
+
|
4268
|
+
Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
|
4135
4269
|
|
4136
|
-
The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.
|
4137
4270
|
|
4138
|
-
### PATCH /
|
4271
|
+
### PATCH /templates/{template_id}
|
4139
4272
|
|
4140
4273
|
|
4141
4274
|
```ruby
|
4142
4275
|
data = JSON.parse('{
|
4143
|
-
"
|
4276
|
+
"name": "new_example_name"
|
4144
4277
|
}')
|
4145
|
-
|
4146
|
-
response = sg.client.
|
4278
|
+
template_id = "test_url_param"
|
4279
|
+
response = sg.client.templates._(template_id).patch(request_body: data)
|
4147
4280
|
puts response.status_code
|
4148
4281
|
puts response.body
|
4149
4282
|
puts response.headers
|
4150
4283
|
```
|
4151
|
-
## Retrieve
|
4152
|
-
|
4153
|
-
**This endpoint allows you to retrieve the cancel/paused scheduled send information for a specific `batch_id`.**
|
4154
|
-
|
4155
|
-
The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.
|
4156
|
-
|
4157
|
-
### GET /user/scheduled_sends/{batch_id}
|
4284
|
+
## Retrieve a single transactional template.
|
4158
4285
|
|
4286
|
+
**This endpoint allows you to retrieve a single transactional template.**
|
4159
4287
|
|
4160
|
-
|
4161
|
-
batch_id = "test_url_param"
|
4162
|
-
response = sg.client.user.scheduled_sends._(batch_id).get()
|
4163
|
-
puts response.status_code
|
4164
|
-
puts response.body
|
4165
|
-
puts response.headers
|
4166
|
-
```
|
4167
|
-
## Delete a cancellation or pause of a scheduled send
|
4288
|
+
Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts.
|
4168
4289
|
|
4169
|
-
|
4290
|
+
Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
|
4170
4291
|
|
4171
|
-
The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header.Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled.
|
4172
4292
|
|
4173
|
-
###
|
4293
|
+
### GET /templates/{template_id}
|
4174
4294
|
|
4175
4295
|
|
4176
4296
|
```ruby
|
4177
|
-
|
4178
|
-
response = sg.client.
|
4297
|
+
template_id = "test_url_param"
|
4298
|
+
response = sg.client.templates._(template_id).get()
|
4179
4299
|
puts response.status_code
|
4180
4300
|
puts response.body
|
4181
4301
|
puts response.headers
|
4182
4302
|
```
|
4183
|
-
##
|
4303
|
+
## Delete a template.
|
4184
4304
|
|
4185
|
-
**This endpoint allows you to
|
4305
|
+
**This endpoint allows you to delete a transactional template.**
|
4186
4306
|
|
4187
|
-
|
4307
|
+
Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts.
|
4188
4308
|
|
4189
|
-
|
4309
|
+
Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
|
4190
4310
|
|
4191
|
-
|
4311
|
+
|
4312
|
+
### DELETE /templates/{template_id}
|
4192
4313
|
|
4193
4314
|
|
4194
4315
|
```ruby
|
4195
|
-
|
4196
|
-
|
4197
|
-
"require_valid_cert": false
|
4198
|
-
}')
|
4199
|
-
response = sg.client.user.settings.enforced_tls.patch(request_body: data)
|
4316
|
+
template_id = "test_url_param"
|
4317
|
+
response = sg.client.templates._(template_id).delete()
|
4200
4318
|
puts response.status_code
|
4201
4319
|
puts response.body
|
4202
4320
|
puts response.headers
|
4203
4321
|
```
|
4204
|
-
##
|
4322
|
+
## Create a new transactional template version.
|
4205
4323
|
|
4206
|
-
**This endpoint allows you to
|
4324
|
+
**This endpoint allows you to create a new version of a template.**
|
4207
4325
|
|
4208
|
-
|
4326
|
+
Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across all templates.
|
4209
4327
|
|
4210
|
-
|
4328
|
+
For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
|
4211
4329
|
|
4212
|
-
|
4330
|
+
|
4331
|
+
### POST /templates/{template_id}/versions
|
4213
4332
|
|
4214
4333
|
|
4215
4334
|
```ruby
|
4216
|
-
|
4335
|
+
data = JSON.parse('{
|
4336
|
+
"active": 1,
|
4337
|
+
"html_content": "<%body%>",
|
4338
|
+
"name": "example_version_name",
|
4339
|
+
"plain_content": "<%body%>",
|
4340
|
+
"subject": "<%subject%>",
|
4341
|
+
"template_id": "ddb96bbc-9b92-425e-8979-99464621b543"
|
4342
|
+
}')
|
4343
|
+
template_id = "test_url_param"
|
4344
|
+
response = sg.client.templates._(template_id).versions.post(request_body: data)
|
4217
4345
|
puts response.status_code
|
4218
4346
|
puts response.body
|
4219
4347
|
puts response.headers
|
4220
4348
|
```
|
4221
|
-
##
|
4349
|
+
## Edit a transactional template version.
|
4222
4350
|
|
4223
|
-
**This endpoint allows you to
|
4351
|
+
**This endpoint allows you to edit a version of one of your transactional templates.**
|
4224
4352
|
|
4225
|
-
|
4353
|
+
Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across all templates.
|
4226
4354
|
|
4227
|
-
For more information about
|
4355
|
+
For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
|
4228
4356
|
|
4229
|
-
|
4357
|
+
## URI Parameters
|
4358
|
+
| URI Parameter | Type | Description |
|
4359
|
+
|---|---|---|
|
4360
|
+
| template_id | string | The ID of the original template |
|
4361
|
+
| version_id | string | The ID of the template version |
|
4230
4362
|
|
4231
|
-
###
|
4363
|
+
### PATCH /templates/{template_id}/versions/{version_id}
|
4232
4364
|
|
4233
4365
|
|
4234
4366
|
```ruby
|
4235
4367
|
data = JSON.parse('{
|
4236
|
-
"
|
4368
|
+
"active": 1,
|
4369
|
+
"html_content": "<%body%>",
|
4370
|
+
"name": "updated_example_name",
|
4371
|
+
"plain_content": "<%body%>",
|
4372
|
+
"subject": "<%subject%>"
|
4237
4373
|
}')
|
4238
|
-
|
4374
|
+
template_id = "test_url_param"
|
4375
|
+
version_id = "test_url_param"
|
4376
|
+
response = sg.client.templates._(template_id).versions._(version_id).patch(request_body: data)
|
4239
4377
|
puts response.status_code
|
4240
4378
|
puts response.body
|
4241
4379
|
puts response.headers
|
4242
4380
|
```
|
4243
|
-
## Retrieve
|
4381
|
+
## Retrieve a specific transactional template version.
|
4244
4382
|
|
4245
|
-
**This endpoint allows you to retrieve
|
4383
|
+
**This endpoint allows you to retrieve a specific version of a template.**
|
4246
4384
|
|
4247
|
-
|
4385
|
+
Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across all templates.
|
4248
4386
|
|
4249
|
-
For more information about
|
4387
|
+
For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
|
4250
4388
|
|
4251
|
-
|
4389
|
+
## URI Parameters
|
4390
|
+
| URI Parameter | Type | Description |
|
4391
|
+
|---|---|---|
|
4392
|
+
| template_id | string | The ID of the original template |
|
4393
|
+
| version_id | string | The ID of the template version |
|
4252
4394
|
|
4253
|
-
### GET /
|
4395
|
+
### GET /templates/{template_id}/versions/{version_id}
|
4254
4396
|
|
4255
4397
|
|
4256
4398
|
```ruby
|
4257
|
-
|
4399
|
+
template_id = "test_url_param"
|
4400
|
+
version_id = "test_url_param"
|
4401
|
+
response = sg.client.templates._(template_id).versions._(version_id).get()
|
4258
4402
|
puts response.status_code
|
4259
4403
|
puts response.body
|
4260
4404
|
puts response.headers
|
4261
4405
|
```
|
4262
|
-
##
|
4263
|
-
|
4264
|
-
**This endpoint allows you to update your current event webhook settings.**
|
4265
|
-
|
4266
|
-
If an event type is marked as `true`, then the event webhook will include information about that event.
|
4267
|
-
|
4268
|
-
SendGrids Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email.
|
4406
|
+
## Delete a transactional template version.
|
4269
4407
|
|
4270
|
-
|
4408
|
+
**This endpoint allows you to delete one of your transactional template versions.**
|
4271
4409
|
|
4272
|
-
|
4410
|
+
Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across all templates.
|
4273
4411
|
|
4412
|
+
For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
|
4274
4413
|
|
4275
|
-
|
4276
|
-
|
4277
|
-
|
4278
|
-
|
4279
|
-
|
4280
|
-
|
4281
|
-
|
4282
|
-
|
4283
|
-
|
4284
|
-
|
4285
|
-
|
4286
|
-
|
4287
|
-
|
4288
|
-
"unsubscribe": true,
|
4289
|
-
"url": "url"
|
4290
|
-
}')
|
4291
|
-
response = sg.client.user.webhooks.event.settings.patch(request_body: data)
|
4414
|
+
## URI Parameters
|
4415
|
+
| URI Parameter | Type | Description |
|
4416
|
+
|---|---|---|
|
4417
|
+
| template_id | string | The ID of the original template |
|
4418
|
+
| version_id | string | The ID of the template version |
|
4419
|
+
|
4420
|
+
### DELETE /templates/{template_id}/versions/{version_id}
|
4421
|
+
|
4422
|
+
|
4423
|
+
```ruby
|
4424
|
+
template_id = "test_url_param"
|
4425
|
+
version_id = "test_url_param"
|
4426
|
+
response = sg.client.templates._(template_id).versions._(version_id).delete()
|
4292
4427
|
puts response.status_code
|
4293
4428
|
puts response.body
|
4294
4429
|
puts response.headers
|
4295
4430
|
```
|
4296
|
-
##
|
4431
|
+
## Activate a transactional template version.
|
4297
4432
|
|
4298
|
-
**This endpoint allows you to
|
4433
|
+
**This endpoint allows you to activate a version of one of your templates.**
|
4299
4434
|
|
4300
|
-
|
4435
|
+
Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across all templates.
|
4301
4436
|
|
4302
|
-
SendGrids Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email.
|
4303
4437
|
|
4304
|
-
|
4438
|
+
For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html).
|
4305
4439
|
|
4306
|
-
|
4440
|
+
## URI Parameters
|
4441
|
+
| URI Parameter | Type | Description |
|
4442
|
+
|---|---|---|
|
4443
|
+
| template_id | string | The ID of the original template |
|
4444
|
+
| version_id | string | The ID of the template version |
|
4445
|
+
|
4446
|
+
### POST /templates/{template_id}/versions/{version_id}/activate
|
4307
4447
|
|
4308
4448
|
|
4309
4449
|
```ruby
|
4310
|
-
|
4450
|
+
template_id = "test_url_param"
|
4451
|
+
version_id = "test_url_param"
|
4452
|
+
response = sg.client.templates._(template_id).versions._(version_id).activate.post()
|
4311
4453
|
puts response.status_code
|
4312
4454
|
puts response.body
|
4313
4455
|
puts response.headers
|
4314
4456
|
```
|
4315
|
-
|
4457
|
+
<a name="tracking-settings"></a>
|
4458
|
+
# TRACKING SETTINGS
|
4316
4459
|
|
4317
|
-
|
4460
|
+
## Retrieve Tracking Settings
|
4318
4461
|
|
4319
|
-
|
4462
|
+
**This endpoint allows you to retrieve a list of all tracking settings that you can enable on your account.**
|
4320
4463
|
|
4321
|
-
|
4464
|
+
You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
|
4322
4465
|
|
4323
|
-
|
4466
|
+
For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
|
4467
|
+
|
4468
|
+
### GET /tracking_settings
|
4324
4469
|
|
4325
4470
|
|
4326
4471
|
```ruby
|
4327
|
-
|
4328
|
-
|
4329
|
-
}')
|
4330
|
-
response = sg.client.user.webhooks.event.test.post(request_body: data)
|
4472
|
+
params = JSON.parse('{"limit": 1, "offset": 1}')
|
4473
|
+
response = sg.client.tracking_settings.get(query_params: params)
|
4331
4474
|
puts response.status_code
|
4332
4475
|
puts response.body
|
4333
4476
|
puts response.headers
|
4334
4477
|
```
|
4335
|
-
##
|
4478
|
+
## Update Click Tracking Settings
|
4336
4479
|
|
4337
|
-
**This endpoint allows you to
|
4480
|
+
**This endpoint allows you to change your current click tracking setting. You can enable, or disable, click tracking using this endpoint.**
|
4338
4481
|
|
4339
|
-
|
4482
|
+
You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
|
4340
4483
|
|
4341
|
-
|
4484
|
+
For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
|
4485
|
+
|
4486
|
+
### PATCH /tracking_settings/click
|
4342
4487
|
|
4343
4488
|
|
4344
4489
|
```ruby
|
4345
4490
|
data = JSON.parse('{
|
4346
|
-
"
|
4347
|
-
"send_raw": false,
|
4348
|
-
"spam_check": true,
|
4349
|
-
"url": "http://email.myhosthame.com"
|
4491
|
+
"enabled": true
|
4350
4492
|
}')
|
4351
|
-
response = sg.client.
|
4493
|
+
response = sg.client.tracking_settings.click.patch(request_body: data)
|
4352
4494
|
puts response.status_code
|
4353
4495
|
puts response.body
|
4354
4496
|
puts response.headers
|
4355
4497
|
```
|
4356
|
-
## Retrieve
|
4498
|
+
## Retrieve Click Track Settings
|
4357
4499
|
|
4358
|
-
**This endpoint allows you to retrieve
|
4500
|
+
**This endpoint allows you to retrieve your current click tracking setting.**
|
4359
4501
|
|
4360
|
-
|
4502
|
+
You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
|
4361
4503
|
|
4362
|
-
|
4504
|
+
For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
|
4505
|
+
|
4506
|
+
### GET /tracking_settings/click
|
4363
4507
|
|
4364
4508
|
|
4365
4509
|
```ruby
|
4366
|
-
response = sg.client.
|
4510
|
+
response = sg.client.tracking_settings.click.get()
|
4367
4511
|
puts response.status_code
|
4368
4512
|
puts response.body
|
4369
4513
|
puts response.headers
|
4370
4514
|
```
|
4371
|
-
## Update
|
4515
|
+
## Update Google Analytics Settings
|
4372
4516
|
|
4373
|
-
**This endpoint allows you to update
|
4517
|
+
**This endpoint allows you to update your current setting for Google Analytics.**
|
4374
4518
|
|
4375
|
-
|
4519
|
+
For more information about using Google Analytics, please refer to [Googles URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on ["Best Practices for Campaign Building"](https://support.google.com/analytics/answer/1037445).
|
4376
4520
|
|
4377
|
-
|
4521
|
+
We default the settings to Googles recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/google_analytics_demystified_ga_statistics_vs_sg_statistics.html).
|
4522
|
+
|
4523
|
+
You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
|
4524
|
+
|
4525
|
+
For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
|
4526
|
+
|
4527
|
+
### PATCH /tracking_settings/google_analytics
|
4378
4528
|
|
4379
4529
|
|
4380
4530
|
```ruby
|
4381
4531
|
data = JSON.parse('{
|
4382
|
-
"
|
4383
|
-
"
|
4384
|
-
"
|
4532
|
+
"enabled": true,
|
4533
|
+
"utm_campaign": "website",
|
4534
|
+
"utm_content": "",
|
4535
|
+
"utm_medium": "email",
|
4536
|
+
"utm_source": "sendgrid.com",
|
4537
|
+
"utm_term": ""
|
4385
4538
|
}')
|
4386
|
-
|
4387
|
-
response = sg.client.user.webhooks.parse.settings._(hostname).patch(request_body: data)
|
4539
|
+
response = sg.client.tracking_settings.google_analytics.patch(request_body: data)
|
4388
4540
|
puts response.status_code
|
4389
4541
|
puts response.body
|
4390
4542
|
puts response.headers
|
4391
4543
|
```
|
4392
|
-
## Retrieve
|
4393
|
-
|
4394
|
-
**This endpoint allows you to retrieve a specific inbound parse setting.**
|
4395
|
-
|
4396
|
-
The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html).
|
4544
|
+
## Retrieve Google Analytics Settings
|
4397
4545
|
|
4398
|
-
|
4546
|
+
**This endpoint allows you to retrieve your current setting for Google Analytics.**
|
4399
4547
|
|
4548
|
+
For more information about using Google Analytics, please refer to [Googles URL Builder](https://support.google.com/analytics/answer/1033867?hl=en) and their article on ["Best Practices for Campaign Building"](https://support.google.com/analytics/answer/1037445).
|
4400
4549
|
|
4401
|
-
|
4402
|
-
hostname = "test_url_param"
|
4403
|
-
response = sg.client.user.webhooks.parse.settings._(hostname).get()
|
4404
|
-
puts response.status_code
|
4405
|
-
puts response.body
|
4406
|
-
puts response.headers
|
4407
|
-
```
|
4408
|
-
## Delete a parse setting
|
4550
|
+
We default the settings to Googles recommendations. For more information, see [Google Analytics Demystified](https://sendgrid.com/docs/Classroom/Track/Collecting_Data/google_analytics_demystified_ga_statistics_vs_sg_statistics.html).
|
4409
4551
|
|
4410
|
-
|
4552
|
+
You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
|
4411
4553
|
|
4412
|
-
|
4554
|
+
For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
|
4413
4555
|
|
4414
|
-
###
|
4556
|
+
### GET /tracking_settings/google_analytics
|
4415
4557
|
|
4416
4558
|
|
4417
4559
|
```ruby
|
4418
|
-
|
4419
|
-
response = sg.client.user.webhooks.parse.settings._(hostname).delete()
|
4560
|
+
response = sg.client.tracking_settings.google_analytics.get()
|
4420
4561
|
puts response.status_code
|
4421
4562
|
puts response.body
|
4422
4563
|
puts response.headers
|
4423
4564
|
```
|
4424
|
-
##
|
4565
|
+
## Update Open Tracking Settings
|
4425
4566
|
|
4426
|
-
**This endpoint allows you to
|
4567
|
+
**This endpoint allows you to update your current settings for open tracking.**
|
4427
4568
|
|
4428
|
-
|
4569
|
+
Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to Twilio SendGrid's server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook.
|
4429
4570
|
|
4430
|
-
|
4571
|
+
You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
|
4431
4572
|
|
4432
|
-
|
4573
|
+
For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
|
4574
|
+
|
4575
|
+
### PATCH /tracking_settings/open
|
4433
4576
|
|
4434
4577
|
|
4435
4578
|
```ruby
|
4436
|
-
|
4437
|
-
|
4579
|
+
data = JSON.parse('{
|
4580
|
+
"enabled": true
|
4581
|
+
}')
|
4582
|
+
response = sg.client.tracking_settings.open.patch(request_body: data)
|
4438
4583
|
puts response.status_code
|
4439
4584
|
puts response.body
|
4440
4585
|
puts response.headers
|
4441
4586
|
```
|
4442
|
-
|
4443
|
-
# WHITELABEL
|
4444
|
-
|
4445
|
-
## Create a domain whitelabel.
|
4587
|
+
## Get Open Tracking Settings
|
4446
4588
|
|
4447
|
-
**This endpoint allows you to
|
4589
|
+
**This endpoint allows you to retrieve your current settings for open tracking.**
|
4448
4590
|
|
4449
|
-
If
|
4450
|
-
1. Use the "username" parameter. This allows you to create a whitelabel on behalf of your subuser. This means the subuser is able to see and modify the created whitelabel.
|
4451
|
-
2. Use the Association workflow (see Associate Domain section). This allows you to assign a whitelabel created by the parent to a subuser. This means the subuser will default to the assigned whitelabel, but will not be able to see or modify that whitelabel. However, if the subuser creates their own whitelabel it will overwrite the assigned whitelabel.
|
4591
|
+
Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to Twilio SendGrid's server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook.
|
4452
4592
|
|
4453
|
-
|
4593
|
+
You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
|
4454
4594
|
|
4455
|
-
For more information
|
4595
|
+
For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
|
4456
4596
|
|
4457
|
-
###
|
4597
|
+
### GET /tracking_settings/open
|
4458
4598
|
|
4459
4599
|
|
4460
4600
|
```ruby
|
4461
|
-
|
4462
|
-
"automatic_security": false,
|
4463
|
-
"custom_spf": true,
|
4464
|
-
"default": true,
|
4465
|
-
"domain": "example.com",
|
4466
|
-
"ips": [
|
4467
|
-
"192.168.1.1",
|
4468
|
-
"192.168.1.2"
|
4469
|
-
],
|
4470
|
-
"subdomain": "news",
|
4471
|
-
"username": "john@example.com"
|
4472
|
-
}')
|
4473
|
-
response = sg.client.whitelabel.domains.post(request_body: data)
|
4601
|
+
response = sg.client.tracking_settings.open.get()
|
4474
4602
|
puts response.status_code
|
4475
4603
|
puts response.body
|
4476
4604
|
puts response.headers
|
4477
4605
|
```
|
4478
|
-
##
|
4606
|
+
## Update Subscription Tracking Settings
|
4479
4607
|
|
4480
|
-
**This endpoint allows you to
|
4608
|
+
**This endpoint allows you to update your current settings for subscription tracking.**
|
4481
4609
|
|
4482
|
-
|
4610
|
+
Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails.
|
4483
4611
|
|
4484
|
-
|
4612
|
+
You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
|
4485
4613
|
|
4614
|
+
For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
|
4486
4615
|
|
4487
|
-
###
|
4616
|
+
### PATCH /tracking_settings/subscription
|
4488
4617
|
|
4489
4618
|
|
4490
4619
|
```ruby
|
4491
|
-
|
4492
|
-
|
4620
|
+
data = JSON.parse('{
|
4621
|
+
"enabled": true,
|
4622
|
+
"html_content": "html content",
|
4623
|
+
"landing": "landing page html",
|
4624
|
+
"plain_content": "text content",
|
4625
|
+
"replace": "replacement tag",
|
4626
|
+
"url": "url"
|
4627
|
+
}')
|
4628
|
+
response = sg.client.tracking_settings.subscription.patch(request_body: data)
|
4493
4629
|
puts response.status_code
|
4494
4630
|
puts response.body
|
4495
4631
|
puts response.headers
|
4496
4632
|
```
|
4497
|
-
##
|
4633
|
+
## Retrieve Subscription Tracking Settings
|
4498
4634
|
|
4499
|
-
**This endpoint allows you to retrieve
|
4635
|
+
**This endpoint allows you to retrieve your current settings for subscription tracking.**
|
4500
4636
|
|
4501
|
-
|
4637
|
+
Subscription tracking adds links to the bottom of your emails that allows your recipients to subscribe to, or unsubscribe from, your emails.
|
4502
4638
|
|
4503
|
-
|
4639
|
+
You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails.
|
4504
4640
|
|
4505
|
-
|
4506
|
-
| URI Parameter | Type | Description |
|
4507
|
-
|---|---|---|
|
4508
|
-
| domain | string |The domain to find a default domain whitelabel for. |
|
4641
|
+
For more information about tracking, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/tracking.html).
|
4509
4642
|
|
4510
|
-
### GET /
|
4643
|
+
### GET /tracking_settings/subscription
|
4511
4644
|
|
4512
4645
|
|
4513
4646
|
```ruby
|
4514
|
-
response = sg.client.
|
4647
|
+
response = sg.client.tracking_settings.subscription.get()
|
4515
4648
|
puts response.status_code
|
4516
4649
|
puts response.body
|
4517
4650
|
puts response.headers
|
4518
4651
|
```
|
4519
|
-
|
4652
|
+
<a name="user"></a>
|
4653
|
+
# USER
|
4520
4654
|
|
4521
|
-
|
4655
|
+
## Get a user's account information.
|
4522
4656
|
|
4523
|
-
|
4657
|
+
**This endpoint allows you to retrieve your user account details.**
|
4524
4658
|
|
4525
|
-
|
4659
|
+
Your user's account information includes the user's account type and reputation.
|
4526
4660
|
|
4527
|
-
|
4661
|
+
Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to.
|
4528
4662
|
|
4529
|
-
|
4530
|
-
| URI Parameter | Type | Description |
|
4531
|
-
|---|---|---|
|
4532
|
-
| username | string | Username of the subuser to find associated whitelabels for. |
|
4663
|
+
For more information about your user profile:
|
4533
4664
|
|
4534
|
-
|
4665
|
+
* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
|
4666
|
+
|
4667
|
+
### GET /user/account
|
4535
4668
|
|
4536
4669
|
|
4537
4670
|
```ruby
|
4538
|
-
response = sg.client.
|
4671
|
+
response = sg.client.user.account.get()
|
4539
4672
|
puts response.status_code
|
4540
4673
|
puts response.body
|
4541
4674
|
puts response.headers
|
4542
4675
|
```
|
4543
|
-
##
|
4544
|
-
|
4545
|
-
**This endpoint allows you to disassociate a specific whitelabel from a subuser.**
|
4546
|
-
|
4547
|
-
A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
|
4548
|
-
|
4549
|
-
Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools.
|
4676
|
+
## Retrieve your credit balance
|
4550
4677
|
|
4551
|
-
|
4678
|
+
**This endpoint allows you to retrieve the current credit balance for your account.**
|
4552
4679
|
|
4553
|
-
|
4554
|
-
| URI Parameter | Type | Required? | Description |
|
4555
|
-
|---|---|---|---|
|
4556
|
-
| username | string | required | Username for the subuser to find associated whitelabels for. |
|
4680
|
+
Your monthly credit allotment limits the number of emails you may send before incurring overage charges. For more information about credits and billing, please visit our [Classroom](https://sendgrid.com/docs/Classroom/Basics/Billing/billing_info_and_faqs.html).
|
4557
4681
|
|
4558
|
-
###
|
4682
|
+
### GET /user/credits
|
4559
4683
|
|
4560
4684
|
|
4561
4685
|
```ruby
|
4562
|
-
response = sg.client.
|
4686
|
+
response = sg.client.user.credits.get()
|
4563
4687
|
puts response.status_code
|
4564
4688
|
puts response.body
|
4565
4689
|
puts response.headers
|
4566
4690
|
```
|
4567
|
-
## Update
|
4691
|
+
## Update your account email address
|
4568
4692
|
|
4569
|
-
**This endpoint allows you to update the
|
4693
|
+
**This endpoint allows you to update the email address currently on file for your account.**
|
4570
4694
|
|
4571
|
-
|
4695
|
+
Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to.
|
4572
4696
|
|
4573
|
-
For more information
|
4697
|
+
For more information about your user profile:
|
4574
4698
|
|
4575
|
-
|
4699
|
+
* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
|
4700
|
+
|
4701
|
+
### PUT /user/email
|
4576
4702
|
|
4577
4703
|
|
4578
4704
|
```ruby
|
4579
4705
|
data = JSON.parse('{
|
4580
|
-
"
|
4581
|
-
"default": false
|
4706
|
+
"email": "example@example.com"
|
4582
4707
|
}')
|
4583
|
-
|
4584
|
-
response = sg.client.whitelabel.domains._(domain_id).patch(request_body: data)
|
4708
|
+
response = sg.client.user.email.put(request_body: data)
|
4585
4709
|
puts response.status_code
|
4586
4710
|
puts response.body
|
4587
4711
|
puts response.headers
|
4588
4712
|
```
|
4589
|
-
## Retrieve
|
4713
|
+
## Retrieve your account email address
|
4590
4714
|
|
4591
|
-
**This endpoint allows you to retrieve
|
4715
|
+
**This endpoint allows you to retrieve the email address currently on file for your account.**
|
4592
4716
|
|
4593
|
-
|
4717
|
+
Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to.
|
4594
4718
|
|
4595
|
-
For more information
|
4719
|
+
For more information about your user profile:
|
4596
4720
|
|
4721
|
+
* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
|
4597
4722
|
|
4598
|
-
### GET /
|
4723
|
+
### GET /user/email
|
4599
4724
|
|
4600
4725
|
|
4601
4726
|
```ruby
|
4602
|
-
|
4603
|
-
response = sg.client.whitelabel.domains._(domain_id).get()
|
4727
|
+
response = sg.client.user.email.get()
|
4604
4728
|
puts response.status_code
|
4605
4729
|
puts response.body
|
4606
4730
|
puts response.headers
|
4607
4731
|
```
|
4608
|
-
##
|
4732
|
+
## Update your password
|
4609
4733
|
|
4610
|
-
**This endpoint allows you to
|
4734
|
+
**This endpoint allows you to update your password.**
|
4611
4735
|
|
4612
|
-
|
4736
|
+
Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to.
|
4613
4737
|
|
4614
|
-
For more information
|
4738
|
+
For more information about your user profile:
|
4615
4739
|
|
4616
|
-
|
4740
|
+
* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
|
4741
|
+
|
4742
|
+
### PUT /user/password
|
4617
4743
|
|
4618
4744
|
|
4619
4745
|
```ruby
|
4620
|
-
|
4621
|
-
|
4746
|
+
data = JSON.parse('{
|
4747
|
+
"new_password": "new_password",
|
4748
|
+
"old_password": "old_password"
|
4749
|
+
}')
|
4750
|
+
response = sg.client.user.password.put(request_body: data)
|
4622
4751
|
puts response.status_code
|
4623
4752
|
puts response.body
|
4624
4753
|
puts response.headers
|
4625
4754
|
```
|
4626
|
-
##
|
4755
|
+
## Update a user's profile
|
4627
4756
|
|
4628
|
-
**This endpoint allows you to
|
4757
|
+
**This endpoint allows you to update your current profile details.**
|
4629
4758
|
|
4630
|
-
|
4759
|
+
Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to.
|
4631
4760
|
|
4632
|
-
|
4761
|
+
For more information about your user profile:
|
4633
4762
|
|
4634
|
-
|
4763
|
+
* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
|
4635
4764
|
|
4636
|
-
|
4637
|
-
| URI Parameter | Type | Description |
|
4638
|
-
|---|---|---|
|
4639
|
-
| domain_id | integer | ID of the domain whitelabel to associate with the subuser. |
|
4765
|
+
It should be noted that any one or more of the parameters can be updated via the PATCH /user/profile endpoint. The only requirement is that you include at least one when you PATCH.
|
4640
4766
|
|
4641
|
-
###
|
4767
|
+
### PATCH /user/profile
|
4642
4768
|
|
4643
4769
|
|
4644
4770
|
```ruby
|
4645
4771
|
data = JSON.parse('{
|
4646
|
-
"
|
4772
|
+
"city": "Orange",
|
4773
|
+
"first_name": "Example",
|
4774
|
+
"last_name": "User"
|
4647
4775
|
}')
|
4648
|
-
|
4649
|
-
response = sg.client.whitelabel.domains._(domain_id).subuser.post(request_body: data)
|
4776
|
+
response = sg.client.user.profile.patch(request_body: data)
|
4650
4777
|
puts response.status_code
|
4651
4778
|
puts response.body
|
4652
4779
|
puts response.headers
|
4653
4780
|
```
|
4654
|
-
##
|
4655
|
-
|
4656
|
-
**This endpoint allows you to add an IP address to a domain whitelabel.**
|
4781
|
+
## Get a user's profile
|
4657
4782
|
|
4658
|
-
|
4783
|
+
Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to.
|
4659
4784
|
|
4660
|
-
For more information
|
4785
|
+
For more information about your user profile:
|
4661
4786
|
|
4662
|
-
|
4663
|
-
| URI Parameter | Type | Description |
|
4664
|
-
|---|---|---|
|
4665
|
-
| id | integer | ID of the domain to which you are adding an IP |
|
4787
|
+
* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
|
4666
4788
|
|
4667
|
-
###
|
4789
|
+
### GET /user/profile
|
4668
4790
|
|
4669
4791
|
|
4670
4792
|
```ruby
|
4671
|
-
|
4672
|
-
"ip": "192.168.0.1"
|
4673
|
-
}')
|
4674
|
-
id = "test_url_param"
|
4675
|
-
response = sg.client.whitelabel.domains._(id).ips.post(request_body: data)
|
4793
|
+
response = sg.client.user.profile.get()
|
4676
4794
|
puts response.status_code
|
4677
4795
|
puts response.body
|
4678
4796
|
puts response.headers
|
4679
4797
|
```
|
4680
|
-
##
|
4681
|
-
|
4682
|
-
**This endpoint allows you to remove a domain's IP address from that domain's whitelabel.**
|
4798
|
+
## Cancel or pause a scheduled send
|
4683
4799
|
|
4684
|
-
|
4800
|
+
**This endpoint allows you to cancel or pause an email that has been scheduled to be sent.**
|
4685
4801
|
|
4686
|
-
|
4802
|
+
If the maximum number of cancellations/pauses are added, HTTP 400 will
|
4803
|
+
be returned.
|
4687
4804
|
|
4688
|
-
|
4689
|
-
| URI Parameter | Type | Description |
|
4690
|
-
|---|---|---|
|
4691
|
-
| id | integer | ID of the domain whitelabel to delete the IP from. |
|
4692
|
-
| ip | string | IP to remove from the domain whitelabel. |
|
4805
|
+
The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header. Scheduled sends canceled less than 10 minutes before the scheduled time are not guaranteed to be canceled.
|
4693
4806
|
|
4694
|
-
###
|
4807
|
+
### POST /user/scheduled_sends
|
4695
4808
|
|
4696
4809
|
|
4697
4810
|
```ruby
|
4698
|
-
|
4699
|
-
|
4700
|
-
|
4811
|
+
data = JSON.parse('{
|
4812
|
+
"batch_id": "YOUR_BATCH_ID",
|
4813
|
+
"status": "pause"
|
4814
|
+
}')
|
4815
|
+
response = sg.client.user.scheduled_sends.post(request_body: data)
|
4701
4816
|
puts response.status_code
|
4702
4817
|
puts response.body
|
4703
4818
|
puts response.headers
|
4704
4819
|
```
|
4705
|
-
##
|
4706
|
-
|
4707
|
-
**This endpoint allows you to validate a domain whitelabel. If it fails, it will return an error message describing why the whitelabel could not be validated.**
|
4708
|
-
|
4709
|
-
A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record.
|
4820
|
+
## Retrieve all scheduled sends
|
4710
4821
|
|
4711
|
-
|
4822
|
+
**This endpoint allows you to retrieve all cancel/paused scheduled send information.**
|
4712
4823
|
|
4713
|
-
|
4714
|
-
| URI Parameter | Type | Description |
|
4715
|
-
|---|---|---|
|
4716
|
-
| id | integer |ID of the domain whitelabel to validate. |
|
4824
|
+
The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header. Scheduled sends canceled less than 10 minutes before the scheduled time are not guaranteed to be canceled.
|
4717
4825
|
|
4718
|
-
###
|
4826
|
+
### GET /user/scheduled_sends
|
4719
4827
|
|
4720
4828
|
|
4721
4829
|
```ruby
|
4722
|
-
|
4723
|
-
response = sg.client.whitelabel.domains._(id).validate.post()
|
4830
|
+
response = sg.client.user.scheduled_sends.get()
|
4724
4831
|
puts response.status_code
|
4725
4832
|
puts response.body
|
4726
4833
|
puts response.headers
|
4727
4834
|
```
|
4728
|
-
##
|
4729
|
-
|
4730
|
-
**This endpoint allows you to create an IP whitelabel.**
|
4731
|
-
|
4732
|
-
When creating an IP whitelable, you should use the same subdomain that you used when you created a domain whitelabel.
|
4835
|
+
## Update user scheduled send information
|
4733
4836
|
|
4734
|
-
|
4837
|
+
**This endpoint allows you to update the status of a scheduled send for the given `batch_id`.**
|
4735
4838
|
|
4736
|
-
|
4839
|
+
The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header. Scheduled sends canceled less than 10 minutes before the scheduled time are not guaranteed to be canceled.
|
4737
4840
|
|
4738
|
-
###
|
4841
|
+
### PATCH /user/scheduled_sends/{batch_id}
|
4739
4842
|
|
4740
4843
|
|
4741
4844
|
```ruby
|
4742
4845
|
data = JSON.parse('{
|
4743
|
-
"
|
4744
|
-
"ip": "192.168.1.1",
|
4745
|
-
"subdomain": "email"
|
4846
|
+
"status": "pause"
|
4746
4847
|
}')
|
4747
|
-
|
4848
|
+
batch_id = "test_url_param"
|
4849
|
+
response = sg.client.user.scheduled_sends._(batch_id).patch(request_body: data)
|
4748
4850
|
puts response.status_code
|
4749
4851
|
puts response.body
|
4750
4852
|
puts response.headers
|
4751
4853
|
```
|
4752
|
-
## Retrieve
|
4753
|
-
|
4754
|
-
**This endpoint allows you to retrieve all of the IP whitelabels that have been created by this account.**
|
4755
|
-
|
4756
|
-
You may include a search key by using the "ip" parameter. This enables you to perform a prefix search for a given IP segment (e.g. "192.").
|
4854
|
+
## Retrieve scheduled send
|
4757
4855
|
|
4758
|
-
|
4856
|
+
**This endpoint allows you to retrieve the cancel/paused scheduled send information for a specific `batch_id`.**
|
4759
4857
|
|
4760
|
-
|
4858
|
+
The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header. Scheduled sends canceled less than 10 minutes before the scheduled time are not guaranteed to be canceled.
|
4761
4859
|
|
4762
|
-
### GET /
|
4860
|
+
### GET /user/scheduled_sends/{batch_id}
|
4763
4861
|
|
4764
4862
|
|
4765
4863
|
```ruby
|
4766
|
-
|
4767
|
-
response = sg.client.
|
4864
|
+
batch_id = "test_url_param"
|
4865
|
+
response = sg.client.user.scheduled_sends._(batch_id).get()
|
4768
4866
|
puts response.status_code
|
4769
4867
|
puts response.body
|
4770
4868
|
puts response.headers
|
4771
4869
|
```
|
4772
|
-
##
|
4773
|
-
|
4774
|
-
**This endpoint allows you to retrieve an IP whitelabel.**
|
4870
|
+
## Delete a cancellation or pause of a scheduled send
|
4775
4871
|
|
4776
|
-
|
4872
|
+
**This endpoint allows you to delete the cancellation/pause of a scheduled send.**
|
4777
4873
|
|
4778
|
-
|
4874
|
+
The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header. Scheduled sends canceled less than 10 minutes before the scheduled time are not guaranteed to be canceled.
|
4779
4875
|
|
4780
|
-
###
|
4876
|
+
### DELETE /user/scheduled_sends/{batch_id}
|
4781
4877
|
|
4782
4878
|
|
4783
4879
|
```ruby
|
4784
|
-
|
4785
|
-
response = sg.client.
|
4880
|
+
batch_id = "test_url_param"
|
4881
|
+
response = sg.client.user.scheduled_sends._(batch_id).delete()
|
4786
4882
|
puts response.status_code
|
4787
4883
|
puts response.body
|
4788
4884
|
puts response.headers
|
4789
4885
|
```
|
4790
|
-
##
|
4886
|
+
## Update Enforced TLS settings
|
4791
4887
|
|
4792
|
-
**This endpoint allows you to
|
4888
|
+
**This endpoint allows you to update your current Enforced TLS settings.**
|
4793
4889
|
|
4794
|
-
|
4890
|
+
The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. See the [SMTP Ports User Guide](https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html) for more information on opportunistic TLS.
|
4795
4891
|
|
4796
|
-
|
4892
|
+
**Note:** If either setting is enabled and the recipient does not support TLS or have a valid certificate, we drop the message and send a block event with TLS required but not supported as the description.
|
4797
4893
|
|
4798
|
-
###
|
4894
|
+
### PATCH /user/settings/enforced_tls
|
4799
4895
|
|
4800
4896
|
|
4801
4897
|
```ruby
|
4802
|
-
|
4803
|
-
|
4898
|
+
data = JSON.parse('{
|
4899
|
+
"require_tls": true,
|
4900
|
+
"require_valid_cert": false
|
4901
|
+
}')
|
4902
|
+
response = sg.client.user.settings.enforced_tls.patch(request_body: data)
|
4804
4903
|
puts response.status_code
|
4805
4904
|
puts response.body
|
4806
4905
|
puts response.headers
|
4807
4906
|
```
|
4808
|
-
##
|
4907
|
+
## Retrieve current Enforced TLS settings.
|
4809
4908
|
|
4810
|
-
**This endpoint allows you to
|
4909
|
+
**This endpoint allows you to retrieve your current Enforced TLS settings.**
|
4811
4910
|
|
4812
|
-
|
4911
|
+
The Enforced TLS settings specify whether or not the recipient is required to support TLS or have a valid certificate. See the [SMTP Ports User Guide](https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html) for more information on opportunistic TLS.
|
4813
4912
|
|
4814
|
-
|
4913
|
+
**Note:** If either setting is enabled and the recipient does not support TLS or have a valid certificate, we drop the message and send a block event with TLS required but not supported as the description.
|
4815
4914
|
|
4816
|
-
###
|
4915
|
+
### GET /user/settings/enforced_tls
|
4817
4916
|
|
4818
4917
|
|
4819
4918
|
```ruby
|
4820
|
-
|
4821
|
-
response = sg.client.whitelabel.ips._(id).validate.post()
|
4919
|
+
response = sg.client.user.settings.enforced_tls.get()
|
4822
4920
|
puts response.status_code
|
4823
4921
|
puts response.body
|
4824
4922
|
puts response.headers
|
4825
4923
|
```
|
4826
|
-
##
|
4924
|
+
## Update your username
|
4925
|
+
|
4926
|
+
**This endpoint allows you to update the username for your account.**
|
4827
4927
|
|
4828
|
-
|
4928
|
+
Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to.
|
4829
4929
|
|
4830
|
-
|
4930
|
+
For more information about your user profile:
|
4831
4931
|
|
4832
|
-
|
4932
|
+
* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
|
4833
4933
|
|
4834
|
-
###
|
4934
|
+
### PUT /user/username
|
4835
4935
|
|
4836
4936
|
|
4837
4937
|
```ruby
|
4838
4938
|
data = JSON.parse('{
|
4839
|
-
"
|
4840
|
-
"domain": "example.com",
|
4841
|
-
"subdomain": "mail"
|
4939
|
+
"username": "test_username"
|
4842
4940
|
}')
|
4843
|
-
|
4844
|
-
response = sg.client.whitelabel.links.post(request_body: data, query_params: params)
|
4941
|
+
response = sg.client.user.username.put(request_body: data)
|
4845
4942
|
puts response.status_code
|
4846
4943
|
puts response.body
|
4847
4944
|
puts response.headers
|
4848
4945
|
```
|
4849
|
-
## Retrieve
|
4946
|
+
## Retrieve your username
|
4947
|
+
|
4948
|
+
**This endpoint allows you to retrieve your current account username.**
|
4850
4949
|
|
4851
|
-
|
4950
|
+
Keeping your user profile up to date is important. This will help Twilio SendGrid to verify who you are as well as contact you should we need to.
|
4852
4951
|
|
4853
|
-
|
4952
|
+
For more information about your user profile:
|
4854
4953
|
|
4855
|
-
|
4954
|
+
* [Twilio SendGrid Account Settings](https://sendgrid.com/docs/User_Guide/Settings/account.html)
|
4856
4955
|
|
4857
|
-
### GET /
|
4956
|
+
### GET /user/username
|
4858
4957
|
|
4859
4958
|
|
4860
4959
|
```ruby
|
4861
|
-
|
4862
|
-
response = sg.client.whitelabel.links.get(query_params: params)
|
4960
|
+
response = sg.client.user.username.get()
|
4863
4961
|
puts response.status_code
|
4864
4962
|
puts response.body
|
4865
4963
|
puts response.headers
|
4866
4964
|
```
|
4867
|
-
##
|
4965
|
+
## Update Event Notification Settings
|
4868
4966
|
|
4869
|
-
**This endpoint allows you to
|
4967
|
+
**This endpoint allows you to update your current event webhook settings.**
|
4870
4968
|
|
4871
|
-
|
4872
|
-
<ul>
|
4873
|
-
<li>Validated link whitelabels marked as "default"</li>
|
4874
|
-
<li>Legacy link whitelabels (migrated from the whitelabel wizard)</li>
|
4875
|
-
<li>Default SendGrid link whitelabel (i.e. 100.ct.sendgrid.net)</li>
|
4876
|
-
</ul>
|
4969
|
+
If an event type is marked as `true`, then the event webhook will include information about that event.
|
4877
4970
|
|
4878
|
-
|
4971
|
+
Twilio SendGrid's Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as Twilio SendGrid processes your email.
|
4879
4972
|
|
4880
|
-
|
4973
|
+
Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program.
|
4881
4974
|
|
4882
|
-
###
|
4975
|
+
### PATCH /user/webhooks/event/settings
|
4883
4976
|
|
4884
4977
|
|
4885
4978
|
```ruby
|
4886
|
-
|
4887
|
-
|
4979
|
+
data = JSON.parse('{
|
4980
|
+
"bounce": true,
|
4981
|
+
"click": true,
|
4982
|
+
"deferred": true,
|
4983
|
+
"delivered": true,
|
4984
|
+
"dropped": true,
|
4985
|
+
"enabled": true,
|
4986
|
+
"group_resubscribe": true,
|
4987
|
+
"group_unsubscribe": true,
|
4988
|
+
"open": true,
|
4989
|
+
"processed": true,
|
4990
|
+
"spam_report": true,
|
4991
|
+
"unsubscribe": true,
|
4992
|
+
"url": "url"
|
4993
|
+
}')
|
4994
|
+
response = sg.client.user.webhooks.event.settings.patch(request_body: data)
|
4888
4995
|
puts response.status_code
|
4889
4996
|
puts response.body
|
4890
4997
|
puts response.headers
|
4891
4998
|
```
|
4892
|
-
## Retrieve
|
4999
|
+
## Retrieve Event Webhook settings
|
4893
5000
|
|
4894
|
-
**This endpoint allows you to retrieve
|
5001
|
+
**This endpoint allows you to retrieve your current event webhook settings.**
|
4895
5002
|
|
4896
|
-
|
4897
|
-
subusers to send mail using their parent's link whitelabels. To associate a link whitelabel, the parent account
|
4898
|
-
must first create a whitelabel and validate it. The parent may then associate that whitelabel with a subuser via the API or the Subuser Management page in the user interface.
|
5003
|
+
If an event type is marked as `true`, then the event webhook will include information about that event.
|
4899
5004
|
|
4900
|
-
|
5005
|
+
Twilio SendGrid's Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as Twilio SendGrid processes your email.
|
4901
5006
|
|
4902
|
-
|
5007
|
+
Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program.
|
4903
5008
|
|
4904
|
-
### GET /
|
5009
|
+
### GET /user/webhooks/event/settings
|
4905
5010
|
|
4906
5011
|
|
4907
5012
|
```ruby
|
4908
|
-
|
4909
|
-
response = sg.client.whitelabel.links.subuser.get(query_params: params)
|
5013
|
+
response = sg.client.user.webhooks.event.settings.get()
|
4910
5014
|
puts response.status_code
|
4911
5015
|
puts response.body
|
4912
5016
|
puts response.headers
|
4913
5017
|
```
|
4914
|
-
##
|
4915
|
-
|
4916
|
-
**This endpoint allows you to disassociate a link whitelabel from a subuser.**
|
5018
|
+
## Test Event Notification Settings
|
4917
5019
|
|
4918
|
-
|
4919
|
-
subusers to send mail using their parent's link whitelabels. To associate a link whitelabel, the parent account
|
4920
|
-
must first create a whitelabel and validate it. The parent may then associate that whitelabel with a subuser via the API or the Subuser Management page in the user interface.
|
5020
|
+
**This endpoint allows you to test your event webhook by sending a fake event notification post to the provided URL.**
|
4921
5021
|
|
4922
|
-
|
5022
|
+
Twilio SendGrid's Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as Twilio SendGrid processes your email.
|
4923
5023
|
|
4924
|
-
|
5024
|
+
Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program.
|
4925
5025
|
|
4926
|
-
###
|
5026
|
+
### POST /user/webhooks/event/test
|
4927
5027
|
|
4928
5028
|
|
4929
5029
|
```ruby
|
4930
|
-
|
4931
|
-
|
5030
|
+
data = JSON.parse('{
|
5031
|
+
"url": "url"
|
5032
|
+
}')
|
5033
|
+
response = sg.client.user.webhooks.event.test.post(request_body: data)
|
4932
5034
|
puts response.status_code
|
4933
5035
|
puts response.body
|
4934
5036
|
puts response.headers
|
4935
5037
|
```
|
4936
|
-
##
|
4937
|
-
|
4938
|
-
**This endpoint allows you to update a specific link whitelabel. You can use this endpoint to change a link whitelabel's default status.**
|
5038
|
+
## Create a parse setting
|
4939
5039
|
|
4940
|
-
|
5040
|
+
**This endpoint allows you to create a new inbound parse setting.**
|
4941
5041
|
|
4942
|
-
For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/
|
5042
|
+
The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html).
|
4943
5043
|
|
4944
|
-
###
|
5044
|
+
### POST /user/webhooks/parse/settings
|
4945
5045
|
|
4946
5046
|
|
4947
5047
|
```ruby
|
4948
5048
|
data = JSON.parse('{
|
4949
|
-
"
|
5049
|
+
"hostname": "myhostname.com",
|
5050
|
+
"send_raw": false,
|
5051
|
+
"spam_check": true,
|
5052
|
+
"url": "http://email.myhosthame.com"
|
4950
5053
|
}')
|
4951
|
-
|
4952
|
-
response = sg.client.whitelabel.links._(id).patch(request_body: data)
|
5054
|
+
response = sg.client.user.webhooks.parse.settings.post(request_body: data)
|
4953
5055
|
puts response.status_code
|
4954
5056
|
puts response.body
|
4955
5057
|
puts response.headers
|
4956
5058
|
```
|
4957
|
-
## Retrieve
|
4958
|
-
|
4959
|
-
**This endpoint allows you to retrieve a specific link whitelabel.**
|
5059
|
+
## Retrieve all parse settings
|
4960
5060
|
|
4961
|
-
|
5061
|
+
**This endpoint allows you to retrieve all of your current inbound parse settings.**
|
4962
5062
|
|
4963
|
-
For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/
|
5063
|
+
The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html).
|
4964
5064
|
|
4965
|
-
### GET /
|
5065
|
+
### GET /user/webhooks/parse/settings
|
4966
5066
|
|
4967
5067
|
|
4968
5068
|
```ruby
|
4969
|
-
|
4970
|
-
response = sg.client.whitelabel.links._(id).get()
|
5069
|
+
response = sg.client.user.webhooks.parse.settings.get()
|
4971
5070
|
puts response.status_code
|
4972
5071
|
puts response.body
|
4973
5072
|
puts response.headers
|
4974
5073
|
```
|
4975
|
-
##
|
4976
|
-
|
4977
|
-
**This endpoint allows you to delete a link whitelabel.**
|
5074
|
+
## Update a parse setting
|
4978
5075
|
|
4979
|
-
|
5076
|
+
**This endpoint allows you to update a specific inbound parse setting.**
|
4980
5077
|
|
4981
|
-
For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/
|
5078
|
+
The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html).
|
4982
5079
|
|
4983
|
-
###
|
5080
|
+
### PATCH /user/webhooks/parse/settings/{hostname}
|
4984
5081
|
|
4985
5082
|
|
4986
5083
|
```ruby
|
4987
|
-
|
4988
|
-
|
5084
|
+
data = JSON.parse('{
|
5085
|
+
"send_raw": true,
|
5086
|
+
"spam_check": false,
|
5087
|
+
"url": "http://newdomain.com/parse"
|
5088
|
+
}')
|
5089
|
+
hostname = "test_url_param"
|
5090
|
+
response = sg.client.user.webhooks.parse.settings._(hostname).patch(request_body: data)
|
4989
5091
|
puts response.status_code
|
4990
5092
|
puts response.body
|
4991
5093
|
puts response.headers
|
4992
5094
|
```
|
4993
|
-
##
|
4994
|
-
|
4995
|
-
**This endpoint allows you to validate a link whitelabel.**
|
5095
|
+
## Retrieve a specific parse setting
|
4996
5096
|
|
4997
|
-
|
5097
|
+
**This endpoint allows you to retrieve a specific inbound parse setting.**
|
4998
5098
|
|
4999
|
-
For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/
|
5099
|
+
The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html).
|
5000
5100
|
|
5001
|
-
###
|
5101
|
+
### GET /user/webhooks/parse/settings/{hostname}
|
5002
5102
|
|
5003
5103
|
|
5004
5104
|
```ruby
|
5005
|
-
|
5006
|
-
response = sg.client.
|
5105
|
+
hostname = "test_url_param"
|
5106
|
+
response = sg.client.user.webhooks.parse.settings._(hostname).get()
|
5007
5107
|
puts response.status_code
|
5008
5108
|
puts response.body
|
5009
5109
|
puts response.headers
|
5010
5110
|
```
|
5011
|
-
##
|
5111
|
+
## Delete a parse setting
|
5012
5112
|
|
5013
|
-
**This endpoint allows you to
|
5113
|
+
**This endpoint allows you to delete a specific inbound parse setting.**
|
5014
5114
|
|
5015
|
-
|
5016
|
-
subusers to send mail using their parent's link whitelabels. To associate a link whitelabel, the parent account
|
5017
|
-
must first create a whitelabel and validate it. The parent may then associate that whitelabel with a subuser via the API or the Subuser Management page in the user interface.
|
5115
|
+
The inbound parse webhook allows you to have incoming emails parsed, extracting some or all of the content, and then have that content POSTed by Twilio SendGrid to a URL of your choosing. For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Webhooks/parse.html).
|
5018
5116
|
|
5019
|
-
|
5117
|
+
### DELETE /user/webhooks/parse/settings/{hostname}
|
5020
5118
|
|
5021
|
-
For more information, please see our [User Guide](https://sendgrid.com/docs/API_Reference/Web_API_v3/Whitelabel/links.html).
|
5022
5119
|
|
5023
|
-
|
5120
|
+
```ruby
|
5121
|
+
hostname = "test_url_param"
|
5122
|
+
response = sg.client.user.webhooks.parse.settings._(hostname).delete()
|
5123
|
+
puts response.status_code
|
5124
|
+
puts response.body
|
5125
|
+
puts response.headers
|
5126
|
+
```
|
5127
|
+
## Retrieves Inbound Parse Webhook statistics.
|
5128
|
+
|
5129
|
+
**This endpoint allows you to retrieve the statistics for your Parse Webhook usage.**
|
5130
|
+
|
5131
|
+
SendGrid's Inbound Parse Webhook allows you to parse the contents and attachments of incoming emails. The Parse API can then POST the parsed emails to a URL that you specify. The Inbound Parse Webhook cannot parse messages greater than 20MB in size, including all attachments.
|
5132
|
+
|
5133
|
+
There are a number of pre-made integrations for the Twilio SendGrid Parse Webhook which make processing events easy. You can find these integrations in the [Library Index](https://sendgrid.com/docs/Integrate/libraries.html#-Webhook-Libraries).
|
5134
|
+
|
5135
|
+
### GET /user/webhooks/parse/stats
|
5024
5136
|
|
5025
5137
|
|
5026
5138
|
```ruby
|
5027
|
-
|
5028
|
-
|
5029
|
-
}')
|
5030
|
-
link_id = "test_url_param"
|
5031
|
-
response = sg.client.whitelabel.links._(link_id).subuser.post(request_body: data)
|
5139
|
+
params = JSON.parse('{"aggregated_by": "day", "limit": "test_string", "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": "test_string"}')
|
5140
|
+
response = sg.client.user.webhooks.parse.stats.get(query_params: params)
|
5032
5141
|
puts response.status_code
|
5033
5142
|
puts response.body
|
5034
5143
|
puts response.headers
|