From 888f3217208c187ad5518b02ce64bb6e975c2069 Mon Sep 17 00:00:00 2001 From: Kunal Madhav Date: Sun, 3 Dec 2023 11:38:19 +0000 Subject: [PATCH 1/3] feat: add bypass_spam_management to mail settings --- USAGE.md | 822 +++++++++--------- examples/helpers/mail/example.rb | 1 + examples/mail/mail.rb | 3 + lib/sendgrid-ruby.rb | 1 + .../helpers/mail/bypass_spam_management.rb | 17 + lib/sendgrid/helpers/mail/mail_settings.rb | 8 +- test/sendgrid/helpers/mail/test_mail.rb | 1 + test/sendgrid/test_sendgrid-ruby.rb | 3 + 8 files changed, 461 insertions(+), 395 deletions(-) create mode 100644 lib/sendgrid/helpers/mail/bypass_spam_management.rb diff --git a/USAGE.md b/USAGE.md index f5b14771..77749e67 100644 --- a/USAGE.md +++ b/USAGE.md @@ -11,35 +11,35 @@ sg = SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY']) # Table of Contents -* [ACCESS SETTINGS](#access-settings) -* [ALERTS](#alerts) -* [API KEYS](#api-keys) -* [ASM](#asm) -* [BROWSERS](#browsers) -* [CAMPAIGNS](#campaigns) -* [CATEGORIES](#categories) -* [CLIENTS](#clients) -* [CONTACTDB](#contactdb) -* [DEVICES](#devices) -* [EMAIL ACTIVITY](#email-activity) -* [GEO](#geo) -* [IPS](#ips) -* [MAIL](#mail) -* [MAIL SETTINGS](#mail-settings) -* [MAILBOX PROVIDERS](#mailbox-providers) -* [PARTNER SETTINGS](#partner-settings) -* [SCOPES](#scopes) -* [SENDERS](#senders) -* [SENDER AUTHENTICATION](#sender-authentication) -* [STATS](#stats) -* [SUBUSERS](#subusers) -* [SUPPRESSION](#suppression) -* [TEMPLATES](#templates) -* [TRACKING SETTINGS](#tracking-settings) -* [USER](#user) - +- [ACCESS SETTINGS](#access-settings) +- [ALERTS](#alerts) +- [API KEYS](#api-keys) +- [ASM](#asm) +- [BROWSERS](#browsers) +- [CAMPAIGNS](#campaigns) +- [CATEGORIES](#categories) +- [CLIENTS](#clients) +- [CONTACTDB](#contactdb) +- [DEVICES](#devices) +- [EMAIL ACTIVITY](#email-activity) +- [GEO](#geo) +- [IPS](#ips) +- [MAIL](#mail) +- [MAIL SETTINGS](#mail-settings) +- [MAILBOX PROVIDERS](#mailbox-providers) +- [PARTNER SETTINGS](#partner-settings) +- [SCOPES](#scopes) +- [SENDERS](#senders) +- [SENDER AUTHENTICATION](#sender-authentication) +- [STATS](#stats) +- [SUBUSERS](#subusers) +- [SUPPRESSION](#suppression) +- [TEMPLATES](#templates) +- [TRACKING SETTINGS](#tracking-settings) +- [USER](#user) + # ACCESS SETTINGS ## Retrieve all recent access attempts @@ -52,7 +52,6 @@ For more information, please see our [User Guide](http://sendgrid.com/docs/User_ ### GET /access_settings/activity - ```ruby params = JSON.parse('{"limit": 1}') response = sg.client.access_settings.activity.get(query_params: params) @@ -60,6 +59,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Add one or more IPs to the whitelist **This endpoint allows you to add one or more IP addresses to your IP whitelist.** @@ -72,7 +72,6 @@ For more information, please see our [User Guide](http://sendgrid.com/docs/User_ ### POST /access_settings/whitelist - ```ruby data = JSON.parse('{ "ips": [ @@ -92,6 +91,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve a list of currently whitelisted IPs **This endpoint allows you to retrieve a list of IP addresses that are currently whitelisted.** @@ -102,13 +102,13 @@ For more information, please see our [User Guide](http://sendgrid.com/docs/User_ ### GET /access_settings/whitelist - ```ruby response = sg.client.access_settings.whitelist.get() puts response.status_code puts response.body puts response.headers ``` + ## Remove one or more IPs from the whitelist **This endpoint allows you to remove one or more IPs from your IP whitelist.** @@ -121,7 +121,6 @@ For more information, please see our [User Guide](http://sendgrid.com/docs/User_ ### DELETE /access_settings/whitelist - ```ruby data = JSON.parse('{ "ids": [ @@ -135,6 +134,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve a specific whitelisted IP **This endpoint allows you to retrieve a specific IP address that has been whitelisted.** @@ -147,7 +147,6 @@ For more information, please see our [User Guide](http://sendgrid.com/docs/User_ ### GET /access_settings/whitelist/{rule_id} - ```ruby rule_id = "test_url_param" response = sg.client.access_settings.whitelist._(rule_id).get() @@ -155,6 +154,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Remove a specific IP from the whitelist **This endpoint allows you to remove a specific IP address from your IP whitelist.** @@ -167,7 +167,6 @@ For more information, please see our [User Guide](http://sendgrid.com/docs/User_ ### DELETE /access_settings/whitelist/{rule_id} - ```ruby rule_id = "test_url_param" response = sg.client.access_settings.whitelist._(rule_id).delete() @@ -175,7 +174,9 @@ puts response.status_code puts response.body puts response.headers ``` + + # ALERTS ## Create a new Alert @@ -183,14 +184,14 @@ puts response.headers **This endpoint allows you to create a new alert.** Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics. -* Usage alerts allow you to set the threshold at which an alert will be sent. -* Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly". + +- Usage alerts allow you to set the threshold at which an alert will be sent. +- Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly". For more information about alerts, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/alerts.html). ### POST /alerts - ```ruby data = JSON.parse('{ "email_to": "example@example.com", @@ -202,38 +203,40 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all alerts **This endpoint allows you to retrieve all of your alerts.** Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics. -* Usage alerts allow you to set the threshold at which an alert will be sent. -* Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly". + +- Usage alerts allow you to set the threshold at which an alert will be sent. +- Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly". For more information about alerts, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/alerts.html). ### GET /alerts - ```ruby response = sg.client.alerts.get() puts response.status_code puts response.body puts response.headers ``` + ## Update an alert **This endpoint allows you to update an alert.** Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics. -* Usage alerts allow you to set the threshold at which an alert will be sent. -* Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly". + +- Usage alerts allow you to set the threshold at which an alert will be sent. +- Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly". For more information about alerts, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/alerts.html). ### PATCH /alerts/{alert_id} - ```ruby data = JSON.parse('{ "email_to": "example@example.com" @@ -244,19 +247,20 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve a specific alert **This endpoint allows you to retrieve a specific alert.** Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics. -* Usage alerts allow you to set the threshold at which an alert will be sent. -* Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly". + +- Usage alerts allow you to set the threshold at which an alert will be sent. +- Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly". For more information about alerts, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/alerts.html). ### GET /alerts/{alert_id} - ```ruby alert_id = "test_url_param" response = sg.client.alerts._(alert_id).get() @@ -264,19 +268,20 @@ puts response.status_code puts response.body puts response.headers ``` + ## Delete an alert **This endpoint allows you to delete an alert.** Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics. -* Usage alerts allow you to set the threshold at which an alert will be sent. -* Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly". + +- Usage alerts allow you to set the threshold at which an alert will be sent. +- Stats notifications allow you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly". For more information about alerts, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/alerts.html). ### DELETE /alerts/{alert_id} - ```ruby alert_id = "test_url_param" response = sg.client.alerts._(alert_id).delete() @@ -284,7 +289,9 @@ puts response.status_code puts response.body puts response.headers ``` + + # API KEYS ## Create API keys @@ -301,7 +308,6 @@ See the [API Key Permissions List](https://sendgrid.com/docs/API_Reference/Web_A ### POST /api_keys - ```ruby data = JSON.parse('{ "name": "My API Key", @@ -317,6 +323,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all API Keys belonging to the authenticated user **This endpoint allows you to retrieve all API Keys that belong to the authenticated user.** @@ -325,7 +332,6 @@ The API Keys feature allows customers to be able to generate an API Key credenti ### GET /api_keys - ```ruby params = JSON.parse('{"limit": 1}') response = sg.client.api_keys.get(query_params: params) @@ -333,6 +339,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Update the name & scopes of an API Key **This endpoint allows you to update the name and scopes of a given API key.** @@ -342,10 +349,8 @@ Most provide the list of all the scopes an api key should have. 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). - ### PUT /api_keys/{api_key_id} - ```ruby data = JSON.parse('{ "name": "A New Hope", @@ -360,6 +365,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Update API keys **This endpoint allows you to update the name of an existing API Key.** @@ -370,13 +376,12 @@ The API Keys feature allows customers to be able to generate an API Key credenti ## URI Parameters -| URI Parameter | Type | Required? | Description | -|---|---|---|---| -|api_key_id |string | required | The ID of the API Key you are updating.| +| URI Parameter | Type | Required? | Description | +| ------------- | ------ | --------- | --------------------------------------- | +| api_key_id | string | required | The ID of the API Key you are updating. | ### PATCH /api_keys/{api_key_id} - ```ruby data = JSON.parse('{ "name": "A New Hope" @@ -387,6 +392,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve an existing API Key **This endpoint allows you to retrieve a single api key.** @@ -395,7 +401,6 @@ If the API Key ID does not exist an HTTP 404 will be returned. ### GET /api_keys/{api_key_id} - ```ruby api_key_id = "test_url_param" response = sg.client.api_keys._(api_key_id).get() @@ -403,6 +408,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Delete API keys **This endpoint allows you to revoke an existing API Key** @@ -413,13 +419,12 @@ The API Keys feature allows customers to be able to generate an API Key credenti ## URI Parameters -| URI Parameter | Type | Required? | Description | -|---|---|---|---| -|api_key_id |string | required | The ID of the API Key you are deleting.| +| URI Parameter | Type | Required? | Description | +| ------------- | ------ | --------- | --------------------------------------- | +| api_key_id | string | required | The ID of the API Key you are deleting. | ### DELETE /api_keys/{api_key_id} - ```ruby api_key_id = "test_url_param" response = sg.client.api_keys._(api_key_id).delete() @@ -427,7 +432,9 @@ puts response.status_code puts response.body puts response.headers ``` + + # ASM ## Create a new suppression group @@ -442,7 +449,6 @@ Each user can create up to 25 different suppression groups. ### POST /asm/groups - ```ruby data = JSON.parse('{ "description": "Suggestions for products our users might like.", @@ -454,6 +460,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve information about multiple suppression groups **This endpoint allows you to retrieve information about multiple suppression groups.** @@ -466,7 +473,6 @@ Suppression groups, or [unsubscribe groups](https://sendgrid.com/docs/API_Refere ### GET /asm/groups - ```ruby params = JSON.parse('{"id": 1}') response = sg.client.asm.groups.get(query_params: params) @@ -474,6 +480,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Update a suppression group. **This endpoint allows you to update or change a suppression group.** @@ -486,7 +493,6 @@ Each user can create up to 25 different suppression groups. ### PATCH /asm/groups/{group_id} - ```ruby data = JSON.parse('{ "description": "Suggestions for items our users might like.", @@ -499,6 +505,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Get information on a single suppression group. **This endpoint allows you to retrieve a single suppression group.** @@ -511,7 +518,6 @@ Each user can create up to 25 different suppression groups. ### GET /asm/groups/{group_id} - ```ruby group_id = "test_url_param" response = sg.client.asm.groups._(group_id).get() @@ -519,6 +525,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Delete a suppression group. **This endpoint allows you to delete a suppression group.** @@ -533,7 +540,6 @@ Each user can create up to 25 different suppression groups. ### DELETE /asm/groups/{group_id} - ```ruby group_id = "test_url_param" response = sg.client.asm.groups._(group_id).delete() @@ -541,6 +547,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Add suppressions to a suppression group **This endpoint allows you to add email addresses to an unsubscribe group.** @@ -551,7 +558,6 @@ Suppressions are recipient email addresses that are added to [unsubscribe groups ### POST /asm/groups/{group_id}/suppressions - ```ruby data = JSON.parse('{ "recipient_emails": [ @@ -565,6 +571,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all suppressions for a suppression group **This endpoint allows you to retrieve all suppressed email addresses belonging to the given group.** @@ -573,7 +580,6 @@ Suppressions are recipient email addresses that are added to [unsubscribe groups ### GET /asm/groups/{group_id}/suppressions - ```ruby group_id = "test_url_param" response = sg.client.asm.groups._(group_id).suppressions.get() @@ -581,6 +587,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Search for suppressions within a group **This endpoint allows you to search a suppression group for multiple suppressions.** @@ -591,7 +598,6 @@ Suppressions are a list of email addresses that will not receive content sent un ### POST /asm/groups/{group_id}/suppressions/search - ```ruby data = JSON.parse('{ "recipient_emails": [ @@ -606,6 +612,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Delete a suppression from a suppression group **This endpoint allows you to remove a suppressed email address from the given suppression group.** @@ -614,7 +621,6 @@ Suppressions are recipient email addresses that are added to [unsubscribe groups ### DELETE /asm/groups/{group_id}/suppressions/{email} - ```ruby group_id = "test_url_param" email = "test_url_param" @@ -623,6 +629,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all suppressions **This endpoint allows you to retrieve a list of all suppressions.** @@ -631,13 +638,13 @@ Suppressions are a list of email addresses that will not receive content sent un ### GET /asm/suppressions - ```ruby response = sg.client.asm.suppressions.get() puts response.status_code puts response.body puts response.headers ``` + ## Add recipient addresses to the global suppression group. **This endpoint allows you to add one or more email addresses to the global suppressions group.** @@ -646,7 +653,6 @@ A global suppression (or global unsubscribe) is an email address of a recipient ### POST /asm/suppressions/global - ```ruby data = JSON.parse('{ "recipient_emails": [ @@ -659,6 +665,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve a Global Suppression **This endpoint allows you to retrieve a global suppression. You can also use this endpoint to confirm if an email address is already globally suppressed.** @@ -669,7 +676,6 @@ A global suppression (or global unsubscribe) is an email address of a recipient ### GET /asm/suppressions/global/{email} - ```ruby email = "test_url_param" response = sg.client.asm.suppressions.global._(email).get() @@ -677,6 +683,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Delete a Global Suppression **This endpoint allows you to remove an email address from the global suppressions group.** @@ -685,7 +692,6 @@ A global suppression (or global unsubscribe) is an email address of a recipient ### DELETE /asm/suppressions/global/{email} - ```ruby email = "test_url_param" response = sg.client.asm.suppressions.global._(email).delete() @@ -693,6 +699,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all suppression groups for an email address **This endpoint returns the list of all groups that the given email address has been unsubscribed from.** @@ -701,7 +708,6 @@ Suppressions are a list of email addresses that will not receive content sent un ### GET /asm/suppressions/{email} - ```ruby email = "test_url_param" response = sg.client.asm.suppressions._(email).get() @@ -709,7 +715,9 @@ puts response.status_code puts response.body puts response.headers ``` + + # BROWSERS ## Retrieve email statistics by browser. @@ -722,7 +730,6 @@ Advanced Stats provide a more in-depth view of your email statistics and the act ### GET /browsers/stats - ```ruby params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "browsers": "test_string", "limit": "test_string", "offset": "test_string", "start_date": "2016-01-01"}') response = sg.client.browsers.stats.get(query_params: params) @@ -730,7 +737,9 @@ puts response.status_code puts response.body puts response.headers ``` + + # CAMPAIGNS ## Create a Campaign @@ -743,11 +752,10 @@ Note: In order to send or schedule the campaign, you will be required to provide For more information: -* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) +- [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) ### POST /campaigns - ```ruby data = JSON.parse('{ "categories": [ @@ -774,6 +782,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all Campaigns **This endpoint allows you to retrieve a list of all of your campaigns.** @@ -784,11 +793,10 @@ Returns an empty array if no campaigns exist. For more information: -* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) +- [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) ### GET /campaigns - ```ruby params = JSON.parse('{"limit": 1, "offset": 1}') response = sg.client.campaigns.get(query_params: params) @@ -796,17 +804,17 @@ puts response.status_code puts response.body puts response.headers ``` + ## Update a Campaign Update a campaign. This is especially useful if you only set up the campaign using POST /campaigns, but didn't set many of the parameters. For more information: -* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) +- [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) ### PATCH /campaigns/{campaign_id} - ```ruby data = JSON.parse('{ "categories": [ @@ -823,6 +831,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve a single campaign **This endpoint allows you to retrieve a specific campaign.** @@ -831,11 +840,10 @@ Our Marketing Campaigns API lets you create, manage, send, and schedule campaign For more information: -* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) +- [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) ### GET /campaigns/{campaign_id} - ```ruby campaign_id = "test_url_param" response = sg.client.campaigns._(campaign_id).get() @@ -843,6 +851,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Delete a Campaign **This endpoint allows you to delete a specific campaign.** @@ -851,11 +860,10 @@ Our Marketing Campaigns API lets you create, manage, send, and schedule campaign For more information: -* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) +- [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) ### DELETE /campaigns/{campaign_id} - ```ruby campaign_id = "test_url_param" response = sg.client.campaigns._(campaign_id).delete() @@ -863,17 +871,17 @@ puts response.status_code puts response.body puts response.headers ``` + ## Update a Scheduled Campaign **This endpoint allows to you change the scheduled time and date for a campaign to be sent.** For more information: -* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) +- [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) ### PATCH /campaigns/{campaign_id}/schedules - ```ruby data = JSON.parse('{ "send_at": 1489451436 @@ -884,17 +892,17 @@ puts response.status_code puts response.body puts response.headers ``` + ## Schedule a Campaign **This endpoint allows you to schedule a specific date and time for your campaign to be sent.** For more information: -* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) +- [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) ### POST /campaigns/{campaign_id}/schedules - ```ruby data = JSON.parse('{ "send_at": 1489771528 @@ -905,17 +913,17 @@ puts response.status_code puts response.body puts response.headers ``` + ## View Scheduled Time of a Campaign **This endpoint allows you to retrieve the date and time that the given campaign has been scheduled to be sent.** For more information: -* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) +- [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) ### GET /campaigns/{campaign_id}/schedules - ```ruby campaign_id = "test_url_param" response = sg.client.campaigns._(campaign_id).schedules.get() @@ -923,6 +931,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Unschedule a Scheduled Campaign **This endpoint allows you to unschedule a campaign that has already been scheduled to be sent.** @@ -932,11 +941,10 @@ If the specified campaign is in the process of being sent, the only option is to For more information: -* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) +- [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) ### DELETE /campaigns/{campaign_id}/schedules - ```ruby campaign_id = "test_url_param" response = sg.client.campaigns._(campaign_id).schedules.delete() @@ -944,6 +952,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Send a Campaign **This endpoint allows you to immediately send a campaign at the time you make the API call.** @@ -952,11 +961,10 @@ Normally a POST would have a request body, but since this endpoint is telling us For more information: -* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) +- [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) ### POST /campaigns/{campaign_id}/schedules/now - ```ruby campaign_id = "test_url_param" response = sg.client.campaigns._(campaign_id).schedules.now.post() @@ -964,6 +972,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Send a Test Campaign **This endpoint allows you to send a test campaign.** @@ -972,11 +981,10 @@ To send to multiple addresses, use an array for the JSON "to" value ["one@addres For more information: -* [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) +- [User Guide > Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) ### POST /campaigns/{campaign_id}/schedules/test - ```ruby data = JSON.parse('{ "to": "your.email@example.com" @@ -987,7 +995,9 @@ puts response.status_code puts response.body puts response.headers ``` + + # CATEGORIES ## Retrieve all categories @@ -998,7 +1008,6 @@ Categories can help organize your email analytics by enabling you to tag emails ### GET /categories - ```ruby params = JSON.parse('{"category": "test_string", "limit": 1, "offset": 1}') response = sg.client.categories.get(query_params: params) @@ -1006,6 +1015,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve Email Statistics for Categories **This endpoint allows you to retrieve all of your email statistics for each of your categories.** @@ -1016,7 +1026,6 @@ Categories allow you to group your emails together according to broad topics tha ### GET /categories/stats - ```ruby params = JSON.parse('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "categories": "test_string"}') response = sg.client.categories.stats.get(query_params: params) @@ -1024,6 +1033,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve sums of email stats for each category [Needs: Stats object defined, has category ID?] **This endpoint allows you to retrieve the total sum of each email statistic for every category over the given date range.** @@ -1034,7 +1044,6 @@ Categories allow you to group your emails together according to broad topics tha ### GET /categories/stats/sums - ```ruby 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"}') response = sg.client.categories.stats.sums.get(query_params: params) @@ -1042,7 +1051,9 @@ puts response.status_code puts response.body puts response.headers ``` + + # CLIENTS ## Retrieve email statistics by client type. @@ -1055,7 +1066,6 @@ Advanced Stats provide a more in-depth view of your email statistics and the act ### GET /clients/stats - ```ruby params = JSON.parse('{"aggregated_by": "day", "start_date": "2016-01-01", "end_date": "2016-04-01"}') response = sg.client.clients.stats.get(query_params: params) @@ -1063,6 +1073,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve stats by a specific client type. **This endpoint allows you to retrieve your email statistics segmented by a specific client type.** @@ -1070,6 +1081,7 @@ puts response.headers **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. ## Available Client Types + - phone - tablet - webmail @@ -1079,7 +1091,6 @@ Advanced Stats provide a more in-depth view of your email statistics and the act ### GET /clients/{client_type}/stats - ```ruby params = JSON.parse('{"aggregated_by": "day", "start_date": "2016-01-01", "end_date": "2016-04-01"}') client_type = "test_url_param" @@ -1088,7 +1099,9 @@ puts response.status_code puts response.body puts response.headers ``` + + # CONTACTDB ## Create a Custom Field @@ -1099,7 +1112,6 @@ The contactdb is a database of your contacts for [Twilio SendGrid Marketing Camp ### POST /contactdb/custom_fields - ```ruby data = JSON.parse('{ "name": "pet", @@ -1110,6 +1122,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all custom fields **This endpoint allows you to retrieve all custom fields.** @@ -1118,13 +1131,13 @@ The contactdb is a database of your contacts for [Twilio SendGrid Marketing Camp ### GET /contactdb/custom_fields - ```ruby response = sg.client.contactdb.custom_fields.get() puts response.status_code puts response.body puts response.headers ``` + ## Retrieve a Custom Field **This endpoint allows you to retrieve a custom field by ID.** @@ -1133,7 +1146,6 @@ The contactdb is a database of your contacts for [Twilio SendGrid Marketing Camp ### GET /contactdb/custom_fields/{custom_field_id} - ```ruby custom_field_id = "test_url_param" response = sg.client.contactdb.custom_fields._(custom_field_id).get() @@ -1141,6 +1153,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Delete a Custom Field **This endpoint allows you to delete a custom field by ID.** @@ -1149,7 +1162,6 @@ The contactdb is a database of your contacts for [Twilio SendGrid Marketing Camp ### DELETE /contactdb/custom_fields/{custom_field_id} - ```ruby custom_field_id = "test_url_param" response = sg.client.contactdb.custom_fields._(custom_field_id).delete() @@ -1157,6 +1169,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Create a List **This endpoint allows you to create a list for your recipients.** @@ -1165,7 +1178,6 @@ The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.co ### POST /contactdb/lists - ```ruby data = JSON.parse('{ "name": "your list name" @@ -1175,6 +1187,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all lists **This endpoint allows you to retrieve all of your recipient lists. If you don't have any lists, an empty array will be returned.** @@ -1183,13 +1196,13 @@ The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.co ### GET /contactdb/lists - ```ruby response = sg.client.contactdb.lists.get() puts response.status_code puts response.body puts response.headers ``` + ## Delete Multiple lists **This endpoint allows you to delete multiple recipient lists.** @@ -1198,7 +1211,6 @@ The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.co ### DELETE /contactdb/lists - ```ruby data = JSON.parse('[ 1, @@ -1211,16 +1223,15 @@ puts response.status_code puts response.body puts response.headers ``` + ## Update a List **This endpoint allows you to update the name of one of your recipient lists.** - The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html) recipients. ### PATCH /contactdb/lists/{list_id} - ```ruby data = JSON.parse('{ "name": "newlistname" @@ -1232,6 +1243,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve a single list This endpoint allows you to retrieve a single recipient list. @@ -1240,7 +1252,6 @@ The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.co ### GET /contactdb/lists/{list_id} - ```ruby params = JSON.parse('{"list_id": 1}') list_id = "test_url_param" @@ -1249,6 +1260,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Delete a List **This endpoint allows you to delete a specific recipient list with the given ID.** @@ -1257,7 +1269,6 @@ The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.co ### DELETE /contactdb/lists/{list_id} - ```ruby params = JSON.parse('{"delete_contacts": "true"}') list_id = "test_url_param" @@ -1266,6 +1277,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Add Multiple Recipients to a List **This endpoint allows you to add multiple recipients to a list.** @@ -1276,7 +1288,6 @@ The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.co ### POST /contactdb/lists/{list_id}/recipients - ```ruby data = JSON.parse('[ "recipient_id1", @@ -1288,6 +1299,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all recipients on a List **This endpoint allows you to retrieve all recipients on the list with the given ID.** @@ -1296,7 +1308,6 @@ The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.co ### GET /contactdb/lists/{list_id}/recipients - ```ruby params = JSON.parse('{"page": 1, "page_size": 1, "list_id": 1}') list_id = "test_url_param" @@ -1305,6 +1316,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Add a Single Recipient to a List **This endpoint allows you to add a single recipient to a list.** @@ -1313,7 +1325,6 @@ The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.co ### POST /contactdb/lists/{list_id}/recipients/{recipient_id} - ```ruby list_id = "test_url_param" recipient_id = "test_url_param" @@ -1322,6 +1333,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Delete a Single Recipient from a Single List **This endpoint allows you to delete a single recipient from a list.** @@ -1330,7 +1342,6 @@ The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.co ### DELETE /contactdb/lists/{list_id}/recipients/{recipient_id} - ```ruby params = JSON.parse('{"recipient_id": 1, "list_id": 1}') list_id = "test_url_param" @@ -1340,6 +1351,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Update Recipient **This endpoint allows you to update one or more recipients.** @@ -1352,7 +1364,6 @@ The contactdb is a database of your contacts for [Twilio SendGrid Marketing Camp ### PATCH /contactdb/recipients - ```ruby data = JSON.parse('[ { @@ -1366,6 +1377,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Add recipients **This endpoint allows you to add a Marketing Campaigns recipient.** @@ -1376,7 +1388,6 @@ The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.co ### POST /contactdb/recipients - ```ruby data = JSON.parse('[ { @@ -1397,6 +1408,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve recipients **This endpoint allows you to retrieve all of your Marketing Campaigns recipients.** @@ -1408,7 +1420,6 @@ The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.co ### GET /contactdb/recipients - ```ruby params = JSON.parse('{"page": 1, "page_size": 1}') response = sg.client.contactdb.recipients.get(query_params: params) @@ -1416,6 +1427,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Delete Recipient **This endpoint allows you to delete one or more recipients.** @@ -1426,7 +1438,6 @@ The contactdb is a database of your contacts for [Twilio SendGrid Marketing Camp ### DELETE /contactdb/recipients - ```ruby data = JSON.parse('[ "recipient_id1", @@ -1437,6 +1448,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve the count of billable recipients **This endpoint allows you to retrieve the number of Marketing Campaigns recipients that you will be billed for.** @@ -1447,13 +1459,13 @@ The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.co ### GET /contactdb/recipients/billable_count - ```ruby response = sg.client.contactdb.recipients.billable_count.get() puts response.status_code puts response.body puts response.headers ``` + ## Retrieve a Count of Recipients **This endpoint allows you to retrieve the total number of Marketing Campaigns recipients.** @@ -1462,31 +1474,30 @@ The contactdb is a database of your contacts for [Twilio SendGrid Marketing Camp ### GET /contactdb/recipients/count - ```ruby response = sg.client.contactdb.recipients.count.get() puts response.status_code puts response.body puts response.headers ``` + ## Retrieve recipients matching search criteria **This endpoint allows you to perform a search on all of your Marketing Campaigns recipients.** field_name: -* is a variable that is substituted for your actual custom field name from your recipient. -* Text fields must be url-encoded. Date fields are searchable only by unix timestamp (e.g. 2/2/2015 becomes 1422835200) -* If field_name is a 'reserved' date field, such as created_at or updated_at, the system will internally convert -your epoch time to a date range encompassing the entire day. For example, an epoch time of 1422835600 converts to -Mon, 02 Feb 2015 00:06:40 GMT, but internally the system will search from Mon, 02 Feb 2015 00:00:00 GMT through -Mon, 02 Feb 2015 23:59:59 GMT. +- is a variable that is substituted for your actual custom field name from your recipient. +- Text fields must be url-encoded. Date fields are searchable only by unix timestamp (e.g. 2/2/2015 becomes 1422835200) +- If field_name is a 'reserved' date field, such as created_at or updated_at, the system will internally convert + your epoch time to a date range encompassing the entire day. For example, an epoch time of 1422835600 converts to + Mon, 02 Feb 2015 00:06:40 GMT, but internally the system will search from Mon, 02 Feb 2015 00:00:00 GMT through + Mon, 02 Feb 2015 23:59:59 GMT. The contactdb is a database of your contacts for [Twilio SendGrid Marketing Campaigns](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/index.html). ### GET /contactdb/recipients/search - ```ruby params = JSON.parse('{"{field_name}": "test_string"}') response = sg.client.contactdb.recipients.search.get(query_params: params) @@ -1494,6 +1505,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve a single recipient **This endpoint allows you to retrieve a single recipient by ID from your contact database.** @@ -1502,7 +1514,6 @@ The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.co ### GET /contactdb/recipients/{recipient_id} - ```ruby recipient_id = "test_url_param" response = sg.client.contactdb.recipients._(recipient_id).get() @@ -1510,6 +1521,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Delete a Recipient **This endpoint allows you to delete a single recipient with the given ID from your contact database.** @@ -1518,7 +1530,6 @@ The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.co ### DELETE /contactdb/recipients/{recipient_id} - ```ruby recipient_id = "test_url_param" response = sg.client.contactdb.recipients._(recipient_id).delete() @@ -1526,6 +1537,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve the lists that a recipient is on **This endpoint allows you to retrieve the lists that a given recipient belongs to.** @@ -1536,7 +1548,6 @@ The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.co ### GET /contactdb/recipients/{recipient_id}/lists - ```ruby recipient_id = "test_url_param" response = sg.client.contactdb.recipients._(recipient_id).lists.get() @@ -1544,6 +1555,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve reserved fields **This endpoint allows you to list all fields that are reserved and can't be used for custom field names.** @@ -1552,13 +1564,13 @@ The contactdb is a database of your contacts for [Twilio SendGrid Marketing Camp ### GET /contactdb/reserved_fields - ```ruby response = sg.client.contactdb.reserved_fields.get() puts response.status_code puts response.body puts response.headers ``` + ## Create a Segment **This endpoint allows you to create a segment.** @@ -1567,17 +1579,17 @@ All recipients in your contactdb will be added or removed automatically dependin List Id: -* Send this to segment from an existing list -* Don't send this in order to segment from your entire contactdb. +- Send this to segment from an existing list +- Don't send this in order to segment from your entire contactdb. Valid operators for create and update depend on the type of the field you are segmenting: -* **Dates:** "eq", "ne", "lt" (before), "gt" (after) -* **Text:** "contains", "eq" (is - matches the full field), "ne" (is not - matches any field where the entire field is not the condition value) -* **Numbers:** "eq", "lt", "gt" -* **Email Clicks and Opens:** "eq" (opened), "ne" (not opened) +- **Dates:** "eq", "ne", "lt" (before), "gt" (after) +- **Text:** "contains", "eq" (is - matches the full field), "ne" (is not - matches any field where the entire field is not the condition value) +- **Numbers:** "eq", "lt", "gt" +- **Email Clicks and Opens:** "eq" (opened), "ne" (not opened) -Segment conditions using "eq" or "ne" for email clicks and opens should provide a "field" of either *clicks.campaign_identifier* or *opens.campaign_identifier*. The condition value should be a string containing the id of a completed campaign. +Segment conditions using "eq" or "ne" for email clicks and opens should provide a "field" of either _clicks.campaign_identifier_ or _opens.campaign_identifier_. The condition value should be a string containing the id of a completed campaign. Segments may contain multiple conditions, joined by an "and" or "or" in the "and_or" field. The first condition in the conditions list must have an empty "and_or", and subsequent conditions must all specify an "and_or". @@ -1587,7 +1599,6 @@ For more information about segments in Marketing Campaigns, please see our [User ### POST /contactdb/segments - ```ruby data = JSON.parse('{ "conditions": [ @@ -1618,6 +1629,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all segments **This endpoint allows you to retrieve all of your segments.** @@ -1628,13 +1640,13 @@ For more information about segments in Marketing Campaigns, please see our [User ### GET /contactdb/segments - ```ruby response = sg.client.contactdb.segments.get() puts response.status_code puts response.body puts response.headers ``` + ## Update a segment **This endpoint allows you to update a segment.** @@ -1645,7 +1657,6 @@ For more information about segments in Marketing Campaigns, please see our [User ### PATCH /contactdb/segments/{segment_id} - ```ruby data = JSON.parse('{ "conditions": [ @@ -1666,6 +1677,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve a segment **This endpoint allows you to retrieve a single segment with the given ID.** @@ -1676,7 +1688,6 @@ For more information about segments in Marketing Campaigns, please see our [User ### GET /contactdb/segments/{segment_id} - ```ruby params = JSON.parse('{"segment_id": 1}') segment_id = "test_url_param" @@ -1685,6 +1696,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Delete a segment **This endpoint allows you to delete a segment from your recipient's database.** @@ -1697,7 +1709,6 @@ For more information about segments in Marketing Campaigns, please see our [User ### DELETE /contactdb/segments/{segment_id} - ```ruby params = JSON.parse('{"delete_contacts": "true"}') segment_id = "test_url_param" @@ -1706,6 +1717,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve recipients on a segment **This endpoint allows you to retrieve all of the recipients in a segment with the given ID.** @@ -1716,7 +1728,6 @@ For more information about segments in Marketing Campaigns, please see our [User ### GET /contactdb/segments/{segment_id}/recipients - ```ruby params = JSON.parse('{"page": 1, "page_size": 1}') segment_id = "test_url_param" @@ -1725,7 +1736,9 @@ puts response.status_code puts response.body puts response.headers ``` + + # DEVICES ## Retrieve email statistics by device type. @@ -1735,19 +1748,19 @@ puts response.headers **We only store up to 7 days of email activity in our database.** By default, 500 items will be returned per request via the Advanced Stats API endpoints. ## Available Device Types -| **Device** | **Description** | **Example** | -|---|---|---| -| Desktop | Email software on a desktop computer. | I.E., Outlook, Sparrow, or Apple Mail. | -| Webmail | A web-based email client. | I.E., Yahoo, Google, AOL, or Outlook.com. | -| Phone | A smartphone. | iPhone, Android, Blackberry, etc. -| Tablet | A tablet computer. | iPad, Android-based tablet, etc. | -| Other | An unrecognized device. | + +| **Device** | **Description** | **Example** | +| ---------- | ------------------------------------- | ----------------------------------------- | +| Desktop | Email software on a desktop computer. | I.E., Outlook, Sparrow, or Apple Mail. | +| Webmail | A web-based email client. | I.E., Yahoo, Google, AOL, or Outlook.com. | +| Phone | A smartphone. | iPhone, Android, Blackberry, etc. | +| Tablet | A tablet computer. | iPad, Android-based tablet, etc. | +| Other | An unrecognized device. | 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). ### GET /devices/stats - ```ruby params = JSON.parse('{"aggregated_by": "day", "limit": 1, "start_date": "2016-01-01", "end_date": "2016-04-01", "offset": 1}') response = sg.client.devices.stats.get(query_params: params) @@ -1757,9 +1770,11 @@ puts response.headers ``` + # EMAIL ACTIVITY ## Filter all messages + > 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). Filter all messages to search your Email Activity. @@ -1787,6 +1802,7 @@ For a tutorial on how to get started, check out [Getting Started with the Email 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). ### GET /messages + ```ruby require 'erb' @@ -1821,7 +1837,6 @@ puts response.body puts response.headers ``` - ## Request a CSV ### POST /messages/download @@ -1859,9 +1874,8 @@ puts response.body puts response.headers ``` - - + # GEO ## Retrieve email statistics by country and state/province. @@ -1874,7 +1888,6 @@ Advanced Stats provide a more in-depth view of your email statistics and the act ### GET /geo/stats - ```ruby params = JSON.parse('{"end_date": "2016-04-01", "country": "US", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01"}') response = sg.client.geo.stats.get(query_params: params) @@ -1882,7 +1895,9 @@ puts response.status_code puts response.body puts response.headers ``` + + # IPS ## Retrieve all IP addresses @@ -1895,7 +1910,6 @@ A single IP address or a range of IP addresses may be dedicated to an account in ### GET /ips - ```ruby params = JSON.parse('{"subuser": "test_string", "ip": "test_string", "limit": 1, "exclude_whitelabels": "true", "offset": 1}') response = sg.client.ips.get(query_params: params) @@ -1903,6 +1917,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all assigned IPs **This endpoint allows you to retrieve only assigned IP addresses.** @@ -1911,13 +1926,13 @@ A single IP address or a range of IP addresses may be dedicated to an account in ### GET /ips/assigned - ```ruby response = sg.client.ips.assigned.get() puts response.status_code puts response.body puts response.headers ``` + ## Create an IP pool. **This endpoint allows you to create an IP pool.** @@ -1932,7 +1947,6 @@ If an IP pool is NOT specified for an email, it will use any IP available, inclu ### POST /ips/pools - ```ruby data = JSON.parse('{ "name": "marketing" @@ -1942,6 +1956,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all IP pools. **This endpoint allows you to retrieve all of your IP pools.** @@ -1954,13 +1969,13 @@ If an IP pool is NOT specified for an email, it will use any IP available, inclu ### GET /ips/pools - ```ruby response = sg.client.ips.pools.get() puts response.status_code puts response.body puts response.headers ``` + ## Update an IP pools name. **This endpoint allows you to update the name of an IP pool.** @@ -1973,7 +1988,6 @@ If an IP pool is NOT specified for an email, it will use any IP available, inclu ### PUT /ips/pools/{pool_name} - ```ruby data = JSON.parse('{ "name": "new_pool_name" @@ -1984,6 +1998,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all IPs in a specified pool. **This endpoint allows you to list all of the IP addresses that are in a specific IP pool.** @@ -1996,7 +2011,6 @@ If an IP pool is NOT specified for an email, it will use any IP available, inclu ### GET /ips/pools/{pool_name} - ```ruby pool_name = "test_url_param" response = sg.client.ips.pools._(pool_name).get() @@ -2004,6 +2018,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Delete an IP pool. **This endpoint allows you to delete an IP pool.** @@ -2016,7 +2031,6 @@ If an IP pool is NOT specified for an email, it will use any IP available, inclu ### DELETE /ips/pools/{pool_name} - ```ruby pool_name = "test_url_param" response = sg.client.ips.pools._(pool_name).delete() @@ -2024,6 +2038,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Add an IP address to a pool **This endpoint allows you to add an IP address to an IP pool.** @@ -2034,7 +2049,6 @@ A single IP address or a range of IP addresses may be dedicated to an account in ### POST /ips/pools/{pool_name}/ips - ```ruby data = JSON.parse('{ "ip": "0.0.0.0" @@ -2045,6 +2059,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Remove an IP address from a pool. **This endpoint allows you to remove an IP address from an IP pool.** @@ -2055,7 +2070,6 @@ A single IP address or a range of IP addresses may be dedicated to an account in ### DELETE /ips/pools/{pool_name}/ips/{ip} - ```ruby pool_name = "test_url_param" ip = "test_url_param" @@ -2064,6 +2078,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Add an IP to warmup **This endpoint allows you to enter an IP address into warmup mode.** @@ -2074,7 +2089,6 @@ For more general information about warming up IPs, please see our [Classroom](ht ### POST /ips/warmup - ```ruby data = JSON.parse('{ "ip": "0.0.0.0" @@ -2084,6 +2098,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all IPs currently in warmup **This endpoint allows you to retrieve all of your IP addresses that are currently warming up.** @@ -2094,13 +2109,13 @@ For more general information about warming up IPs, please see our [Classroom](ht ### GET /ips/warmup - ```ruby response = sg.client.ips.warmup.get() puts response.status_code puts response.body puts response.headers ``` + ## Retrieve warmup status for a specific IP address **This endpoint allows you to retrieve the warmup status for a specific IP address.** @@ -2111,7 +2126,6 @@ For more general information about warming up IPs, please see our [Classroom](ht ### GET /ips/warmup/{ip_address} - ```ruby ip_address = "test_url_param" response = sg.client.ips.warmup._(ip_address).get() @@ -2119,6 +2133,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Remove an IP from warmup **This endpoint allows you to remove an IP address from warmup mode.** @@ -2129,7 +2144,6 @@ For more general information about warming up IPs, please see our [Classroom](ht ### DELETE /ips/warmup/{ip_address} - ```ruby ip_address = "test_url_param" response = sg.client.ips.warmup._(ip_address).delete() @@ -2137,6 +2151,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all IP pools an IP address belongs to **This endpoint allows you to see which IP pools a particular IP address has been added to.** @@ -2147,7 +2162,6 @@ A single IP address or a range of IP addresses may be dedicated to an account in ### GET /ips/{ip_address} - ```ruby ip_address = "test_url_param" response = sg.client.ips._(ip_address).get() @@ -2155,7 +2169,9 @@ puts response.status_code puts response.body puts response.headers ``` + + # MAIL ## Create a batch ID @@ -2166,17 +2182,17 @@ If you set the SMTPAPI header `batch_id`, it allows you to then associate multip More Information: -* [Scheduling Parameters > Batch ID](https://sendgrid.com/docs/API_Reference/SMTP_API/scheduling_parameters.html) +- [Scheduling Parameters > Batch ID](https://sendgrid.com/docs/API_Reference/SMTP_API/scheduling_parameters.html) ### POST /mail/batch - ```ruby response = sg.client.mail.batch.post() puts response.status_code puts response.body puts response.headers ``` + ## Validate batch ID **This endpoint allows you to validate a batch ID.** @@ -2185,11 +2201,10 @@ If you set the SMTPAPI header `batch_id`, it allows you to then associate multip More Information: -* [Scheduling Parameters > Batch ID](https://sendgrid.com/docs/API_Reference/SMTP_API/scheduling_parameters.html) +- [Scheduling Parameters > Batch ID](https://sendgrid.com/docs/API_Reference/SMTP_API/scheduling_parameters.html) ### GET /mail/batch/{batch_id} - ```ruby batch_id = "test_url_param" response = sg.client.mail.batch._(batch_id).get() @@ -2197,12 +2212,13 @@ puts response.status_code puts response.body puts response.headers ``` + ## v3 Mail Send 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). -* Top level parameters are referred to as "global". -* Individual fields within the personalizations array will override any other global, or message level, parameters that are defined outside of personalizations. +- Top level parameters are referred to as "global". +- Individual fields within the personalizations array will override any other global, or message level, parameters that are defined outside of personalizations. For an overview of the v3 Mail Send endpoint, please visit our [v3 API Reference](https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/index.html) @@ -2210,7 +2226,7 @@ For more detailed information about how to use the v3 Mail Send endpoint, please ### POST /mail/send - This endpoint has a helper, check it out [here](lib/sendgrid/helpers/mail/README.md). +This endpoint has a helper, check it out [here](lib/sendgrid/helpers/mail/README.md). ```ruby data = JSON.parse('{ @@ -2262,6 +2278,9 @@ data = JSON.parse('{ "bypass_list_management": { "enable": true }, + "bypass_spam_management": { + "enable": true + }, "footer": { "enable": true, "html": "

Thanks
The Twilio SendGrid Team

", @@ -2356,7 +2375,9 @@ puts response.status_code puts response.body puts response.headers ``` + + # MAIL SETTINGS ## Retrieve all mail settings @@ -2367,7 +2388,6 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### GET /mail_settings - ```ruby params = JSON.parse('{"limit": 1, "offset": 1}') response = sg.client.mail_settings.get(query_params: params) @@ -2375,6 +2395,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Update address whitelist mail settings **This endpoint allows you to update your current email address whitelist settings.** @@ -2385,7 +2406,6 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### PATCH /mail_settings/address_whitelist - ```ruby data = JSON.parse('{ "enabled": true, @@ -2399,6 +2419,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve address whitelist mail settings **This endpoint allows you to retrieve your current email address whitelist settings.** @@ -2409,13 +2430,13 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### GET /mail_settings/address_whitelist - ```ruby response = sg.client.mail_settings.address_whitelist.get() puts response.status_code puts response.body puts response.headers ``` + ## Update BCC mail settings **This endpoint allows you to update your current BCC mail settings.** @@ -2426,7 +2447,6 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### PATCH /mail_settings/bcc - ```ruby data = JSON.parse('{ "email": "email@example.com", @@ -2437,6 +2457,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all BCC mail settings **This endpoint allows you to retrieve your current BCC mail settings.** @@ -2447,13 +2468,13 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### GET /mail_settings/bcc - ```ruby response = sg.client.mail_settings.bcc.get() puts response.status_code puts response.body puts response.headers ``` + ## Update bounce purge mail settings **This endpoint allows you to update your current bounce purge settings.** @@ -2464,7 +2485,6 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### PATCH /mail_settings/bounce_purge - ```ruby data = JSON.parse('{ "enabled": true, @@ -2476,6 +2496,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve bounce purge mail settings **This endpoint allows you to retrieve your current bounce purge settings.** @@ -2486,13 +2507,13 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### GET /mail_settings/bounce_purge - ```ruby response = sg.client.mail_settings.bounce_purge.get() puts response.status_code puts response.body puts response.headers ``` + ## Update footer mail settings **This endpoint allows you to update your current Footer mail settings.** @@ -2503,7 +2524,6 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### PATCH /mail_settings/footer - ```ruby data = JSON.parse('{ "enabled": true, @@ -2515,6 +2535,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve footer mail settings **This endpoint allows you to retrieve your current Footer mail settings.** @@ -2525,13 +2546,13 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### GET /mail_settings/footer - ```ruby response = sg.client.mail_settings.footer.get() puts response.status_code puts response.body puts response.headers ``` + ## Update forward bounce mail settings **This endpoint allows you to update your current bounce forwarding mail settings.** @@ -2542,7 +2563,6 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### PATCH /mail_settings/forward_bounce - ```ruby data = JSON.parse('{ "email": "example@example.com", @@ -2553,6 +2573,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve forward bounce mail settings **This endpoint allows you to retrieve your current bounce forwarding mail settings.** @@ -2563,13 +2584,13 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### GET /mail_settings/forward_bounce - ```ruby response = sg.client.mail_settings.forward_bounce.get() puts response.status_code puts response.body puts response.headers ``` + ## Update forward spam mail settings **This endpoint allows you to update your current Forward Spam mail settings.** @@ -2580,7 +2601,6 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### PATCH /mail_settings/forward_spam - ```ruby data = JSON.parse('{ "email": "", @@ -2591,6 +2611,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve forward spam mail settings **This endpoint allows you to retrieve your current Forward Spam mail settings.** @@ -2601,13 +2622,13 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### GET /mail_settings/forward_spam - ```ruby response = sg.client.mail_settings.forward_spam.get() puts response.status_code puts response.body puts response.headers ``` + ## Update plain content mail settings **This endpoint allows you to update your current Plain Content mail settings.** @@ -2618,7 +2639,6 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### PATCH /mail_settings/plain_content - ```ruby data = JSON.parse('{ "enabled": false @@ -2628,6 +2648,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve plain content mail settings **This endpoint allows you to retrieve your current Plain Content mail settings.** @@ -2638,13 +2659,13 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### GET /mail_settings/plain_content - ```ruby response = sg.client.mail_settings.plain_content.get() puts response.status_code puts response.body puts response.headers ``` + ## Update spam check mail settings **This endpoint allows you to update your current spam checker mail settings.** @@ -2655,7 +2676,6 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### PATCH /mail_settings/spam_check - ```ruby data = JSON.parse('{ "enabled": true, @@ -2667,6 +2687,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve spam check mail settings **This endpoint allows you to retrieve your current Spam Checker mail settings.** @@ -2677,13 +2698,13 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### GET /mail_settings/spam_check - ```ruby response = sg.client.mail_settings.spam_check.get() puts response.status_code puts response.body puts response.headers ``` + ## Update template mail settings **This endpoint allows you to update your current legacy email template settings.** @@ -2696,7 +2717,6 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### PATCH /mail_settings/template - ```ruby data = JSON.parse('{ "enabled": true, @@ -2707,6 +2727,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve legacy template mail settings **This endpoint allows you to retrieve your current legacy email template settings.** @@ -2719,14 +2740,15 @@ Mail settings allow you to tell Twilio SendGrid specific things to do to every e ### GET /mail_settings/template - ```ruby response = sg.client.mail_settings.template.get() puts response.status_code puts response.body puts response.headers ``` + + # MAILBOX PROVIDERS ## Retrieve email statistics by mailbox provider. @@ -2739,7 +2761,6 @@ Advanced Stats provide a more in-depth view of your email statistics and the act ### GET /mailbox_providers/stats - ```ruby params = JSON.parse('{"end_date": "2016-04-01", "mailbox_providers": "test_string", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01"}') response = sg.client.mailbox_providers.stats.get(query_params: params) @@ -2747,7 +2768,9 @@ puts response.status_code puts response.body puts response.headers ``` + + # PARTNER SETTINGS ## Returns a list of all partner settings. @@ -2758,7 +2781,6 @@ Our partner settings allow you to integrate your Twilio SendGrid account with ou ### GET /partner_settings - ```ruby params = JSON.parse('{"limit": 1, "offset": 1}') response = sg.client.partner_settings.get(query_params: params) @@ -2766,6 +2788,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Updates New Relic partner settings. **This endpoint allows you to update or change your New Relic partner settings.** @@ -2776,7 +2799,6 @@ By integrating with New Relic, you can send your Twilio SendGrid email statistic ### PATCH /partner_settings/new_relic - ```ruby data = JSON.parse('{ "enable_subuser_statistics": true, @@ -2788,6 +2810,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Returns all New Relic partner settings. **This endpoint allows you to retrieve your current New Relic partner settings.** @@ -2798,14 +2821,15 @@ By integrating with New Relic, you can send your Twilio SendGrid email statistic ### GET /partner_settings/new_relic - ```ruby response = sg.client.partner_settings.new_relic.get() puts response.status_code puts response.body puts response.headers ``` + + # SCOPES ## Retrieve a list of scopes for which this user has access. @@ -2816,27 +2840,27 @@ API Keys can be used to authenticate the use of [Twilio SendGrid's v3 Web API](h ### GET /scopes - ```ruby response = sg.client.scopes.get() puts response.status_code puts response.body puts response.headers ``` + + # SENDERS ## Create a Sender Identity **This endpoint allows you to create a new sender identity.** -*You may create up to 100 unique sender identities.* +_You may create up to 100 unique sender identities._ 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`. ### POST /senders - ```ruby data = JSON.parse('{ "address": "123 Elm St.", @@ -2860,6 +2884,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Get all Sender Identities **This endpoint allows you to retrieve a list of all sender identities that have been created for your account.** @@ -2868,13 +2893,13 @@ Sender Identities are required to be verified before use. If your domain has bee ### GET /senders - ```ruby response = sg.client.senders.get() puts response.status_code puts response.body puts response.headers ``` + ## Update a Sender Identity **This endpoint allows you to update a sender identity.** @@ -2885,7 +2910,6 @@ Partial updates are allowed, but fields that are marked as "required" in the POS ### PATCH /senders/{sender_id} - ```ruby data = JSON.parse('{ "address": "123 Elm St.", @@ -2910,6 +2934,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## View a Sender Identity **This endpoint allows you to retrieve a specific sender identity.** @@ -2918,7 +2943,6 @@ Sender Identities are required to be verified before use. If your domain has bee ### GET /senders/{sender_id} - ```ruby sender_id = "test_url_param" response = sg.client.senders._(sender_id).get() @@ -2926,6 +2950,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Delete a Sender Identity **This endpoint allows you to delete one of your sender identities.** @@ -2934,7 +2959,6 @@ Sender Identities are required to be verified before use. If your domain has bee ### DELETE /senders/{sender_id} - ```ruby sender_id = "test_url_param" response = sg.client.senders._(sender_id).delete() @@ -2942,6 +2966,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Resend Sender Identity Verification **This endpoint allows you to resend a sender identity verification email.** @@ -2950,7 +2975,6 @@ Sender Identities are required to be verified before use. If your domain has bee ### POST /senders/{sender_id}/resend_verification - ```ruby sender_id = "test_url_param" response = sg.client.senders._(sender_id).resend_verification.post() @@ -2960,6 +2984,7 @@ puts response.headers ``` + # SENDER AUTHENTICATION ## Create an authenticated domain. @@ -2967,6 +2992,7 @@ puts response.headers **This endpoint allows you to create a domain authentication for one of your domains.** If you are creating a domain authentication that you would like a subuser to use, you have two options: + 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. 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. @@ -2976,7 +3002,6 @@ For more information on domain authentication, please see our [User Guide](https ### POST /whitelabel/domains - ```ruby data = JSON.parse('{ "automatic_security": false, @@ -2995,6 +3020,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## List all domain authentications. **This endpoint allows you to retrieve a list of all domain authentications you have created.** @@ -3003,10 +3029,8 @@ A domain authentication allows you to remove the via or sent on behalf of messag 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/) - ### GET /whitelabel/domains - ```ruby params = JSON.parse('{"username": "test_string", "domain": "test_string", "exclude_subusers": "true", "limit": 1, "offset": 1}') response = sg.client.whitelabel.domains.get(query_params: params) @@ -3014,6 +3038,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Get the default domain authentication. **This endpoint allows you to retrieve the default authentication for a domain.** @@ -3023,12 +3048,12 @@ A domain authentication allows you to remove the via or sent on behalf of messag 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/) ## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| domain | string |The domain to find a default domain whitelabel for. | -### GET /whitelabel/domains/default +| URI Parameter | Type | Description | +| ------------- | ------ | --------------------------------------------------- | +| domain | string | The domain to find a default domain whitelabel for. | +### GET /whitelabel/domains/default ```ruby response = sg.client.whitelabel.domains.default.get() @@ -3036,6 +3061,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## List the domain authentication associated with the given user. **This endpoint allows you to retrieve all of the domain authentications that have been assigned to a specific subuser.** @@ -3047,12 +3073,12 @@ Domain authentications can be associated with (i.e. assigned to) subusers from a 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/) ## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| username | string | Username of the subuser to find associated whitelabels for. | -### GET /whitelabel/domains/subuser +| URI Parameter | Type | Description | +| ------------- | ------ | ----------------------------------------------------------- | +| username | string | Username of the subuser to find associated whitelabels for. | +### GET /whitelabel/domains/subuser ```ruby response = sg.client.whitelabel.domains.subuser.get() @@ -3060,6 +3086,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Disassociate a domain authentication from a given user. **This endpoint allows you to disassociate a specific domain authentication from a subuser.** @@ -3071,12 +3098,12 @@ Domain authentications can be associated with (i.e. assigned to) subusers from a 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/) ## URI Parameters -| URI Parameter | Type | Required? | Description | -|---|---|---|---| -| username | string | required | Username for the subuser to find associated whitelabels for. | -### DELETE /whitelabel/domains/subuser +| URI Parameter | Type | Required? | Description | +| ------------- | ------ | --------- | ------------------------------------------------------------ | +| username | string | required | Username for the subuser to find associated whitelabels for. | +### DELETE /whitelabel/domains/subuser ```ruby response = sg.client.whitelabel.domains.subuser.delete() @@ -3084,6 +3111,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Update a domain authentication. **This endpoint allows you to update the settings for a domain authentication.** @@ -3094,7 +3122,6 @@ For more information on domain authentication, please see our [User Guide](https ### PATCH /whitelabel/domains/{domain_id} - ```ruby data = JSON.parse('{ "custom_spf": true, @@ -3106,6 +3133,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve a domain authentication. **This endpoint allows you to retrieve a specific domain authentication.** @@ -3114,10 +3142,8 @@ A domain authentication allows you to remove the via or sent on behalf of messag 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/) - ### GET /whitelabel/domains/{domain_id} - ```ruby domain_id = "test_url_param" response = sg.client.whitelabel.domains._(domain_id).get() @@ -3125,6 +3151,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Delete a domain authentication. **This endpoint allows you to delete a domain authentication.** @@ -3135,7 +3162,6 @@ For more information on domain authentication, please see our [User Guide](https ### DELETE /whitelabel/domains/{domain_id} - ```ruby domain_id = "test_url_param" response = sg.client.whitelabel.domains._(domain_id).delete() @@ -3143,6 +3169,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Associate a domain authentication with a given user. **This endpoint allows you to associate a specific domain authentication with a subuser.** @@ -3154,12 +3181,12 @@ Domain authentications can be associated with (i.e. assigned to) subusers from a 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/) ## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| domain_id | integer | ID of the domain whitelabel to associate with the subuser. | -### POST /whitelabel/domains/{domain_id}/subuser +| URI Parameter | Type | Description | +| ------------- | ------- | ---------------------------------------------------------- | +| domain_id | integer | ID of the domain whitelabel to associate with the subuser. | +### POST /whitelabel/domains/{domain_id}/subuser ```ruby data = JSON.parse('{ @@ -3171,6 +3198,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Add an IP to a domain authentication. **This endpoint allows you to add an IP address to a domain authentication.** @@ -3180,12 +3208,12 @@ A domain authentication allows you to remove the via or sent on behalf of messag 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/) ## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| id | integer | ID of the domain to which you are adding an IP | -### POST /whitelabel/domains/{id}/ips +| URI Parameter | Type | Description | +| ------------- | ------- | ---------------------------------------------- | +| id | integer | ID of the domain to which you are adding an IP | +### POST /whitelabel/domains/{id}/ips ```ruby data = JSON.parse('{ @@ -3197,6 +3225,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Remove an IP from a domain authentication. **This endpoint allows you to remove a domain's IP address from that domain's authentication.** @@ -3206,13 +3235,13 @@ A domain authentication allows you to remove the via or sent on behalf of messag 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/) ## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| id | integer | ID of the domain whitelabel to delete the IP from. | -| ip | string | IP to remove from the domain whitelabel. | -### DELETE /whitelabel/domains/{id}/ips/{ip} +| URI Parameter | Type | Description | +| ------------- | ------- | -------------------------------------------------- | +| id | integer | ID of the domain whitelabel to delete the IP from. | +| ip | string | IP to remove from the domain whitelabel. | +### DELETE /whitelabel/domains/{id}/ips/{ip} ```ruby id = "test_url_param" @@ -3222,6 +3251,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Validate a domain authentication. **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.** @@ -3231,12 +3261,12 @@ A domain authentication allows you to remove the via or sent on behalf of messag 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/) ## URI Parameters -| URI Parameter | Type | Description | -|---|---|---| -| id | integer |ID of the domain whitelabel to validate. | -### POST /whitelabel/domains/{id}/validate +| URI Parameter | Type | Description | +| ------------- | ------- | ---------------------------------------- | +| id | integer | ID of the domain whitelabel to validate. | +### POST /whitelabel/domains/{id}/validate ```ruby id = "test_url_param" @@ -3245,6 +3275,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Create reverse DNS record **This endpoint allows you to create a reverse DNS record.** @@ -3257,7 +3288,6 @@ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/a ### POST /whitelabel/ips - ```ruby data = JSON.parse('{ "domain": "example.com", @@ -3269,6 +3299,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all reverse DNS records **This endpoint allows you to retrieve all of the reverse DNS records that have been created by this account.** @@ -3281,7 +3312,6 @@ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/a ### GET /whitelabel/ips - ```ruby params = JSON.parse('{"ip": "test_string", "limit": 1, "offset": 1}') response = sg.client.whitelabel.ips.get(query_params: params) @@ -3289,6 +3319,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve an reverse DNS record **This endpoint allows you to retrieve a reverse DNS record.** @@ -3299,7 +3330,6 @@ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/a ### GET /whitelabel/ips/{id} - ```ruby id = "test_url_param" response = sg.client.whitelabel.ips._(id).get() @@ -3307,6 +3337,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Delete an reverse DNS record **This endpoint allows you to delete a reverse DNS record.** @@ -3317,7 +3348,6 @@ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/a ### DELETE /whitelabel/ips/{id} - ```ruby id = "test_url_param" response = sg.client.whitelabel.ips._(id).delete() @@ -3325,6 +3355,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Validate a reverse DNS record **This endpoint allows you to validate a reverse DNS record.** @@ -3335,7 +3366,6 @@ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/a ### POST /whitelabel/ips/{id}/validate - ```ruby id = "test_url_param" response = sg.client.whitelabel.ips._(id).validate.post() @@ -3343,6 +3373,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Create a Branded Link **This endpoint allows you to create a new link branding.** @@ -3353,7 +3384,6 @@ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/a ### POST /whitelabel/links - ```ruby data = JSON.parse('{ "default": true, @@ -3366,6 +3396,7 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve all link brandings **This endpoint allows you to retrieve all link brandings.** @@ -3376,7 +3407,6 @@ For more information, please see our [User Guide](https://sendgrid.com/docs/ui/a ### GET /whitelabel/links - ```ruby params = JSON.parse('{"limit": 1}') response = sg.client.whitelabel.links.get(query_params: params) @@ -3384,11 +3414,13 @@ puts response.status_code puts response.body puts response.headers ``` + ## Retrieve a Default Link Branding **This endpoint allows you to retrieve the default link branding.** 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: +