# README
Go API client for
The Marketing Campaigns Stats API allows you to retrieve statistics for both Automations and Single Sends. The statistics provided include bounces, clicks, opens, and more. You can export stats in CSV format for use in other applications. You can also retrieve Marketing Campaigns stats in the Marketing Campaigns application user interface.
This API provides statistics for Marketing Campaigns only. For stats related to event tracking, please see the Stats API.
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-08-18T08:58:25.605254Z[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 |
---|---|---|---|
ExportAutomationStat | ExportAutomationStat | Get /v3/marketing/stats/automations/export | Export Single Send Stats |
ExportSingleSendStat | ExportSingleSendStat | Get /v3/marketing/stats/singlesends/export | Export Single Send Stats |
GetAutomationStat | GetAutomationStat | Get /v3/marketing/stats/automations/{Id} | Get Automation Stats by ID |
GetSingleSendStat | GetSingleSendStat | Get /v3/marketing/stats/singlesends/{Id} | Get Single Send Stats by ID |
ListAutomationStat | ListAutomationStat | Get /v3/marketing/stats/automations | Get All Automation Stats |
ListClickTrackingStat | ListClickTrackingStat | Get /v3/marketing/stats/automations/{Id}/links | Get Automation Click Tracking Stats by ID |
ListSingleSendStat | ListSingleSendStat | Get /v3/marketing/stats/singlesends | Get All Single Sends Stats |
ListSingleSendTrackingStat | ListSingleSendTrackingStat | Get /v3/marketing/stats/singlesends/{Id}/links | Get Single Send Click Tracking Stats by ID |
Documentation For Models
- AbPhase
- AbPhase1
- AbPhaseId
- AggregatedBy
- AutmoationsLinkStatsResponse
- AutmoationsLinkStatsResponseResultsInner
- AutomationsResponse
- AutomationsResponseResultsInner
- ErrorResponse
- ErrorResponseErrorsInner
- Items
- Items1
- Items2
- LinkTrackingMetadata
- Metadata
- Metrics
- SinglesendsLinkStatsResponse
- SinglesendsLinkStatsResponseResultsInner
- SinglesendsResponse
- SinglesendsResponseResultsInner
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)