openapi

package
v4.0.0-rc.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2025 License: MIT Imports: 4 Imported by: 0

README

Go API client for

The SendGrid Engagement Quality (SEQ) API allows you to retrieve metrics that define the quality of your email program.

An SEQ score is correlated with:

  • The quality of the data in a sender’s program.
  • How “wanted” the sender's email is by their recipients.

Because “wanted” email and deliverability are closely related, a higher SEQ metric is correlated with greater deliverability. This means the higher your SEQ score, the more likely you are to land in your recipients' inboxes. See the SEQ Overview page to understand SEQ, how it's calculated, and how you can address your score. The SEQ endpoints allow you to retrieve your scores and scores for your Subusers.

Overview

This API client was generated by the OpenAPI Generator project from the OpenAPI specs located at twilio/sendgrid-oai. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 1.0.0
  • Package version:
  • Build date: 2025-02-11T10:49:35.093965Z[Etc/UTC]
  • Build package: com.sendgrid.oai.go.SendgridGoGenerator For more information, please visit https://support.sendgrid.com/hc/en-us

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import "./"

Documentation for API Endpoints

All URIs are relative to https://api.sendgrid.com

Class Method HTTP request Description
ListEngagementQualityScore ListEngagementQualityScore Get /v3/engagementquality/scores Get Engagement Quality Scores
ListSubuserEngagementQualityScore ListSubuserEngagementQualityScore Get /v3/engagementquality/subusers/scores Get Subusers' Engagement Quality Scores

Documentation For Models

Documentation For Authorization

BearerAuth

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiService

type ApiService struct {
	// contains filtered or unexported fields
}

func NewApiService

func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService

func NewApiServiceWithClient

func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService

func (*ApiService) ListEngagementQualityScore

func (c *ApiService) ListEngagementQualityScore(params *ListEngagementQualityScoreParam) (interface{}, error)

**This operation allows you to retrieve your SendGrid Engagement Quality (SEQ) scores for a specified date range**. A successful request with this API operation will return either a `200` or `202` response. ### 202 This operation returns a `202` response when SendGrid does not yet have scores available for the specified date range. Scores are calculated asynchronously from requests to this endpoint. This means a score may be available for the specified date at a later time, but a score is not available at the time of your API request. ### 200 A 200 response will include all available scores beginning on the `from` and ending on the `to` dates specified. The `score` and `metrics` properties will be omitted from the response for any days in which the user is not eligible to receive a score. The `score` property represents a user's overall engagement quality. The `metrics` property provides additional scores for the input categories that contribute to that overall score. All scores range from `1` to `5` with a higher number representing better engagement quality. See [**SendGrid Engagement Quality Overview**](https://docs.sendgrid.com/api-reference/sendgrid-engagement-quality-api/overview) for more information

func (*ApiService) ListSubuserEngagementQualityScore

func (c *ApiService) ListSubuserEngagementQualityScore(params *ListSubuserEngagementQualityScoreParam) (interface{}, error)

**This operation allows you to retrieve SendGrid Engagement Quality (SEQ) scores for your Subusers or customer accounts for a specific date.** A successful request with this API operation will return either a `200` or `202` response. ### 202 This operation returns a `202` response when SendGrid does not yet have scores available for the specified date range. Scores are calculated asynchronously from requests to this endpoint. This means a score may be available for the specified date at a later time, but a score is not available at the time of your API request. ### 200 A `200` response will include scores for all Subusers or customer accounts belonging to the requesting parent or reseller account. The `score` and `metrics` properties will be omitted from the response if a Subuser or customer account is not eligible to receive a score for the specified date. The `score` property represents a Subuser or customer account's overall engagement quality. The `metrics` property provides additional scores for the input categories that contribute to that overall score. All scores range from `1` to `5` with a higher number representing better engagement quality. See [**SendGrid Engagement Quality Overview**](https://docs.sendgrid.com/api-reference/sendgrid-engagement-quality-api/overview) for more information

type ListEngagementQualityScoreParam

type ListEngagementQualityScoreParam struct {
	// The starting date in YYYY-MM-DD format (UTC) for which you want to retrieve scores.
	From *string `json:"from"`
	// The ending date in YYYY-MM-DD format (UTC) for which you want to retrieve scores.
	To *string `json:"to"`
	// The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id <account-id>`). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: <subuser-username>`). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information.
	Onbehalfof *string `json:"on-behalf-of,omitempty"`
}

func (*ListEngagementQualityScoreParam) SetFrom

func (*ListEngagementQualityScoreParam) SetOnbehalfof

func (params *ListEngagementQualityScoreParam) SetOnbehalfof(Onbehalfof string) *ListEngagementQualityScoreParam

func (*ListEngagementQualityScoreParam) SetTo

type ListSubuserEngagementQualityScoreParam

type ListSubuserEngagementQualityScoreParam struct {
	// The date in YYYY-MM-DD format (UTC) for which you want to retrieve a SendGrid Engagement Quality score.
	Date *string `json:"date"`
	// The `on-behalf-of` header allows you to make API calls from a parent account on behalf of the parent's Subusers or customer accounts. You will use the parent account's API key when using this header. When making a call on behalf of a customer account, the property value should be \"account-id\" followed by the customer account's ID (e.g., `on-behalf-of: account-id <account-id>`). When making a call on behalf of a Subuser, the property value should be the Subuser's username (e.g., `on-behalf-of: <subuser-username>`). See [**On Behalf Of**](https://docs.sendgrid.com/api-reference/how-to-use-the-sendgrid-v3-api/on-behalf-of) for more information.
	Onbehalfof *string `json:"on-behalf-of,omitempty"`
	// Specifies the number of results to be returned by the API. This parameter can be used to limit the results returned or in combination with the `after_key` parameter to iterate through paginated results.
	Limit *int32 `json:"limit,omitempty"`
	// Specifies which items to be returned by the API. When the `after_key` is specified, the API will return items beginning from the first item after the item specified. This parameter can be used in combination with `limit` to iterate through paginated results.
	AfterKey *int32 `json:"after_key,omitempty"`
}

func (*ListSubuserEngagementQualityScoreParam) SetAfterKey

func (*ListSubuserEngagementQualityScoreParam) SetDate

func (*ListSubuserEngagementQualityScoreParam) SetLimit

func (*ListSubuserEngagementQualityScoreParam) SetOnbehalfof

type SeqError

type SeqError struct {
	// When applicable, this property value will be the field that generated the error.
	Field *string `json:"field,omitempty"`
	// An error message.
	Message string `json:"message"`
}

SeqError This object contains error details

type SeqMetadata

type SeqMetadata struct {
	NextParams *SeqMetadataNextParams `json:"next_params,omitempty"`
}

SeqMetadata This object contains response metadata. The presence of the `after_key` property in the metadata indicates that some items are still outstanding and have not been retrieved. You can use the `after_key` value to retrieve additional items with another request.

type SeqMetadataNextParams

type SeqMetadataNextParams struct {
	// The `after_key` property represents the last processed key. If the `after_key` property is `null`, there are no more entries available.
	AfterKey *string `json:"after_key,omitempty"`
}

SeqMetadataNextParams struct for SeqMetadataNextParams

type SeqMetrics

type SeqMetrics struct {
	// Indicates whether or not you are sending to an engaged audience. Engagement recency is determined by factors such as how regularly your messages are being opened and clicked. Your score will range from `1` to `5` with a higher score representing better engagement quality.
	EngagementRecency float32 `json:"engagement_recency"`
	// Indicates the degree to which your audience is opening your messages. Your score will range from `1` to `5` with a higher score representing a better open rate and better engagement quality.
	OpenRate float32 `json:"open_rate"`
	// Indicates the degree to which mailbox providers are rejecting your mail due to reputation issues or content that looks like spam. Your score is calculated based on a ratio of these specific types of bounces to your total processed email. Your score will range from `1` to `5` with a higher score representing a lower percentage of bounces and better engagement quality.
	BounceClassification float32 `json:"bounce_classification"`
	// Indicates if you are attempting to send too many messages to addresses that don't exist. This score is determined by calculating your permanent bounces (bounces to invalid mailboxes). Your score will range from `1` to `5` with a higher score representing fewer bounces and better engagement quality.
	BounceRate float32 `json:"bounce_rate"`
	// Indicates if your messages are generating excessive spam complaints from recipients. This score is determined by calculating the number of recipients who open your mail and then mark it as spam. Your score will range from `1` to `5` with a higher score representing fewer spam reports and better engagement quality.
	SpamRate float32 `json:"spam_rate"`
}

SeqMetrics A collection of metrics representing your engagement score across multiple indicators such as your open rate, spam rate, and bounce rate. Each metric is assigned a score from `1` to `5` with a higher score representing better engagement quality for that particular metric. The `metrics` property will be omitted when a score is unknown. A score may be unknown if you have not turned on [open tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking) and/or your account or Subuser has not sent at least 1,000 messages during the previous 30 days.

type SeqScore

type SeqScore struct {
	// The user identifier associated with this score.
	UserId string `json:"user_id"`
	// The username associated with this score.
	Username *string `json:"username,omitempty"`
	// The date (UTC) for which this score was calculated.
	Date *string `json:"date,omitempty"`
	// Your SendGrid Engagement Quality Score. The `score` property will be omitted when a score is unknown. A score may be unknown if you have not turned on [open tracking](https://docs.sendgrid.com/ui/account-and-settings/tracking) and/or your account or Subuser has not sent at least 1,000 messages during the previous 30 days.
	Score   *float32    `json:"score,omitempty"`
	Metrics *SeqMetrics `json:"metrics,omitempty"`
}

SeqScore A user's SendGrid Engagement Quality (SEQ) score for a specified date. Your SEQ score is determined by measuring several key metrics including your open rate, spam rate, and engagement recency. Your overall score allows you to quickly assess how your email program is performing at a high level. You will receive a score from `1` to `5` with a higher number representing better engagement quality. See the `metrics` property to understand how your program is performing across the input categories that determine your overall score.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL