# README
Go API client for
The Twilio SendGrid Marketing Campaigns Custom Fields API allows you to add extra information about your marketing contacts that is relevant to your needs. For example, a fashion retailer might create a custom field for customers' shoe sizes, an ice cream shop might store customers' favorite flavors in a custom field, and you can create custom fields that make sense for your business.
With custom fields, you can also create segments based on custom fields values. Your custom fields are completely customizable to the use-cases and user information that you need.
You can also manage your Custom Fields using the SendGrid application user interface. See Using Custom Fields for more information, including a list of Reserved Fields. You can also manage your custom fields in the Marketing Campaigns application user interface.
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.304344Z[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 |
---|---|---|---|
CreateFieldDefinition | CreateFieldDefinition | Post /v3/marketing/field_definitions | Create Custom Field Definition |
DeleteFieldDefinition | DeleteFieldDefinition | Delete /v3/marketing/field_definitions/{CustomFieldId} | Delete Custom Field Definition |
ListFieldDefinition | ListFieldDefinition | Get /v3/marketing/field_definitions | Get All Field Definitions |
UpdateFieldDefinition | UpdateFieldDefinition | Patch /v3/marketing/field_definitions/{CustomFieldId} | Update Custom Field Definition |
Documentation For Models
- CreateFieldDefinition200Response
- CreateFieldDefinition400Response
- CreateFieldDefinitionRequest
- CustomFieldDefinitionsResponse
- CustomFieldsError
- FieldType
- FieldType1
- FieldType2
- ListFieldDefinition200Response
- Metadata
- ReservedFieldDefinitionsResponseInner
- UpdateFieldDefinitionRequest
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)