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 Marketing Campaigns Contacts API allows you to manage all of your marketing contacts programmatically. You can also import and export contacts using this API. The Contacts API allows you to associate contacts with lists and segments; however, to manage the lists and segments themselves, see the Lists API and Segments API.

You can also manage your marketing contacts with the Marketing Campaigns application user interface. See How to Send Email with New 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:27.775963Z[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
DeleteContactDeleteContactDelete /v3/marketing/contactsDelete Contacts
DeleteContactIdentifierDeleteContactIdentifierDelete /v3/marketing/contacts/{ContactId}/identifiersDelete a Contact Identifier
ExportContactExportContactPost /v3/marketing/contacts/exportsExport Contacts
GetContactGetContactGet /v3/marketing/contacts/{Id}Get a Contact by ID
GetContactByIdentifiersGetContactByIdentifiersPost /v3/marketing/contacts/search/identifiers/{IdentifierType}Get Contacts by Identifiers
GetExportContactGetExportContactGet /v3/marketing/contacts/exports/{Id}Export Contacts Status
GetImportContactGetImportContactGet /v3/marketing/contacts/imports/{Id}Import Contacts Status
ImportContactImportContactPut /v3/marketing/contacts/importsImport Contacts
ListBatchedContactListBatchedContactPost /v3/marketing/contacts/batchGet Batched Contacts by IDs
ListContactListContactGet /v3/marketing/contactsGet Sample Contacts
ListContactByEmailListContactByEmailPost /v3/marketing/contacts/search/emailsGet Contacts by Emails
ListContactCountListContactCountGet /v3/marketing/contacts/countGet Total Contact Count
ListExportContactListExportContactGet /v3/marketing/contacts/exportsGet All Existing Exports
SearchContactSearchContactPost /v3/marketing/contacts/searchSearch Contacts
UpdateContactUpdateContactPut /v3/marketing/contactsAdd or Update a Contact

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)