openapi

package
v4.0.0-rc.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 6 Imported by: 0

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: 2024-10-24T13:26:02.095847Z[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

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)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiService

type ApiService struct {
	// contains filtered or unexported fields
}

func NewApiService

func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService

func NewApiServiceWithClient

func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService

func (*ApiService) DeleteContact

func (c *ApiService) DeleteContact(params *DeleteContactParam) (interface{}, error)

**This endpoint can be used to delete one or more contacts**. The query parameter `ids` must set to a comma-separated list of contact IDs for bulk contact deletion. The query parameter `delete_all_contacts` must be set to `\"true\"` to delete **all** contacts. You must set either `ids` or `delete_all_contacts`. Deletion jobs are processed asynchronously. Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.

func (*ApiService) DeleteContactIdentifier

func (c *ApiService) DeleteContactIdentifier(params *DeleteContactIdentifierParam) (interface{}, error)

**This endpoint can be used to delete one identifier from a contact.** Deletion jobs are processed asynchronously. Note this is different from deleting a contact. If the contact has only one identifier, the asynchronous request will fail. All contacts are required to have at least one identifier. The request body field `identifier_type` must have a valid value of \"EMAIL\", \"PHONENUMBERID\", \"EXTERNALID\", or \"ANONYMOUSID\".

func (*ApiService) ExportContact

func (c *ApiService) ExportContact(params *ExportContactParam) (interface{}, error)

**Use this endpoint to export lists or segments of contacts**. If you would just like to have a link to the exported list sent to your email set the `notifications.email` option to `true` in the `POST` payload. If you would like to download the list, take the `id` that is returned and use the \"Export Contacts Status\" endpoint to get the `urls`. Once you have the list of URLs, make a `GET` request to each URL provided to download your CSV file(s). You specify the segments and or/contact lists you wish to export by providing the relevant IDs in, respectively, the `segment_ids` and `list_ids` fields in the request body. The lists will be provided in either JSON or CSV files. To specify which of these you would required, set the request body `file_type` field to `json` or `csv`. You can also specify a maximum file size (in MB). If the export file is larger than this, it will be split into multiple files.

func (*ApiService) GetContact

func (c *ApiService) GetContact(params *GetContactParam) (interface{}, error)

**This endpoint returns the full details and all fields for the specified contact**. The \"Get Contacts by Identifier\" endpoint can be used to get the ID of a contact.

func (*ApiService) GetContactByIdentifiers

func (c *ApiService) GetContactByIdentifiers(params *GetContactByIdentifiersParam) (interface{}, error)

**This endpoint allows you to retrieve up to 100 contacts matching the searched identifier values for one type of specified identifier.** `identifier_type` must be a valid identifier type: `email`, `phone_number_id`, `external_id`, or `anonymous_id`. This endpoint should be used in place of the [Search Contacts endpoint](https://www.twilio.com/docs/sendgrid/api-reference/contacts/search-contacts) when you can provide exact identifiers and do not need to include other [Segmentation Query Language (SGQL)](https://www.twilio.com/docs/sendgrid/for-developers/sending-email/segmentation-query-language/) filters when searching. This endpoint returns a `200` status code when any contacts match the identifiers you supplied. When searching multiple identifiers in a single request, it is possible that some will match a contact while others will not. When a partially successful search like this is made, the matching contacts are returned in an object and an error message is returned for the identifiers that are not found. This endpoint returns a `404` status code when no contacts are found for the provided identifiers. A `400` status code is returned if any searched addresses are invalid. Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.

func (*ApiService) GetExportContact

func (c *ApiService) GetExportContact(params *GetExportContactParam) (interface{}, error)

**This endpoint can be used to check the status of a contact export job**. To use this call, you will need the `id` from the \"Export Contacts\" call. If you would like to download a list, take the `id` that is returned from the \"Export Contacts\" endpoint and make an API request here to get the `urls`. Once you have the list of URLs, make a `GET` request on each URL to download your CSV file(s). Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.

func (*ApiService) GetImportContact

func (c *ApiService) GetImportContact(params *GetImportContactParam) (interface{}, error)

**This endpoint can be used to check the status of a contact import job**. Use the `job_id` from the \"Import Contacts,\" \"Add or Update a Contact,\" or \"Delete Contacts\" endpoints as the `id` in the path parameter. If there is an error with your `PUT` request, download the `errors_url` file and open it to view more details. The job `status` field indicates whether the job is `pending`, `completed`, `errored`, or `failed`. Pending means not started. Completed means finished without any errors. Errored means finished with some errors. Failed means finished with all errors, or the job was entirely unprocessable: for example, if you attempt to import file format we do not support. The `results` object will have fields depending on the job type. Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.

func (*ApiService) ImportContact

func (c *ApiService) ImportContact(params *ImportContactParam) (interface{}, error)

**This endpoint allows a CSV upload containing up to one million contacts or 5GB of data, whichever is smaller. At least one identifier is required for a successful import.** Imports take place asynchronously: the endpoint returns a URL (`upload_uri`) and HTTP headers (`upload_headers`) which can subsequently be used to `PUT` a file of contacts to be imported into our system. Uploaded CSV files may also be [gzip-compressed](https://en.wikipedia.org/wiki/Gzip). In either case, you must include the field `file_type` with the value `csv` in your request body. The `field_mappings` parameter is a respective list of field definition IDs to map the uploaded CSV columns to. It allows you to use CSVs where one or more columns are skipped (`null`) or remapped to the contact field. For example, if `field_mappings` is set to `[null, \"w1\", \"_rf1\"]`, this means skip column 0, map column 1 to the custom field with the ID `w1`, and map column 2 to the reserved field with the ID `_rf1`. See the \"Get All Field Definitions\" endpoint to fetch your custom and reserved field IDs to use with `field_mappings`. Once you receive the response body you can then initiate a **second** API call where you use the supplied URL and HTTP header to upload your file. For example: `curl --upload-file \"file/path.csv\" \"URL_GIVEN\" -H \"HEADER_GIVEN\"` If you would like to monitor the status of your import job, use the `job_id` and the \"Import Contacts Status\" endpoint. Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.

func (*ApiService) ListBatchedContact

func (c *ApiService) ListBatchedContact(params *ListBatchedContactParam) (interface{}, error)

**This endpoint is used to retrieve a set of contacts identified by their IDs.** This can be more efficient endpoint to get contacts than making a series of individual `GET` requests to the \"Get a Contact by ID\" endpoint. You can supply up to 100 IDs. Pass them into the `ids` field in your request body as an array or one or more strings. Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.

func (*ApiService) ListContact

func (c *ApiService) ListContact() (interface{}, error)

**This endpoint will return up to 50 of the most recent contacts uploaded or attached to a list**. This list will then be sorted by email address. The full contact count is also returned. Please note that pagination of the contacts has been deprecated. Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.

func (*ApiService) ListContactByEmail

func (c *ApiService) ListContactByEmail(params *ListContactByEmailParam) (interface{}, error)

**This endpoint allows you to retrieve up to 100 contacts matching the searched `email` address(es), including any `alternate_emails`.** Email addresses are unique to a contact, meaning this endpoint can treat an email address as a primary key to search by. The contact object associated with the address, whether it is their `email` or one of their `alternate_emails` will be returned if matched. Email addresses in the search request do not need to match the case in which they're stored, but the email addresses in the result will be all lower case. Empty strings are excluded from the search and will not be returned. This endpoint should be used in place of the \"Search Contacts\" endpoint when you can provide exact email addresses and do not need to include other [Segmentation Query Language (SGQL)](https://sendgrid.com/docs/for-developers/sending-email/segmentation-query-language/) filters when searching. If you need to access a large percentage of your contacts, we recommend exporting your contacts with the \"Export Contacts\" endpoint and filtering the client side results. This endpoint returns a `200` status code when any contacts match the address(es) you supplied. When searching multiple addresses in a single request, it is possible that some addresses will match a contact while others will not. When a partially successful search like this is made, the matching contacts are returned in an object and an error message is returned for the email address(es) that are not found. This endpoint returns a `404` status code when no contacts are found for the provided email address(es). A `400` status code is returned if any searched addresses are invalid. Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.

func (*ApiService) ListContactCount

func (c *ApiService) ListContactCount() (interface{}, error)

**This endpoint returns the total number of contacts you have stored.** Twilio SendGrid recommends exporting your contacts regularly as a backup to avoid issues or lost data.

func (*ApiService) ListExportContact

func (c *ApiService) ListExportContact() (interface{}, error)

**Use this endpoint to retrieve details of all current exported jobs**. It will return an array of objects, each of which records an export job in flight or recently completed. Each object's `export_type` field will tell you which kind of export it is and its `status` field will indicate what stage of processing it has reached. Exports which are `ready` will be accompanied by a `urls` field which lists the URLs of the export's downloadable files — there will be more than one if you specified a maximum file size in your initial export request. Use this endpoint if you have exports in flight but do not know their IDs, which are required for the \"Export Contacts Status\" endpoint.

func (*ApiService) SearchContact

func (c *ApiService) SearchContact(params *SearchContactParam) (interface{}, error)

**Use this endpoint to locate contacts**. The request body's `query` field accepts valid [SGQL](https://sendgrid.com/docs/for-developers/sending-email/segmentation-query-language/) for searching for a contact. Because contact emails are stored in lower case, using SGQL to search by email address requires the provided email address to be in lower case. The SGQL `lower()` function can be used for this. Only the first 50 contacts that meet the search criteria will be returned. If the query takes longer than 20 seconds, a `408 Request Timeout` status will be returned. Formatting the `created_at` and `updated_at` values as Unix timestamps is deprecated. Instead, they are returned as ISO format as string.

func (*ApiService) UpdateContact

func (c *ApiService) UpdateContact(params *UpdateContactParam) (interface{}, error)

**This endpoint allows the [upsert](https://en.wiktionary.org/wiki/upsert) (insert or update) of up to 30,000 contacts, or 6MB of data, whichever is lower**. Because the creation and update of contacts is an asynchronous process, the response will not contain immediate feedback on the processing of your upserted contacts. Rather, it will contain an HTTP 202 response indicating the contacts are queued for processing or an HTTP 4XX error containing validation errors. Should you wish to get the resulting contact's ID or confirm that your contacts have been updated or added, you can use the [Get Contacts by Identifiers operation](https://www.twilio.com/docs/sendgrid/api-reference/contacts/get-contacts-by-identifiers). Please note that custom fields need to have been already created if you wish to set their values for the contacts being upserted. To do this, please use the [Create Custom Field Definition endpoint](https://www.twilio.com/docs/sendgrid/api-reference/custom-fields/create-custom-field-definition). You will see a `job_id` in the response to your request. This can be used to check the status of your upsert job. To do so, please use the [Import Contacts Status endpoint](https://www.twilio.com/docs/sendgrid/api-reference/contacts/import-contacts-status). If the contact already exists in the system, any entries submitted via this endpoint will update the existing contact. In order to update a contact, all of its existing identifiers must be present. Any fields omitted from the request will remain as they were. A contact's ID cannot be used to update the contact. The email field will be changed to all lower-case. If a contact is added with an email that exists but contains capital letters, the existing contact with the all lower-case email will be updated.

type ContactDetails3

type ContactDetails3 struct {
	Id                  string                  `json:"id"`
	FirstName           *string                 `json:"first_name,omitempty"`
	LastName            *string                 `json:"last_name,omitempty"`
	UniqueName          *string                 `json:"unique_name,omitempty"`
	Email               *string                 `json:"email,omitempty"`
	PhoneNumberId       *string                 `json:"phone_number_id,omitempty"`
	ExternalId          *string                 `json:"external_id,omitempty"`
	AnonymousId         *string                 `json:"anonymous_id,omitempty"`
	AlternateEmails     *[]string               `json:"alternate_emails,omitempty"`
	AddressLine1        *string                 `json:"address_line_1,omitempty"`
	AddressLine2        *string                 `json:"address_line_2,omitempty"`
	City                *string                 `json:"city,omitempty"`
	StateProvinceRegion *string                 `json:"state_province_region,omitempty"`
	Country             *string                 `json:"country,omitempty"`
	PostalCode          *string                 `json:"postal_code,omitempty"`
	PhoneNumber         *string                 `json:"phone_number,omitempty"`
	Whatsapp            *string                 `json:"whatsapp,omitempty"`
	Line                *string                 `json:"line,omitempty"`
	Facebook            *string                 `json:"facebook,omitempty"`
	ListIds             []string                `json:"list_ids"`
	SegmentIds          []string                `json:"segment_ids"`
	CustomFields        *map[string]interface{} `json:"custom_fields,omitempty"`
	CreatedAt           string                  `json:"created_at"`
	UpdatedAt           string                  `json:"updated_at"`
	Metadata            *SelfMetadata           `json:"_metadata,omitempty"`
}

ContactDetails3 struct for ContactDetails3

type ContactExport

type ContactExport struct {
	Id string `json:"id"`
	// The export job's status. Allowed values: `pending`, `ready`, or `failure`.
	Status Status `json:"status"`
	// The ISO8601 timestamp when the export was begun.
	CreatedAt string `json:"created_at"`
	// The ISO8601 timestamp when the export was updated.
	UpdatedAt string `json:"updated_at"`
	// The ISO8601 timestamp when the export was completed.
	CompletedAt *string `json:"completed_at,omitempty"`
	// The ISO8601 timestamp when the exported file on S3 will expire.
	ExpiresAt string `json:"expires_at"`
	// One or more download URLs for the contact file if the status is `ready`.
	Urls *[]string `json:"urls,omitempty"`
	// A human readable message if the status is `failure`.
	Message  *string   `json:"message,omitempty"`
	Metadata *Metadata `json:"_metadata,omitempty"`
	// The total number of exported contacts.
	ContactCount *int32 `json:"contact_count,omitempty"`
}

ContactExport struct for ContactExport

type ContactImport

type ContactImport struct {
	// The job ID.
	Id *string `json:"id,omitempty"`
	// The job state. Allowed values: `pending`, `completed`, `errored`, or `failed`.
	Status *string `json:"status,omitempty"`
	// The job type. Allowed values: `upsert`, or `delete`.
	JobType *string               `json:"job_type,omitempty"`
	Results *ContactImportResults `json:"results,omitempty"`
	// The ISO8601 timestamp when the job was created.
	StartedAt *string `json:"started_at,omitempty"`
	// The ISO8601 timestamp when the job was finished.
	FinishedAt *string `json:"finished_at,omitempty"`
}

ContactImport struct for ContactImport

type ContactImportResults

type ContactImportResults struct {
	// Requested contact count from the import.
	RequestedCount *float32 `json:"requested_count,omitempty"`
	// Created contact count from the import.
	CreatedCount *float32 `json:"created_count,omitempty"`
	// Updated contact count from the import.
	UpdatedCount *float32 `json:"updated_count,omitempty"`
	// Count of deleted contacts that resulted in error.
	DeletedCount *float32 `json:"deleted_count,omitempty"`
	// Count of imported contacts that resulted in error.
	ErroredCount *float32 `json:"errored_count,omitempty"`
	// The download URL of the file which provides information about any errors.
	ErrorsUrl *string `json:"errors_url,omitempty"`
}

ContactImportResults Result map of the import job.

type ContactRequest

type ContactRequest struct {
	// The first line of the address.
	AddressLine1 *string `json:"address_line_1,omitempty"`
	// An optional second line for the address.
	AddressLine2 *string `json:"address_line_2,omitempty"`
	// Additional emails associated with the contact.
	AlternateEmails *[]string `json:"alternate_emails,omitempty"`
	// The contact's city.
	City *string `json:"city,omitempty"`
	// The contact's country. Can be a full name or an abbreviation.
	Country *string `json:"country,omitempty"`
	// The contact's primary email. This is required to be a valid email.
	Email *string `json:"email,omitempty"`
	// The contact's Phone Number ID. This must be a valid phone number.
	PhoneNumberId *string `json:"phone_number_id,omitempty"`
	// The contact's External ID.
	ExternalId *string `json:"external_id,omitempty"`
	// The contact's Anonymous ID.
	AnonymousId *string `json:"anonymous_id,omitempty"`
	// The contact's personal name.
	FirstName *string `json:"first_name,omitempty"`
	// The contact's family name.
	LastName *string `json:"last_name,omitempty"`
	// The contact's ZIP code or other postal code.
	PostalCode *string `json:"postal_code,omitempty"`
	// The contact's state, province, or region.
	StateProvinceRegion *string                     `json:"state_province_region,omitempty"`
	CustomFields        *ContactRequestCustomFields `json:"custom_fields,omitempty"`
}

ContactRequest struct for ContactRequest

type ContactRequestCustomFields

type ContactRequestCustomFields struct {
	// The properties in this object are made up of a key (the custom field ID) and value you want associated with that custom field. For example `{\"w1\": \"coffee\"}`.
	W1 *string `json:"w1,omitempty"`
}

ContactRequestCustomFields An object of custom field IDs and the values you want to associate with those custom fields. You can retrieve the IDs of your custom fields from the [Get All Field Definitions endpoint](https://docs.sendgrid.com/api-reference/custom-fields/get-all-field-definitions).

type ContactsError

type ContactsError struct {
	Message   string  `json:"message"`
	Field     *string `json:"field,omitempty"`
	ErrorId   *string `json:"error_id,omitempty"`
	Parameter *string `json:"parameter,omitempty"`
}

ContactsError struct for ContactsError

type DeleteContact202Response

type DeleteContact202Response struct {
	// The deletion job ID.
	JobId map[string]interface{} `json:"job_id"`
}

DeleteContact202Response The deletion job has been accepted and is being processed.

type DeleteContact400Response

type DeleteContact400Response struct {
	Errors []map[string]interface{} `json:"errors"`
}

DeleteContact400Response struct for DeleteContact400Response

type DeleteContactIdentifier202Response

type DeleteContactIdentifier202Response struct {
	// The deletion job ID.
	JobId map[string]interface{} `json:"job_id"`
}

DeleteContactIdentifier202Response Indicates that the deletion is queued for processing. Check the job status with the Import Contacts Status endpoint.

type DeleteContactIdentifierParam

type DeleteContactIdentifierParam struct {
	// Must be set to the `contact_id` of the contact you want to remove the identifier from.
	ContactId *string `json:"contact_id"`
	//
	DeleteContactIdentifierRequest *DeleteContactIdentifierRequest `json:"DeleteContactIdentifierRequest,omitempty"`
}

func (*DeleteContactIdentifierParam) SetContactId

func (params *DeleteContactIdentifierParam) SetContactId(ContactId string) *DeleteContactIdentifierParam

func (*DeleteContactIdentifierParam) SetDeleteContactIdentifierRequest

func (params *DeleteContactIdentifierParam) SetDeleteContactIdentifierRequest(DeleteContactIdentifierRequest DeleteContactIdentifierRequest) *DeleteContactIdentifierParam

type DeleteContactIdentifierRequest

type DeleteContactIdentifierRequest struct {
	// The type of identifier you are removing from the contact.
	IdentifierType IdentifierType `json:"identifier_type"`
	// The value of the identifier you want to remove from the contact.
	IdentifierValue string `json:"identifier_value"`
}

DeleteContactIdentifierRequest struct for DeleteContactIdentifierRequest

type DeleteContactParam

type DeleteContactParam struct {
	// Must be set to `\"true\"` to delete all contacts.
	DeleteAllContacts *string `json:"delete_all_contacts,omitempty"`
	// A comma-separated list of contact IDs.
	Ids *string `json:"ids,omitempty"`
}

func (*DeleteContactParam) SetDeleteAllContacts

func (params *DeleteContactParam) SetDeleteAllContacts(DeleteAllContacts string) *DeleteContactParam

func (*DeleteContactParam) SetIds

func (params *DeleteContactParam) SetIds(Ids string) *DeleteContactParam

type ErrorResponse

type ErrorResponse struct {
	Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"`
	// When applicable, this property value will be an error ID.
	Id *string `json:"id,omitempty"`
}

ErrorResponse struct for ErrorResponse

type ErrorResponseErrorsInner

type ErrorResponseErrorsInner struct {
	// An error message.
	Message *string `json:"message,omitempty"`
	// When applicable, this property value will be the field that generated the error.
	Field *string `json:"field,omitempty"`
	// When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error.
	Help *map[string]interface{} `json:"help,omitempty"`
}

ErrorResponseErrorsInner struct for ErrorResponseErrorsInner

type ExportContact202Response

type ExportContact202Response struct {
	Metadata Metadata `json:"_metadata"`
	// The ID of the export job.
	Id *string `json:"id,omitempty"`
}

ExportContact202Response struct for ExportContact202Response

type ExportContactParam

type ExportContactParam struct {
	//
	ExportContactRequest *ExportContactRequest `json:"ExportContactRequest,omitempty"`
}

func (*ExportContactParam) SetExportContactRequest

func (params *ExportContactParam) SetExportContactRequest(ExportContactRequest ExportContactRequest) *ExportContactParam

type ExportContactRequest

type ExportContactRequest struct {
	// IDs of the contact lists you want to export.
	ListIds *[]string `json:"list_ids,omitempty"`
	// IDs of the contact segments you want to export.
	SegmentIds    *[]string                          `json:"segment_ids,omitempty"`
	Notifications *ExportContactRequestNotifications `json:"notifications,omitempty"`
	// File type for export file. Choose from `json` or `csv`.
	FileType *FileType `json:"file_type,omitempty"`
	// The maximum size of an export file in MB. Note that when this option is specified, multiple output files may be returned from the export.
	MaxFileSize *int32 `json:"max_file_size,omitempty"`
}

ExportContactRequest struct for ExportContactRequest

type ExportContactRequestNotifications

type ExportContactRequestNotifications struct {
	Email *bool `json:"email,omitempty"`
}

ExportContactRequestNotifications struct for ExportContactRequestNotifications

type FileType

type FileType string

FileType the model 'FileType'

const (
	FILETYPE_CSV  FileType = "csv"
	FILETYPE_JSON FileType = "json"
)

List of FileType

type FileType1

type FileType1 string

FileType1 the model 'FileType1'

const (
	FILETYPE1_CSV FileType1 = "csv"
)

List of FileType1

type GetContactByIdentifiers200Response

type GetContactByIdentifiers200Response struct {
	Result *interface{} `json:"result,omitempty"`
}

GetContactByIdentifiers200Response An object containing one or more of the identifiers matching the searched identifiers in your contacts.

type GetContactByIdentifiers200ResponseResultValue

type GetContactByIdentifiers200ResponseResultValue struct {
	Contact *ContactDetails3 `json:"contact,omitempty"`
	Error   *string          `json:"error,omitempty"`
}

GetContactByIdentifiers200ResponseResultValue An identifiers value matching a searched identifier in your contacts. For example, if you use the email identifier type, the email address will be returned.

type GetContactByIdentifiersParam

type GetContactByIdentifiersParam struct {
	// The type of identifier to search for.
	IdentifierType *IdentifierType1 `json:"identifier_type"`
	//
	GetContactByIdentifiersRequest *GetContactByIdentifiersRequest `json:"GetContactByIdentifiersRequest,omitempty"`
}

func (*GetContactByIdentifiersParam) SetGetContactByIdentifiersRequest

func (params *GetContactByIdentifiersParam) SetGetContactByIdentifiersRequest(GetContactByIdentifiersRequest GetContactByIdentifiersRequest) *GetContactByIdentifiersParam

func (*GetContactByIdentifiersParam) SetIdentifierType

func (params *GetContactByIdentifiersParam) SetIdentifierType(IdentifierType IdentifierType1) *GetContactByIdentifiersParam

type GetContactByIdentifiersRequest

type GetContactByIdentifiersRequest struct {
	// One or more more identifier values to search for in your Marketing Campaigns contacts.
	Identifiers []string `json:"identifiers"`
}

GetContactByIdentifiersRequest

type GetContactParam

type GetContactParam struct {
	//
	Id *string `json:"id"`
}

func (*GetContactParam) SetId

func (params *GetContactParam) SetId(Id string) *GetContactParam

type GetExportContactParam

type GetExportContactParam struct {
	//
	Id *string `json:"id"`
}

func (*GetExportContactParam) SetId

type GetImportContact400Response

type GetImportContact400Response struct {
	Errors *ContactsError `json:"errors,omitempty"`
}

GetImportContact400Response struct for GetImportContact400Response

type GetImportContactParam

type GetImportContactParam struct {
	//
	Id *string `json:"id"`
}

func (*GetImportContactParam) SetId

type IdentifierType

type IdentifierType string

IdentifierType the model 'IdentifierType'

const (
	IDENTIFIERTYPE_EMAIL         IdentifierType = "EMAIL"
	IDENTIFIERTYPE_PHONENUMBERID IdentifierType = "PHONENUMBERID"
	IDENTIFIERTYPE_EXTERNALID    IdentifierType = "EXTERNALID"
	IDENTIFIERTYPE_ANONYMOUSID   IdentifierType = "ANONYMOUSID"
)

List of IdentifierType

type IdentifierType1

type IdentifierType1 string

IdentifierType1 the model 'IdentifierType1'

const (
	IDENTIFIERTYPE1_EMAIL           IdentifierType1 = "email"
	IDENTIFIERTYPE1_PHONE_NUMBER_ID IdentifierType1 = "phone_number_id"
	IDENTIFIERTYPE1_EXTERNAL_ID     IdentifierType1 = "external_id"
	IDENTIFIERTYPE1_ANONYMOUS_ID    IdentifierType1 = "anonymous_id"
)

List of IdentifierType1

type ImportContact200Response

type ImportContact200Response struct {
	// The ID of the import job.
	JobId *string `json:"job_id,omitempty"`
	// The URI to PUT the upload file to.
	UploadUri *string `json:"upload_uri,omitempty"`
	// A list of headers that must be included in PUT request.
	UploadHeaders *[]ImportContact200ResponseUploadHeadersInner `json:"upload_headers,omitempty"`
}

ImportContact200Response struct for ImportContact200Response

type ImportContact200ResponseUploadHeadersInner

type ImportContact200ResponseUploadHeadersInner struct {
	Header string `json:"header"`
	Value  string `json:"value"`
}

ImportContact200ResponseUploadHeadersInner struct for ImportContact200ResponseUploadHeadersInner

type ImportContact400Response

type ImportContact400Response struct {
	Errors []ContactsError `json:"errors"`
}

ImportContact400Response struct for ImportContact400Response

type ImportContact404Response

type ImportContact404Response struct {
	Errors []ContactsError `json:"errors"`
}

ImportContact404Response If any of the specified lists do not exist.

type ImportContactParam

type ImportContactParam struct {
	//
	ImportContactRequest *ImportContactRequest `json:"ImportContactRequest,omitempty"`
}

func (*ImportContactParam) SetImportContactRequest

func (params *ImportContactParam) SetImportContactRequest(ImportContactRequest ImportContactRequest) *ImportContactParam

type ImportContactRequest

type ImportContactRequest struct {
	// All contacts will be added to each of the specified lists.
	ListIds *[]string `json:"list_ids,omitempty"`
	// Upload file type.
	FileType FileType1 `json:"file_type"`
	// Import file header to reserved/custom field mapping.
	FieldMappings []string `json:"field_mappings"`
}

ImportContactRequest struct for ImportContactRequest

type ListBatchedContact200Response

type ListBatchedContact200Response struct {
	Result *[]ContactDetails3 `json:"result,omitempty"`
}

ListBatchedContact200Response struct for ListBatchedContact200Response

type ListBatchedContactParam

type ListBatchedContactParam struct {
	//
	ListBatchedContactRequest *ListBatchedContactRequest `json:"ListBatchedContactRequest,omitempty"`
}

func (*ListBatchedContactParam) SetListBatchedContactRequest

func (params *ListBatchedContactParam) SetListBatchedContactRequest(ListBatchedContactRequest ListBatchedContactRequest) *ListBatchedContactParam

type ListBatchedContactRequest

type ListBatchedContactRequest struct {
	Ids []string `json:"ids"`
}

ListBatchedContactRequest Array of IDs

type ListContact200Response

type ListContact200Response struct {
	Result       *[]ContactDetails3 `json:"result,omitempty"`
	Metadata     *SelfMetadata      `json:"_metadata,omitempty"`
	ContactCount *int32             `json:"contact_count,omitempty"`
}

ListContact200Response struct for ListContact200Response

type ListContact400Response

type ListContact400Response struct {
	Errors *[]ContactsError `json:"errors,omitempty"`
}

ListContact400Response struct for ListContact400Response

type ListContactByEmail200Response

type ListContactByEmail200Response struct {
	Result *map[string]interface{} `json:"result,omitempty"`
}

ListContactByEmail200Response An object containing one or more of the email addresses matching the searched addresses in your contacts.

type ListContactByEmailParam

type ListContactByEmailParam struct {
	//
	ListContactByEmailRequest *ListContactByEmailRequest `json:"ListContactByEmailRequest,omitempty"`
}

func (*ListContactByEmailParam) SetListContactByEmailRequest

func (params *ListContactByEmailParam) SetListContactByEmailRequest(ListContactByEmailRequest ListContactByEmailRequest) *ListContactByEmailParam

type ListContactByEmailRequest

type ListContactByEmailRequest struct {
	// One or more primary and/or alternate email addresses to search for in your Marketing Campaigns contacts.
	Emails []string `json:"emails"`
	// The contact's Phone Number ID. This is required to be a valid phone number.
	PhoneNumberId *string `json:"phone_number_id,omitempty"`
	// The contact's External ID.
	ExternalId *string `json:"external_id,omitempty"`
	// The contact's Anonymous ID.
	AnonymousId *string `json:"anonymous_id,omitempty"`
}

ListContactByEmailRequest

type ListContactCount200Response

type ListContactCount200Response struct {
	// The total number of contacts.
	ContactCount int32 `json:"contact_count"`
	// The count of contacts this month for billing purposes.
	BillableCount     *int32                                        `json:"billable_count,omitempty"`
	BillableBreakdown *ListContactCount200ResponseBillableBreakdown `json:"billable_breakdown,omitempty"`
}

ListContactCount200Response struct for ListContactCount200Response

type ListContactCount200ResponseBillableBreakdown

type ListContactCount200ResponseBillableBreakdown struct {
	// The sum of all the subuser's billable contacts
	Total *int32 `json:"total,omitempty"`
	// A map of each subuser's billable contact usage. Each key is the subuser's ID and each value is the usage thus far this month.
	Breakdown *map[string]interface{} `json:"breakdown,omitempty"`
}

ListContactCount200ResponseBillableBreakdown `billable_breakdown` will only appear to the parent user in an account with subusers.

type ListContactCountParam

type ListContactCountParam struct {
}

type ListContactParam

type ListContactParam struct {
}

type ListExportContact200Response

type ListExportContact200Response struct {
	Result   *[]ListExportContact200ResponseResultInner `json:"result,omitempty"`
	Metadata *ListExportContact200ResponseMetadata      `json:"_metadata,omitempty"`
}

ListExportContact200Response struct for ListExportContact200Response

type ListExportContact200ResponseMetadata

type ListExportContact200ResponseMetadata struct {
	Prev *string `json:"prev,omitempty"`
	// Link to this page.
	Self *string `json:"self,omitempty"`
	// Link to next page.
	Next *string `json:"next,omitempty"`
}

ListExportContact200ResponseMetadata struct for ListExportContact200ResponseMetadata

type ListExportContact200ResponseResultInner

type ListExportContact200ResponseResultInner struct {
	// Export jobs ID.
	Id *string `json:"id,omitempty"`
	// Allowed values: `pending`, `ready`, or `failure`.
	Status *string `json:"status,omitempty"`
	// This ISO8601 timestamp when the export was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// This ISO8601 timestamp when the export was completed.
	CompletedAt *string `json:"completed_at,omitempty"`
	// This ISO8601 timestamp when the export expires.
	ExpiresAt *string `json:"expires_at,omitempty"`
	// One or more download URLs for the contact file(s) if the status is `ready`.
	Urls *[]string `json:"urls,omitempty"`
	// User ID.
	UserId *string `json:"user_id,omitempty"`
	// Allowed types: `contacts_export`, `list_export`, or `segment_export`.
	ExportType *string                                                 `json:"export_type,omitempty"`
	Segments   *[]ListExportContact200ResponseResultInnerSegmentsInner `json:"segments,omitempty"`
	Lists      *[]ListExportContact200ResponseResultInnerSegmentsInner `json:"lists,omitempty"`
	Metadata   *ListExportContact200ResponseResultInnerMetadata        `json:"_metadata,omitempty"`
}

ListExportContact200ResponseResultInner struct for ListExportContact200ResponseResultInner

type ListExportContact200ResponseResultInnerMetadata

type ListExportContact200ResponseResultInnerMetadata struct {
	Prev *string `json:"prev,omitempty"`
	Self *string `json:"self,omitempty"`
	Next *string `json:"next,omitempty"`
}

ListExportContact200ResponseResultInnerMetadata struct for ListExportContact200ResponseResultInnerMetadata

type ListExportContact200ResponseResultInnerSegmentsInner

type ListExportContact200ResponseResultInnerSegmentsInner struct {
	ID   *string `json:"ID,omitempty"`
	Name *string `json:"Name,omitempty"`
}

ListExportContact200ResponseResultInnerSegmentsInner struct for ListExportContact200ResponseResultInnerSegmentsInner

type ListExportContact400Response

type ListExportContact400Response struct {
	Errors *[]ListExportContact400ResponseErrorsInner `json:"errors,omitempty"`
}

ListExportContact400Response struct for ListExportContact400Response

type ListExportContact400ResponseErrorsInner

type ListExportContact400ResponseErrorsInner struct {
	Message string  `json:"message"`
	ErrorId *string `json:"error_id,omitempty"`
}

ListExportContact400ResponseErrorsInner struct for ListExportContact400ResponseErrorsInner

type ListExportContactParam

type ListExportContactParam struct {
}

type Metadata

type Metadata struct {
	// The URL of the previous page of results. If this field isn't present, you're at the start of the list.
	Prev *string `json:"prev,omitempty"`
	// The URL of the current page of results.
	Self *string `json:"self,omitempty"`
	// The URL of the next page of results. If this field isn't present, you're at the end of the list.
	Next *string `json:"next,omitempty"`
	// The number of items in the entire list, i.e., across all pages.
	Count *float32 `json:"count,omitempty"`
}

Metadata struct for Metadata

type SearchContact200Response

type SearchContact200Response struct {
	Result   *[]ContactDetails3 `json:"result,omitempty"`
	Metadata *SelfMetadata      `json:"_metadata,omitempty"`
	// The total number of contacts matched.
	ContactCount float32 `json:"contact_count"`
}

SearchContact200Response struct for SearchContact200Response

type SearchContact400Response

type SearchContact400Response struct {
	Errors *[]SearchContact400ResponseErrorsInner `json:"errors,omitempty"`
}

SearchContact400Response struct for SearchContact400Response

type SearchContact400ResponseErrorsInner

type SearchContact400ResponseErrorsInner struct {
	Field   *string `json:"field,omitempty"`
	Message *string `json:"message,omitempty"`
}

SearchContact400ResponseErrorsInner struct for SearchContact400ResponseErrorsInner

type SearchContact500Response

type SearchContact500Response struct {
	Errors *[]SearchContact500ResponseErrorsInner `json:"errors,omitempty"`
}

SearchContact500Response struct for SearchContact500Response

type SearchContact500ResponseErrorsInner

type SearchContact500ResponseErrorsInner struct {
	Message *string `json:"message,omitempty"`
}

SearchContact500ResponseErrorsInner struct for SearchContact500ResponseErrorsInner

type SearchContactParam

type SearchContactParam struct {
	//
	SearchContactRequest *SearchContactRequest `json:"SearchContactRequest,omitempty"`
}

func (*SearchContactParam) SetSearchContactRequest

func (params *SearchContactParam) SetSearchContactRequest(SearchContactRequest SearchContactRequest) *SearchContactParam

type SearchContactRequest

type SearchContactRequest struct {
	// An SGQL search string or other pattern.
	Query string `json:"query"`
}

SearchContactRequest struct for SearchContactRequest

type SelfMetadata

type SelfMetadata struct {
	// A link to this object.
	Self *string `json:"self,omitempty"`
}

SelfMetadata struct for SelfMetadata

type Status

type Status string

Status the model 'Status'

const (
	STATUS_PENDING Status = "pending"
	STATUS_READY   Status = "ready"
	STATUS_FAILURE Status = "failure"
)

List of Status

type UpdateContact202Response

type UpdateContact202Response struct {
	// Indicates that the contacts are queued for processing. Check the job status with the \"Import Contacts Status\" endpoint.
	JobId *string `json:"job_id,omitempty"`
}

UpdateContact202Response struct for UpdateContact202Response

type UpdateContactParam

type UpdateContactParam struct {
	//
	UpdateContactRequest *UpdateContactRequest `json:"UpdateContactRequest,omitempty"`
}

func (*UpdateContactParam) SetUpdateContactRequest

func (params *UpdateContactParam) SetUpdateContactRequest(UpdateContactRequest UpdateContactRequest) *UpdateContactParam

type UpdateContactRequest

type UpdateContactRequest struct {
	// An array of List ID strings that this contact will be added to.
	ListIds *[]string `json:"list_ids,omitempty"`
	// One or more contacts objects that you intend to upsert. Each contact needs to include at least one of `email`, `phone_number_id`, `external_id`, or `anonymous_id` as an identifier.
	Contacts []ContactRequest `json:"contacts"`
}

UpdateContactRequest struct for UpdateContactRequest

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL