package
4.0.0-rc.10
Repository: https://github.com/sendgrid/sendgrid-go.git
Documentation: pkg.go.dev

# README

Go API client for

The Twilio SendGrid Legacy Marketing Campaigns Campaigns API allows you to manage your marketing email messages programmatically. This API is operational, but we recommend using the current version of Marketing Campaigns to manage your marketing messages with SendGrid Single Sends and Automations.

See Migrating from Legacy Marketing Campaigns for more information.

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.318681Z[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

ClassMethodHTTP requestDescription
CreateCampaignCreateCampaignPost /v3/campaignsCreate a Campaign
DeleteCampaignDeleteCampaignDelete /v3/campaigns/{CampaignId}Delete a Campaign
GetCampaignGetCampaignGet /v3/campaigns/{CampaignId}Retrieve a single campaign
GetScheduledCampaignGetScheduledCampaignGet /v3/campaigns/{CampaignId}/schedulesView Scheduled Time of a Campaign
ListCampaignListCampaignGet /v3/campaignsRetrieve all Campaigns
ScheduleCampaignScheduleCampaignPost /v3/campaigns/{CampaignId}/schedulesSchedule a Campaign
SendCampaignSendCampaignPost /v3/campaigns/{CampaignId}/schedules/nowSend a Campaign
SendTestCampaignSendTestCampaignPost /v3/campaigns/{CampaignId}/schedules/testSend a Test Campaign
UnScheduleCampaignUnScheduleCampaignDelete /v3/campaigns/{CampaignId}/schedulesUnschedule a Scheduled Campaign
UpdateCampaignUpdateCampaignPatch /v3/campaigns/{CampaignId}Update a Campaign
UpdateScheduledCampaignUpdateScheduledCampaignPatch /v3/campaigns/{CampaignId}/schedulesUpdate a Scheduled Campaign

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)