-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version Bump v3.0.4: Update docs, unit tests and examples to include …
…Sender ID
- Loading branch information
1 parent
da5517e
commit 6af4061
Showing
24 changed files
with
703 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ host := "https://api.sendgrid.com" | |
* [MAILBOX PROVIDERS](#mailbox_providers) | ||
* [PARTNER SETTINGS](#partner_settings) | ||
* [SCOPES](#scopes) | ||
* [SENDERS](#senders) | ||
* [STATS](#stats) | ||
* [SUBUSERS](#subusers) | ||
* [SUPPRESSION](#suppression) | ||
|
@@ -1920,7 +1921,6 @@ The contactdb is a database of your contacts for [SendGrid Marketing Campaigns]( | |
request := sendgrid.GetRequest(apiKey, "/v3/contactdb/recipients/search", host) | ||
request.Method = "GET" | ||
queryParams := make(map[string]string) | ||
queryParams["%7Bfield_name%7D"] = "test_string" | ||
queryParams["{field_name}"] = "test_string" | ||
request.QueryParams = queryParams | ||
response, err := sendgrid.API(request) | ||
|
@@ -3498,6 +3498,173 @@ if err != nil { | |
} | ||
``` | ||
|
||
<a name="senders"></a> | ||
# SENDERS | ||
|
||
## Create a Sender Identity | ||
|
||
**This endpoint allows you to create a new sender identity.** | ||
|
||
*You may create up to 100 unique sender identities.* | ||
|
||
Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. | ||
|
||
### POST /senders | ||
|
||
```go | ||
request := sendgrid.GetRequest(apiKey, "/v3/senders", host) | ||
request.Method = "POST" | ||
request.Body = []byte(` { | ||
"address": "123 Elm St.", | ||
"address_2": "Apt. 456", | ||
"city": "Denver", | ||
"country": "United States", | ||
"from": { | ||
"email": "[email protected]", | ||
"name": "Example INC" | ||
}, | ||
"nickname": "My Sender ID", | ||
"reply_to": { | ||
"email": "[email protected]", | ||
"name": "Example INC" | ||
}, | ||
"state": "Colorado", | ||
"zip": "80202" | ||
}`) | ||
response, err := sendgrid.API(request) | ||
if err != nil { | ||
fmt.Println(err) | ||
} else { | ||
fmt.Println(response.StatusCode) | ||
fmt.Println(response.Body) | ||
fmt.Println(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.** | ||
|
||
Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. | ||
|
||
### GET /senders | ||
|
||
```go | ||
request := sendgrid.GetRequest(apiKey, "/v3/senders", host) | ||
request.Method = "GET" | ||
response, err := sendgrid.API(request) | ||
if err != nil { | ||
fmt.Println(err) | ||
} else { | ||
fmt.Println(response.StatusCode) | ||
fmt.Println(response.Body) | ||
fmt.Println(response.Headers) | ||
} | ||
``` | ||
|
||
## Update a Sender Identity | ||
|
||
**This endpoint allows you to update a sender identity.** | ||
|
||
Updates to `from.email` require re-verification. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. | ||
|
||
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. | ||
|
||
### PATCH /senders/{sender_id} | ||
|
||
```go | ||
request := sendgrid.GetRequest(apiKey, "/v3/senders/{sender_id}", host) | ||
request.Method = "PATCH" | ||
request.Body = []byte(` { | ||
"address": "123 Elm St.", | ||
"address_2": "Apt. 456", | ||
"city": "Denver", | ||
"country": "United States", | ||
"from": { | ||
"email": "[email protected]", | ||
"name": "Example INC" | ||
}, | ||
"nickname": "My Sender ID", | ||
"reply_to": { | ||
"email": "[email protected]", | ||
"name": "Example INC" | ||
}, | ||
"state": "Colorado", | ||
"zip": "80202" | ||
}`) | ||
response, err := sendgrid.API(request) | ||
if err != nil { | ||
fmt.Println(err) | ||
} else { | ||
fmt.Println(response.StatusCode) | ||
fmt.Println(response.Body) | ||
fmt.Println(response.Headers) | ||
} | ||
``` | ||
|
||
## View a Sender Identity | ||
|
||
**This endpoint allows you to retrieve a specific sender identity.** | ||
|
||
Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. | ||
|
||
### GET /senders/{sender_id} | ||
|
||
```go | ||
request := sendgrid.GetRequest(apiKey, "/v3/senders/{sender_id}", host) | ||
request.Method = "GET" | ||
response, err := sendgrid.API(request) | ||
if err != nil { | ||
fmt.Println(err) | ||
} else { | ||
fmt.Println(response.StatusCode) | ||
fmt.Println(response.Body) | ||
fmt.Println(response.Headers) | ||
} | ||
``` | ||
|
||
## Delete a Sender Identity | ||
|
||
**This endoint allows you to delete one of your sender identities.** | ||
|
||
Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. | ||
|
||
### DELETE /senders/{sender_id} | ||
|
||
```go | ||
request := sendgrid.GetRequest(apiKey, "/v3/senders/{sender_id}", host) | ||
request.Method = "DELETE" | ||
response, err := sendgrid.API(request) | ||
if err != nil { | ||
fmt.Println(err) | ||
} else { | ||
fmt.Println(response.StatusCode) | ||
fmt.Println(response.Body) | ||
fmt.Println(response.Headers) | ||
} | ||
``` | ||
|
||
## Resend Sender Identity Verification | ||
|
||
**This enpdoint allows you to resend a sender identity verification email.** | ||
|
||
Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. | ||
|
||
### POST /senders/{sender_id}/resend_verification | ||
|
||
```go | ||
request := sendgrid.GetRequest(apiKey, "/v3/senders/{sender_id}/resend_verification", host) | ||
request.Method = "POST" | ||
response, err := sendgrid.API(request) | ||
if err != nil { | ||
fmt.Println(err) | ||
} else { | ||
fmt.Println(response.StatusCode) | ||
fmt.Println(response.Body) | ||
fmt.Println(response.Headers) | ||
} | ||
``` | ||
|
||
<a name="stats"></a> | ||
# STATS | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.