mirror of
https://github.com/hanzo-go/sendgrid.git
synced 2026-10-30 15:05:38 +00:00
30 lines
663 B
Go
30 lines
663 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/hanzoai/sendgrid-go"
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
// Retrievealistofscopesforwhichthisuserhasaccess : Retrieve a list of scopes for which this user has access.
|
|
// GET /scopes
|
|
func Retrievealistofscopesforwhichthisuserhasaccess() {
|
|
apiKey := os.Getenv("YOUR_SENDGRID_APIKEY")
|
|
host := "https://api.sendgrid.com"
|
|
request := sendgrid.GetRequest(apiKey, "/v3/scopes", host)
|
|
request.Method = "GET"
|
|
response, err := sendgrid.API(request)
|
|
if err != nil {
|
|
log.Println(err)
|
|
} else {
|
|
fmt.Println(response.StatusCode)
|
|
fmt.Println(response.Body)
|
|
fmt.Println(response.Headers)
|
|
}
|
|
}
|
|
|
|
func main() {
|
|
// add your function calls here
|
|
}
|