# 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
Class | Method | HTTP request | Description |
---|---|---|---|
DeleteContact | DeleteContact | Delete /v3/marketing/contacts | Delete Contacts |
DeleteContactIdentifier | DeleteContactIdentifier | Delete /v3/marketing/contacts/{ContactId}/identifiers | Delete a Contact Identifier |
ExportContact | ExportContact | Post /v3/marketing/contacts/exports | Export Contacts |
GetContact | GetContact | Get /v3/marketing/contacts/{Id} | Get a Contact by ID |
GetContactByIdentifiers | GetContactByIdentifiers | Post /v3/marketing/contacts/search/identifiers/{IdentifierType} | Get Contacts by Identifiers |
GetExportContact | GetExportContact | Get /v3/marketing/contacts/exports/{Id} | Export Contacts Status |
GetImportContact | GetImportContact | Get /v3/marketing/contacts/imports/{Id} | Import Contacts Status |
ImportContact | ImportContact | Put /v3/marketing/contacts/imports | Import Contacts |
ListBatchedContact | ListBatchedContact | Post /v3/marketing/contacts/batch | Get Batched Contacts by IDs |
ListContact | ListContact | Get /v3/marketing/contacts | Get Sample Contacts |
ListContactByEmail | ListContactByEmail | Post /v3/marketing/contacts/search/emails | Get Contacts by Emails |
ListContactCount | ListContactCount | Get /v3/marketing/contacts/count | Get Total Contact Count |
ListExportContact | ListExportContact | Get /v3/marketing/contacts/exports | Get All Existing Exports |
SearchContact | SearchContact | Post /v3/marketing/contacts/search | Search Contacts |
UpdateContact | UpdateContact | Put /v3/marketing/contacts | Add or Update a Contact |
Documentation For Models
- ContactDetails3
- ContactExport
- ContactImport
- ContactImportResults
- ContactRequest
- ContactRequestCustomFields
- ContactsError
- DeleteContact202Response
- DeleteContact400Response
- DeleteContactIdentifier202Response
- DeleteContactIdentifierRequest
- ErrorResponse
- ErrorResponseErrorsInner
- ExportContact202Response
- ExportContactRequest
- ExportContactRequestNotifications
- FileType
- FileType1
- GetContactByIdentifiers200Response
- GetContactByIdentifiers200ResponseResultValue
- GetContactByIdentifiersRequest
- GetImportContact400Response
- IdentifierType
- IdentifierType1
- ImportContact200Response
- ImportContact200ResponseUploadHeadersInner
- ImportContact400Response
- ImportContact404Response
- ImportContactRequest
- ListBatchedContact200Response
- ListBatchedContactRequest
- ListContact200Response
- ListContact400Response
- ListContactByEmail200Response
- ListContactByEmailRequest
- ListContactCount200Response
- ListContactCount200ResponseBillableBreakdown
- ListExportContact200Response
- ListExportContact200ResponseMetadata
- ListExportContact200ResponseResultInner
- ListExportContact200ResponseResultInnerMetadata
- ListExportContact200ResponseResultInnerSegmentsInner
- ListExportContact400Response
- ListExportContact400ResponseErrorsInner
- Metadata
- SearchContact200Response
- SearchContact400Response
- SearchContact400ResponseErrorsInner
- SearchContact500Response
- SearchContact500ResponseErrorsInner
- SearchContactRequest
- SelfMetadata
- Status
- UpdateContact202Response
- UpdateContactRequest
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)