getresponse

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 12 Imported by: 0

README

getresponse-go

A Go client for the GetResponse v3 API.

Supports the GetResponse SMB environment as well as GetResponse MAX (formerly GetResponse 360) EU and US environments.

go get github.com/bzelaznicki/getresponse-go

Requires Go 1.24+.

Quick start

package main

import (
	"context"
	"fmt"
	"log"
	"time"

	getresponse "github.com/bzelaznicki/getresponse-go"
)

func main() {
	client, err := getresponse.New("YOUR_API_KEY", getresponse.EnvMaxUS,
		getresponse.WithMailingDomain("example.com"),
		getresponse.WithTimeout(30*time.Second),
	)
	if err != nil {
		log.Fatal(err)
	}

	ctx := context.Background()

	account, err := client.GetAccount(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println("Logged in as", account.Email)
}

Environments

Constant Code Host
getresponse.EnvSMB SMB api.getresponse.com
getresponse.EnvMaxEU PL api3.getresponse360.pl
getresponse.EnvMaxUS US api3.getresponse360.com

ParseEnvironment("US") converts a stored short code into an Environment (returns an error on unknown codes — no silent fallback).

Pagination

Each list endpoint comes in two flavours:

  • Get*List / Get* — returns a single page plus a ResponseHeader (TotalPages, TotalCount, RateLimit, ...) for manual paging.
  • All* — a Go 1.23 range-over-func iterator that transparently walks every page.
for campaign, err := range client.AllCampaigns(ctx) {
	if err != nil {
		log.Fatal(err) // loop stops after yielding the error
	}
	fmt.Println(campaign.Name)
}

Break out of the loop at any time and no further pages are fetched.

Errors

Any non-2xx response is returned as an APIError carrying the structured payload from GetResponse:

_, err := client.ScheduleNewContactImport(ctx, imp)
var apiErr getresponse.APIError
if errors.As(err, &apiErr) {
	fmt.Println(apiErr.Code, apiErr.Message)
}

Options

Option Purpose
WithMailingDomain(domain) Set X-Domain (required for MAX/360 accounts)
WithTimeout(d) Timeout for the default HTTP client
WithHTTPClient(hc) Supply a custom *http.Client
WithUserAgent(ua) Override the User-Agent header
WithEndpoint(url) Override the base URL (testing / mock servers)

License

MIT — see LICENSE.

Documentation

Overview

Package getresponse is a Go client for the GetResponse v3 API.

It supports the GetResponse SMB environment as well as the GetResponse MAX (formerly GetResponse 360) EU and US environments.

Getting started

Create a client with an API key and a target environment:

client, err := getresponse.New(apiKey, getresponse.EnvMaxUS,
	getresponse.WithMailingDomain("example.com"),
	getresponse.WithTimeout(30*time.Second),
)
if err != nil {
	// handle error
}

account, err := client.GetAccount(ctx)

Pagination

List endpoints expose two shapes. The *List / Get* methods return a single page plus the parsed ResponseHeader (TotalPages, RateLimit, ...) so callers can page manually. The All* methods return a Go 1.23 range-over-func iterator that transparently walks every page:

for campaign, err := range client.AllCampaigns(ctx) {
	if err != nil {
		// handle error; the loop stops after yielding it
		break
	}
	// use campaign
}

Errors

Any non-2xx response is returned as an APIError carrying the structured error payload from GetResponse (code, message, context, ...). Use errors.As to inspect it.

Index

Constants

View Source
const UserAgent = "getresponse-go " + Version

UserAgent is the default User-Agent header sent with every request. It can be overridden per-client with WithUserAgent.

View Source
const Version = "v0.1.0"

Version is the semantic version of this SDK.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	HttpStatus      int            `json:"httpStatus"`
	Code            int            `json:"code"`
	CodeDescription string         `json:"codeDescription"`
	Message         string         `json:"message"`
	MoreInfo        string         `json:"moreInfo"`
	Context         map[string]any `json:"context"`
	Uuid            string         `json:"uuid"`
}

APIError represents an error returned by the GetResponse API. It is returned by any client method whose request produced a non-2xx HTTP response.

func (APIError) Error

func (e APIError) Error() string

type Account

type Account struct {
	AccountID   string `json:"accountId"`
	Email       string `json:"email"`
	CountryCode struct {
		CountryCodeID string `json:"countryCodeId"`
		CountryCode   string `json:"countryCode"`
	} `json:"countryCode"`
	IndustryTag struct {
		IndustryTagID string `json:"industryTagId"`
	} `json:"industryTag"`
	TimeZone struct {
		Name   string `json:"name"`
		Offset string `json:"offset"`
	} `json:"timeZone"`
	Href              string `json:"href"`
	FirstName         string `json:"firstName"`
	LastName          string `json:"lastName"`
	CompanyName       string `json:"companyName"`
	Phone             string `json:"phone"`
	State             string `json:"state"`
	City              string `json:"city"`
	Street            string `json:"street"`
	ZipCode           string `json:"zipCode"`
	NumberOfEmployees string `json:"numberOfEmployees"`
	TimeFormat        string `json:"timeFormat"`
}

Account represents a GetResponse account and its profile details.

type Campaign

type Campaign struct {
	Description  string `json:"description,omitzero"`
	CampaignID   string `json:"campaignId"`
	Name         string `json:"name"`
	TechName     string `json:"techName,omitzero"`
	LanguageCode string `json:"languageCode,omitzero"`
	IsDefault    string `json:"isDefault,omitzero"`
	CreatedOn    string `json:"createdOn,omitzero"`
	Href         string `json:"href"`
	Postal       struct {
		AddPostalToMessages string `json:"addPostalToMessages"`
		City                string `json:"city"`
		CompanyName         string `json:"companyName"`
		Country             string `json:"country"`
		Design              string `json:"design"`
		State               string `json:"state"`
		Street              string `json:"street"`
		ZipCode             string `json:"zipCode"`
	} `json:"postal,omitzero"`
	Confirmation struct {
		FromField                         FromField `json:"fromField"`
		RedirectType                      string    `json:"redirectType"`
		MimeType                          string    `json:"mimeType"`
		RedirectURL                       string    `json:"redirectUrl"`
		ReplyTo                           FromField `json:"replyTo"`
		SubscriptionConfirmationBodyId    string    `json:"subscriptionConfirmationBodyId"`
		SubscriptionConfirmationSubjectId string    `json:"subscriptionConfirmationSubjectId"`
	} `json:"confirmation,omitzero"`

	OptInTypes struct {
		Email   string `json:"email"`
		Api     string `json:"api"`
		Import  string `json:"import"`
		Webform string `json:"webform"`
	} `json:"optInTypes,omitzero"`

	SubscriptionNotifications struct {
		Status     string      `json:"status"`
		Recipients []FromField `json:"recipients"`
	} `json:"subscriptionNotifications,omitzero"`

	Profile struct {
		Description   string `json:"description"`
		IndustryTagID string `json:"industryTagId"`
		Logo          string `json:"logo"`
		LogoLinkURL   string `json:"logoLinkUrl"`
		Title         string `json:"title"`
	} `json:"profile,omitzero"`
}

Campaign represents a GetResponse campaign (list).

type ClickedCondition

type ClickedCondition struct {
	ConditionType string `json:"conditionType"`
	Scope         string `json:"scope"`
	Operator      string `json:"operator"`
	OperatorType  string `json:"operatorType"`
	ClickTrackId  string `json:"clickTrackId"`
}

ClickedCondition represents the conditions for filtering contacts based on whether they clicked a specific link in a message. This structure is used to define the criteria for such a condition.

Fields:

  • ConditionType: Specifies the type of condition. Must be set to "clicked".
  • Scope: The ID of the message to which the condition applies.
  • Operator: Specifies the type of message. Can be one of "autoresponder", "newsletter", "splittest", or "automation".
  • OperatorType: Specifies the operator type. Must be set to "message_operator".
  • ClickTrackId: The ID of the link click track or "all" to apply to all links.

func (*ClickedCondition) GetType

func (c *ClickedCondition) GetType() string

type Client

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

Client is a GetResponse API client. Create one with New. A Client is safe for concurrent use by multiple goroutines.

func New

func New(apiKey string, env Environment, opts ...Option) (*Client, error)

New creates a Client for the given API key and environment. The environment determines the base API URL; supply additional configuration via options.

func (*Client) AllCampaigns

func (c *Client) AllCampaigns(ctx context.Context, opts ...QueryOption) iter.Seq2[Campaign, error]

AllCampaigns iterates every campaign across all pages.

func (*Client) AllContactsByIDSearchContacts

func (c *Client) AllContactsByIDSearchContacts(ctx context.Context, searchContactsID string, opts ...QueryOption) iter.Seq2[Contact, error]

AllContactsByIDSearchContacts iterates every contact in a saved search (segment) across all pages.

func (*Client) AllContactsFromCampaign

func (c *Client) AllContactsFromCampaign(ctx context.Context, campaignID string, opts ...QueryOption) iter.Seq2[Contact, error]

AllContactsFromCampaign iterates every contact in a campaign across all pages.

func (*Client) AllContactsFromSearchContactsConditions

func (c *Client) AllContactsFromSearchContactsConditions(ctx context.Context, conditions SearchContacts, opts ...QueryOption) iter.Seq2[Contact, error]

AllContactsFromSearchContactsConditions iterates every contact matching the supplied ad-hoc conditions across all pages.

func (*Client) AllCustomFields

func (c *Client) AllCustomFields(ctx context.Context, opts ...QueryOption) iter.Seq2[CustomField, error]

AllCustomFields iterates every custom field across all pages.

func (*Client) AllSearchContacts

func (c *Client) AllSearchContacts(ctx context.Context, opts ...QueryOption) iter.Seq2[SearchContacts, error]

AllSearchContacts iterates every saved search (segment) across all pages.

func (*Client) AllTags

func (c *Client) AllTags(ctx context.Context, opts ...QueryOption) iter.Seq2[Tag, error]

AllTags iterates every tag across all pages.

func (*Client) CreateCustomField

func (c *Client) CreateCustomField(ctx context.Context, cf CustomField) (CustomField, error)

CreateCustomField creates a new custom field. The name must be 2-64 characters and the type and format must be among the values accepted by GetResponse.

func (*Client) CreateTag

func (c *Client) CreateTag(ctx context.Context, t Tag) (Tag, error)

CreateTag creates a new tag. The name must be 2-64 characters.

func (*Client) GetAccount

func (c *Client) GetAccount(ctx context.Context) (Account, error)

GetAccount retrieves the details of the authenticated account.

func (*Client) GetCampaigns

func (c *Client) GetCampaigns(ctx context.Context, opts ...QueryOption) ([]Campaign, ResponseHeader, error)

GetCampaigns retrieves a single page of campaigns. Use the returned ResponseHeader for pagination, or AllCampaigns to iterate every page.

func (*Client) GetContactsByIDSearchContacts

func (c *Client) GetContactsByIDSearchContacts(ctx context.Context, searchContactsID string, opts ...QueryOption) ([]Contact, ResponseHeader, error)

GetContactsByIDSearchContacts retrieves a single page of contacts matching a saved search (segment). Use AllContactsByIDSearchContacts to iterate every page.

func (*Client) GetContactsFromCampaign

func (c *Client) GetContactsFromCampaign(ctx context.Context, campaignID string, opts ...QueryOption) ([]Contact, ResponseHeader, error)

GetContactsFromCampaign retrieves a single page of contacts belonging to the given campaign. Use AllContactsFromCampaign to iterate every page.

func (*Client) GetContactsFromSearchContactsConditions

func (c *Client) GetContactsFromSearchContactsConditions(ctx context.Context, conditions SearchContacts, opts ...QueryOption) ([]Contact, ResponseHeader, error)

GetContactsFromSearchContactsConditions retrieves a single page of contacts matching the supplied ad-hoc conditions. Use AllContactsFromSearchContactsConditions to iterate every page.

func (*Client) GetCustomFieldsList

func (c *Client) GetCustomFieldsList(ctx context.Context, opts ...QueryOption) ([]CustomField, ResponseHeader, error)

GetCustomFieldsList retrieves a single page of custom fields. Use AllCustomFields to iterate every page.

func (*Client) GetImport

func (c *Client) GetImport(ctx context.Context, importID string) (Import, error)

GetImport retrieves the status of a previously scheduled import.

func (*Client) GetSearchContactsByID

func (c *Client) GetSearchContactsByID(ctx context.Context, searchContactsID string, opts ...QueryOption) (SearchContacts, ResponseHeader, error)

GetSearchContactsByID retrieves a saved search (segment) by its ID.

func (*Client) GetSearchContactsList

func (c *Client) GetSearchContactsList(ctx context.Context, opts ...QueryOption) ([]SearchContacts, ResponseHeader, error)

GetSearchContactsList retrieves a single page of saved searches (segments). Use AllSearchContacts to iterate every page.

func (*Client) GetTagsList

func (c *Client) GetTagsList(ctx context.Context, opts ...QueryOption) ([]Tag, ResponseHeader, error)

GetTagsList retrieves a single page of tags. Use AllTags to iterate every page.

func (*Client) NewSearchContacts

func (c *Client) NewSearchContacts(ctx context.Context, conditions SearchContacts) (SearchContacts, error)

NewSearchContacts creates (saves) a new search-contacts segment.

func (*Client) ScheduleNewContactImport

func (c *Client) ScheduleNewContactImport(ctx context.Context, imp ScheduleImport) (Import, error)

ScheduleNewContactImport validates and submits a contact import. Each contact row must have exactly as many columns as FieldMapping, which must include an "email" field.

type Contact

type Contact struct {
	ContactID       string   `json:"contactId"`
	Name            string   `json:"name"`
	Origin          string   `json:"origin"`
	TimeZone        string   `json:"timeZone"`
	Activities      string   `json:"activities"`
	ChangedOn       string   `json:"changedOn"`
	CreatedOn       string   `json:"createdOn"`
	Campaign        Campaign `json:"campaign"`
	Email           string   `json:"email"`
	DayOfCycle      string   `json:"dayOfCycle"`
	Scoring         int      `json:"scoring"`
	EngagementScore int      `json:"engagementScore"`
	Href            string   `json:"href"`
	IpAddress       string   `json:"ipAddress"`
	Geolocation     struct {
		Latitude      string `json:"latitude"`
		Longitude     string `json:"longitude"`
		ContinentCode string `json:"continentCode"`
		CountryCode   string `json:"countryCode"`
		Region        string `json:"region"`
		PostalCode    string `json:"postalCode"`
		DmaCode       string `json:"dmaCode"`
		City          string `json:"city"`
	} `json:"geolocation,omitzero"`

	Tags              []Tag              `json:"tags,omitzero"`
	CustomFieldValues []CustomFieldValue `json:"customFieldValues,omitzero"`
}

Contact represents a GetResponse contact (subscriber).

type CrmCondition

type CrmCondition struct {
	ConditionType string `json:"conditionType"`
	PipelineScope string `json:"pipelineScope"`
	StageScope    string `json:"stageScope"`
}

CrmCondition represents a condition used for CRM conditions in GetResponse. This feature is Deprecated in GetResponse. It specifies the type of condition, the pipeline it applies to, and the stage within the pipeline.

Fields: - ConditionType: Specifies the type of condition. For this struct, it is always set to "crm". - PipelineScope: Identifies the pipeline to which the condition applies. - StageScope: Specifies the stage within the pipeline. It can be "all" to include all stages or a specific stage identifier.

func (*CrmCondition) GetType

func (c *CrmCondition) GetType() string

type CustomCondition

type CustomCondition struct {
	ConditionType        string `json:"conditionType"`
	OperatorType         string `json:"operatorType"`
	Operator             string `json:"operator"`
	Value                string `json:"value"`
	Scope                string `json:"scope"`
	NumberOfDays         int    `json:"numberOfDays,omitempty"`
	IncludeCurrentPeriod bool   `json:"includeCurrentPeriod,omitempty"`
}

CustomCondition represents a condition used for filtering or searching contacts with custom field values.

Fields:

  • ConditionType: Specifies the type of condition. Must be set to "custom".
  • OperatorType: Defines the type of operator to be used. Available options: "string_operator_list", "string_operator", "numeric_operator", "date_operator".
  • Operator: Specifies the operator based on the selected OperatorType:
  • For "string_operator" and "string_operator_list": "is", "is_not", "contains", "not_contains", "starts", "ends", "not_starts", "not_ends", "assigned", "not_assigned".
  • For "numeric_operator": "numeric_lt", "numeric_gt", "numeric_eq", "numeric_not_eq", "numeric_lt_eq", "numeric_gt_eq", "assigned", "not_assigned".
  • For "date_operator": "date_to", "date_from", "custom", "specific_date", "assigned", "not_assigned".
  • Value: Specifies the value based on the selected Operator and OperatorType:
  • Any string for "string_operator" and "string_operator_list".
  • Stringified number for "numeric_operator".
  • For "date_operator" with "specific_date": "today", "yesterday", "last_7_days", "last_30_days", "last_n_days", "this_week", "last_week", "this_month", "last_month", "last_2_months".
  • Date string formatted as yyyy-mm-dd for "date_operator" with "date_to" or "date_from".
  • ISO 8601 compliant date-time string for "date_operator" with "date_to" or "date_from".
  • ISO 8601 compliant date interval string (<start_date>/<end_date>) for "date_operator" with "custom".
  • Scope: Specifies the scope of the condition, typically a customFieldId.
  • NumberOfDays: Required only when "value" is set to "last_n_days". Represents the number of days for the condition.
  • IncludeCurrentPeriod: Determines if the current day is included in the chosen range. This flag is applicable when "value" is set to "last_n_days".

func (*CustomCondition) GetType

func (c *CustomCondition) GetType() string

type CustomEventCondition

type CustomEventCondition struct {
	ConditionType string `json:"conditionType"`  //must be set to "custom_event"
	CustomEventId string `json:"customEventId"`  //ID of the custom event
	Occurrence    string `json:"occurrence"`     //Any of "occurred" "not_occurred"
	DateOperator  string `json:"dateOperator"`   //Any of "today" "yesterday" "last_7_days" "last_30_days" "last_n_days" "this_week" "last_week" "this_month" "last_month" "last_2_months" "anytime" "date_to" "date_from" "custom"
	Date          string `json:"date,omitempty"` //Required and used only for date_to, date_from, and customDate. Can be either the date formatted as yyyy-mm-dd, ISO8601 datetime string, or a date interval string compliant with ISO 8601, supported format: <start_date>/<end_date>
}

CustomEventCondition represents the conditions for filtering contacts based on a custom event. It includes the type of condition, the custom event ID, the occurrence status, and date-related filters.

Fields:

  • ConditionType: Specifies the type of condition. Must be set to "custom_event".
  • CustomEventId: The ID of the custom event to filter by.
  • Occurrence: Indicates whether the event has "occurred" or "not_occurred".
  • DateOperator: Specifies the date filter operator. Possible values include: "today", "yesterday", "last_7_days", "last_30_days", "last_n_days", "this_week", "last_week", "this_month", "last_month", "last_2_months", "anytime", "date_to", "date_from", "custom".
  • Date: (Optional) Required only for "date_to", "date_from", and "custom" operators. Represents the date or date range in one of the following formats:
  • yyyy-mm-dd
  • ISO8601 datetime string
  • ISO 8601 date interval string in the format <start_date>/<end_date>.

func (*CustomEventCondition) GetType

func (c *CustomEventCondition) GetType() string

type CustomField

type CustomField struct {
	CustomFieldID string   `json:"customFieldId,omitzero"`
	Href          string   `json:"href,omitzero"`
	Name          string   `json:"name"`
	Type          string   `json:"type"`
	ValueType     string   `json:"valueType"`
	Format        string   `json:"format"`
	FieldType     string   `json:"fieldType"`
	Hidden        string   `json:"hidden"`
	Values        []string `json:"values,omitzero"`
}

CustomField represents a GetResponse custom field definition.

type CustomFieldValue

type CustomFieldValue struct {
	CustomFieldID string   `json:"customFieldId"`
	Name          string   `json:"name"`
	Value         []string `json:"value"`
	Values        []string `json:"values"`
	Type          string   `json:"type"`
	FieldType     string   `json:"fieldType"`
	ValueType     string   `json:"valueType"`
}

CustomFieldValue represents the value of a custom field on a contact.

type EcommerceAbandonedCartCondition

type EcommerceAbandonedCartCondition struct {
	ConditionType string `json:"conditionType"`
	ShopScope     string `json:"shopScope"`
	CartValue     struct {
		Currency string  `json:"currency"`
		Value    float64 `json:"value"`
		Operator string  `json:"operator"`
	} `json:"cartValue"`
	DateOperator         string `json:"dateOperator"`
	Value                string `json:"value,omitempty"`
	IncludeCurrentPeriod bool   `json:"includeCurrentPeriod,omitempty"`
	Range                string `json:"range,omitempty"`
}

EcommerceAbandonedCartCondition represents the condition for filtering contacts based on abandoned e-commerce carts in the GetResponse system.

Fields: - ConditionType: Specifies the type of condition. Must be set to "ecommerce_abandoned_cart". - ShopScope: Defines the scope of the shop. Can be "all" or a specific Shop ID. - CartValue: Contains details about the cart's value, including:

  • Currency: The currency code according to ISO4217 (e.g., USD, GBP, EUR, PLN).
  • Value: The numeric value of the cart.
  • Operator: The comparison operator for the cart value. Possible values are: "numeric_lt", "numeric_gt", "numeric_eq", "numeric_not_eq", "numeric_lt_eq", "numeric_gt_eq".
  • DateOperator: Specifies the date condition. Possible values include: "date_from", "anytime", "never", "today", "yesterday", "last_n_days", "this_week", "last_week", "this_month", "last_month", "custom".
  • Value: Required for "date_from" and "last_n_days". For "date_from", it should be a date formatted in ISO8601. For "last_n_days", it should be a stringified number.
  • IncludeCurrentPeriod: Indicates whether to include the current period. Required only for "last_n_days".
  • Range: Allowed only for "custom". Specifies a date interval string compliant with ISO8601, formatted as <start_date>/<end_date>.

func (*EcommerceAbandonedCartCondition) GetType

type EcommerceBrandPurchasedCondition

type EcommerceBrandPurchasedCondition struct {
	ConditionType string `json:"conditionType"` //Must be set to "ecommerce_brand_purchased"
	Scope         string `json:"scope"`         //The ID of the shop
	OperatorType  string `json:"operatorType"`  //Must be set to "equal_operator"
	Operator      string `json:"operator"`      //Any of "is" "not_is"
	Value         string `json:"value"`         //The brand
}

EcommerceBrandPurchasedCondition represents a condition used to filter contacts based on their purchase history of a specific brand in an e-commerce shop.

Fields: - ConditionType: Specifies the type of condition. Must be set to "ecommerce_brand_purchased". - Scope: The ID of the shop where the purchase was made. - OperatorType: Specifies the type of operator. Must be set to "equal_operator". - Operator: Defines the comparison operator. Can be "is" or "not_is". - Value: The brand name used for the condition.

func (*EcommerceBrandPurchasedCondition) GetType

type EcommerceNumberOfPurchasesCondition

type EcommerceNumberOfPurchasesCondition struct {
	ConditionType string `json:"conditionType"`
	OperatorType  string `json:"operatorType"`
	Operator      string `json:"operator"`
	Value         int    `json:"value"`
	Scope         string `json:"scope"`
	Date          struct {
		Operator             string `json:"operator"`
		NumberOfDays         int    `json:"numberOfDays,omitempty"`
		IncludeCurrentPeriod bool   `json:"includeCurrentPeriod"`
		Range                string `json:"range"`
	} `json:"date"`
}

EcommerceNumberOfPurchasesCondition represents a condition used to filter contacts based on the number of purchases in an e-commerce context.

Fields:

  • ConditionType: Specifies the type of condition. Must be set to "ecommerce_number_of_purchases".
  • OperatorType: Specifies the type of operator. Must be set to "numeric_operator".
  • Operator: Specifies the comparison operator. Can be one of the following: "numeric_lt", "numeric_gt", "numeric_eq", "numeric_not_eq", "numeric_lt_eq", "numeric_gt_eq".
  • Value: Specifies the number of purchases to compare against.
  • Scope: Specifies the scope of the condition. Can be "all" or a specific shop ID.
  • Date: Specifies the date range for the condition. Includes the following fields:
  • Operator: Specifies the date operator. Can be one of the following: "anytime", "today", "yesterday", "last_n_days", "this_week", "last_week", "this_month", "last_month", "last_2_months", "custom".
  • NumberOfDays: Required for "last_n_days", specifies the number of days.
  • IncludeCurrentPeriod: Determines if the current day is included in the range (required for the "last_n_days" operator).
  • Range: Specifies a custom date range in ISO8601 interval format (<start_date>/<end_date>), allowed only for the "custom" operator.

func (*EcommerceNumberOfPurchasesCondition) GetType

type EcommerceProductPurchasedCondition

type EcommerceProductPurchasedCondition struct {
	ConditionType        string `json:"conditionType"`
	ShopScope            string `json:"shopScope"`
	CategoryScope        string `json:"categoryScope"`
	OperatorType         string `json:"operatorType"`
	Operator             string `json:"operator"`
	ProductScope         string `json:"productScope"`
	DateOperator         string `json:"dateOperator"`
	Value                string `json:"value,omitempty"`
	NumberOfDays         int    `json:"numberOfDays,omitempty"`
	IncludeCurrentPeriod bool   `json:"includeCurrentPeriod,omitempty"`
}

EcommerceProductPurchasedCondition represents the condition for filtering contacts based on their ecommerce product purchase history. This structure is used to define the criteria for searching contacts who have purchased specific products within a given scope, category, or date range.

Fields:

  • ConditionType: Specifies the type of condition. Must be set to "ecommerce_product_purchased".
  • ShopScope: Defines the shop scope. Can be "all" or a specific Shop ID.
  • CategoryScope: Defines the category scope. Can be "all" or a specific Category ID.
  • OperatorType: Specifies the operator type. Must be set to "equal_operator".
  • Operator: Defines the operator for the condition. Allowed values are "is" or "is_not".
  • ProductScope: Specifies the product scope. Can be "all" or a specific Product ID.
  • DateOperator: Defines the date range operator. Allowed values include: "today", "yesterday", "last_7_days", "last_30_days", "last_n_days", "this_week", "last_week", "this_month", "last_month", "last_2_months", "all_time", "date_to", "date_from", or "custom".
  • Value: Required for "date_to", "date_from", or "custom" date operators. For "date_to" and "date_from", it should be a date formatted as "yyyy-mm-dd". For "custom", it should be an ISO8601-compliant date interval string in the "<start_date>/<end_date>" format.
  • NumberOfDays: Required for the "last_n_days" operator. Specifies the number of days for the date range.
  • IncludeCurrentPeriod: A flag that determines if the current day is included in the chosen date range. This flag is required for the "last_n_days" date operator and can also be used with "last_7_days" and "last_30_days" date operators.

func (*EcommerceProductPurchasedCondition) GetType

type EcommerceTotalSpentCondition

type EcommerceTotalSpentCondition struct {
	ConditionType string  `json:"conditionType"`
	OperatorType  string  `json:"operatorType"`
	Operator      string  `json:"operator"`
	Scope         string  `json:"scope"`
	Value         float64 `json:"value"`
	Currency      string  `json:"currency"`
	Date          struct {
		Operator             string `json:"operator"`
		NumberOfDays         int    `json:"numberOfDays,omitempty"`
		IncludeCurrentPeriod bool   `json:"includeCurrentPeriod"`
		Range                string `json:"range"`
	} `json:"date"`
}

EcommerceTotalSpentCondition represents a condition used to filter contacts based on their total spending in an e-commerce context. This structure includes details about the condition type, operator, scope, value, currency, and an optional date range.

Fields:

  • ConditionType: Specifies the type of condition. Must be set to "ecommerce_total_spent".
  • OperatorType: Specifies the type of operator. Must be set to "numeric_operator".
  • Operator: Defines the comparison operator. Can be one of the following: "numeric_lt" (less than), "numeric_gt" (greater than), "numeric_eq" (equal to), "numeric_not_eq" (not equal to), "numeric_lt_eq" (less than or equal to), "numeric_gt_eq" (greater than or equal to).
  • Scope: Specifies the scope of the condition. Can be "all" or a specific Shop ID.
  • Value: The total spending value to compare against.
  • Currency: The currency code for the spending value, following the ISO4217 standard (e.g., USD, GBP, EUR, PLN).
  • Date: A nested structure that defines the date range for the condition. Includes:
  • Operator: Specifies the date operator. Can be one of the following: "anytime", "today", "yesterday", "last_n_days", "this_week", "last_week", "this_month", "last_month", "last_2_months", or "custom".
  • NumberOfDays: Required for the "last_n_days" operator. Specifies the number of days.
  • IncludeCurrentPeriod: Determines whether the current day is included in the range. Required for the "last_n_days" operator.
  • Range: Specifies a custom date range in ISO8601 format (<start_date>/<end_date>). Allowed only for the "custom" operator.

func (*EcommerceTotalSpentCondition) GetType

func (e *EcommerceTotalSpentCondition) GetType() string

type EmailCondition

type EmailCondition struct {
	ConditionType string `json:"conditionType"`
	OperatorType  string `json:"operatorType"`
	Operator      string `json:"operator"`
	Value         string `json:"value"`
}

EmailCondition represents a condition used for filtering or searching contacts based on their email field in GetResponse.

Fields:

  • ConditionType: Specifies the type of condition. This should always be set to "email".
  • OperatorType: Specifies the type of operator. This should always be set to "string_operator".
  • Operator: Defines the comparison operation to be performed. Available options include: "is", "is_not", "contains", "not_contains", "starts", "ends", "not_starts", "not_ends".
  • Value: The value to be used in the comparison operation.

func (*EmailCondition) GetType

func (e *EmailCondition) GetType() string

type EngagementScoreCondition

type EngagementScoreCondition struct {
	ConditionType string `json:"conditionType"`
	Operator      string `json:"operator"`
	Value         int    `json:"value"`
}

Engagement score EngagementScoreCondition represents a condition used to filter contacts based on their engagement score. The engagement score is a numeric value between 1 and 5, and the condition specifies how to compare this value.

Fields:

  • ConditionType: Specifies the type of condition. Must always be set to "engagement_score".
  • Operator: Defines the comparison operator to use. Possible values are: "numeric_lt" (less than), "numeric_gt" (greater than), "numeric_eq" (equal to), "numeric_not_eq" (not equal to), "numeric_lt_eq" (less than or equal to), "numeric_gt_eq" (greater than or equal to).
  • Value: The numeric value (1 to 5) to compare against, represented as an integer.

func (*EngagementScoreCondition) GetType

func (e *EngagementScoreCondition) GetType() string

type Environment

type Environment string

Environment identifies which GetResponse API host a client talks to.

The underlying string values match the short codes historically used by callers ("SMB", "PL", "US"), so values persisted elsewhere map cleanly via ParseEnvironment.

const (
	// EnvSMB is the standard GetResponse (self-service) API.
	EnvSMB Environment = "SMB"
	// EnvMaxEU is the GetResponse MAX (360) EU API.
	EnvMaxEU Environment = "PL"
	// EnvMaxUS is the GetResponse MAX (360) US API.
	EnvMaxUS Environment = "US"
)

func ParseEnvironment

func ParseEnvironment(s string) (Environment, error)

ParseEnvironment converts a short code ("SMB", "PL", "US", case-insensitive) into an Environment. Unlike the legacy behaviour it does not silently fall back to SMB: an unknown code returns an error.

type FromField

type FromField struct {
	FromFieldID    string `json:"fromFieldId"`
	Href           string `json:"href"`
	Email          string `json:"email,omitzero"`
	RewrittenEmail string `json:"rewrittenEmail,omitzero"`
	Name           string `json:"name,omitzero"`
	IsActive       string `json:"isActive,omitzero"`
	IsDefault      string `json:"isDefault,omitzero"`
	CreatedOn      string `json:"createdOn,omitzero"`
	Domain         struct {
		Status      string `json:"status"`
		DKIMWarning string `json:"DKIMWarning"`
	} `json:"domain,omitzero"`
}

FromField represents a "from" (sender) address configured on an account.

type GDPRCondition

type GDPRCondition struct {
	ConditionType string `json:"conditionType"`
	ConsentStatus string `json:"consentStatus"`
	ConsentDate   struct {
		Operator string `json:"operator"`
		Date     string `json:"date,omitempty"`
	} `json:"consentDate,omitempty"`
}

GDPRCondition represents the conditions for marketing consent, indicating whether an individual has provided consent or not. It includes the type of condition, the consent status, and optional details about the consent date. This structure is used to define and query consent-related information in compliance with GDPR regulations. GDPRCondition represents the conditions related to marketing consent, specifically whether consent has been given or not, and optionally the date associated with the consent status.

Fields:

  • ConditionType: Specifies the type of condition. Must always be set to "gdpr".
  • ConsentStatus: Indicates the consent status. Can be one of the following: "given" or "not_given".
  • ConsentDate: An optional nested structure that defines the date-related conditions for the consent status. If omitted, the default operator is "anytime".
  • Operator: Specifies the date operator. Can be one of "anytime", "date_from", or "date_to".
  • Date: The specific date in "Y-m-d" format. This field is required when the operator is "date_from" or "date_to", and prohibited when the operator is "anytime".

func (*GDPRCondition) GetType

func (g *GDPRCondition) GetType() string

type GenericCondition

type GenericCondition map[string]any //fallback

Generic fallback condition for unsupported types. Please report if this case occurs.

func (*GenericCondition) GetType

func (g *GenericCondition) GetType() string

type GeoCondition

type GeoCondition struct {
	ConditionType string `json:"conditionType"`
	Scope         string `json:"scope"`
	Operator      string `json:"operator"`
	OperatorType  string `json:"operatorType"`
	Value         string `json:"value"`
}

GeoCondition represents a condition used for geographic-based searches. It specifies the type of condition, the scope of the geographic attribute, the operator to apply, the type of operator, and the value to search for.

Fields:

  • ConditionType: Specifies the type of condition. Must be set to "geo".
  • Scope: Defines the geographic attribute to search. Possible values include: "country", "country_code", "region", "city", "longitude", "latitude", "postal_code", "dma_code".
  • Operator: Specifies the comparison operator to use. Possible values include: "is", "is_not", "contains", "not_contains", "starts", "ends", "not_starts", "not_ends".
  • OperatorType: Specifies the type of operator. Must be set to "string_operator".
  • Value: The value to search for within the specified scope.

func (*GeoCondition) GetType

func (g *GeoCondition) GetType() string

type GoalCondition

type GoalCondition struct {
	ConditionType string `json:"conditionType"`
	OperatorType  string `json:"operatorType"`
	Operator      string `json:"operator"`
	Value         int    `json:"value,omitempty"`
	Scope         string `json:"scope"`
}

GoalCondition represents a condition for Goals in GetResponse. It defines the type of condition, the operator to be applied, the value for comparison, and the scope (goal ID) to which the condition applies.

Fields:

  • ConditionType: Specifies the type of condition. Must be set to "goal".
  • OperatorType: Specifies the type of operator. Must be set to "numeric_operator".
  • Operator: Defines the comparison operator. Can be one of the following: "numeric_lt", "numeric_gt", "numeric_eq", "numeric_not_eq", "numeric_lt_eq", "numeric_gt_eq", "assigned", "not_assigned".
  • Value: The value to be compared for the specified relation. This field is optional and will be omitted if not set.
  • Scope: Specifies the goal ID to which this condition applies.

func (*GoalCondition) GetType

func (g *GoalCondition) GetType() string

type Import

type Import struct {
	ImportID   string   `json:"importId"`
	Campaign   Campaign `json:"campaign"`
	Status     string   `json:"status"`
	Statistics struct {
		Uploaded    int `json:"uploaded"`
		Invalid     int `json:"invalid"`
		Updated     int `json:"updated"`
		AddedToList int `json:"addedToList"`
	} `json:"statistics"`
	ErrorStatistics struct {
		SyntaxErrors       int `json:"syntaxErrors"`
		AleradyInQueue     int `json:"alreadyInQueue"`
		InvalidDomains     int `json:"invalidDomains"`
		Blacklist          int `json:"blacklist"`
		PolicyFailures     int `json:"policyFailures"`
		MismatchedCriteria int `json:"mismatchedCriteria"`
	} `json:"errorStatistics"`

	CreatedOn  string `json:"createdOn"`
	FinishedOn string `json:"finishedOn"`
	Href       string `json:"href"`
}

Import represents the state and statistics of an import operation.

type LastClickDateCondition

type LastClickDateCondition struct {
	ConditionType string `json:"conditionType"`
	Operator      string `json:"operator"`
	OperatorType  string `json:"operatorType"`
	Value         int    `json:"value"`
}

LastClickDateCondition represents a condition used to filter contacts based on the last send date.

Fields: - ConditionType: Specifies the type of condition. Must be set to "last_click_date". - Operator: Defines the operator to use. Possible values are:

  • "date_to": Filter contacts with a last send date up to a specific date.
  • "date_from": Filter contacts with a last send date starting from a specific date.
  • "specific_date": Filter contacts based on predefined date ranges such as "today", "yesterday", etc.
  • "custom": Filter contacts using a custom time interval in ISO8601 format.
  • OperatorType: Specifies the type of operator. Must be set to "date_operator".
  • Value: The value associated with the operator. For "date_to" or "date_from", this should be a stringified date in ISO8601 format. For "custom", this should be a stringified time interval in ISO8601 format. For "specific_date", this can be one of the following: "today", "yesterday", "last_7_days", "last_30_days", "last_n_days", "this_week", "last_week", "this_month", "last_month", "last_2_months".

func (*LastClickDateCondition) GetType

func (l *LastClickDateCondition) GetType() string

type LastOpenDateCondition

type LastOpenDateCondition struct {
	ConditionType string `json:"conditionType"`
	Operator      string `json:"operator"`
	OperatorType  string `json:"operatorType"`
	Value         int    `json:"value"`
}

LastOpenDateCondition represents a condition used to filter contacts based on the last send date.

Fields: - ConditionType: Specifies the type of condition. Must be set to "last_open_date". - Operator: Defines the operator to use. Possible values are:

  • "date_to": Filter contacts with a last send date up to a specific date.
  • "date_from": Filter contacts with a last send date starting from a specific date.
  • "specific_date": Filter contacts based on predefined date ranges such as "today", "yesterday", etc.
  • "custom": Filter contacts using a custom time interval in ISO8601 format.
  • OperatorType: Specifies the type of operator. Must be set to "date_operator".
  • Value: The value associated with the operator. For "date_to" or "date_from", this should be a stringified date in ISO8601 format. For "custom", this should be a stringified time interval in ISO8601 format. For "specific_date", this can be one of the following: "today", "yesterday", "last_7_days", "last_30_days", "last_n_days", "this_week", "last_week", "this_month", "last_month", "last_2_months".

func (*LastOpenDateCondition) GetType

func (l *LastOpenDateCondition) GetType() string

type LastSendDateCondition

type LastSendDateCondition struct {
	ConditionType string `json:"conditionType"`
	Operator      string `json:"operator"`
	OperatorType  string `json:"operatorType"`
	Value         string `json:"value"`
}

LastSendDateCondition represents a condition used to filter contacts based on the last send date.

Fields: - ConditionType: Specifies the type of condition. Must be set to "last_send_date". - Operator: Defines the operator to use. Possible values are:

  • "date_to": Filter contacts with a last send date up to a specific date.
  • "date_from": Filter contacts with a last send date starting from a specific date.
  • "specific_date": Filter contacts based on predefined date ranges such as "today", "yesterday", etc.
  • "custom": Filter contacts using a custom time interval in ISO8601 format.
  • OperatorType: Specifies the type of operator. Must be set to "date_operator".
  • Value: The value associated with the operator. For "date_to" or "date_from", this should be a stringified date in ISO8601 format. For "custom", this should be a stringified time interval in ISO8601 format. For "specific_date", this can be one of the following: "today", "yesterday", "last_7_days", "last_30_days", "last_n_days", "this_week", "last_week", "this_month", "last_month", "last_2_months".

func (*LastSendDateCondition) GetType

func (l *LastSendDateCondition) GetType() string

type NameCondition

type NameCondition struct {
	ConditionType string `json:"conditionType"`
	OperatorType  string `json:"operatorType"`
	Operator      string `json:"operator"`
	Value         string `json:"value"`
}

NameCondition represents a condition used for filtering or searching contacts based on their name field in GetResponse.

Fields:

  • ConditionType: Specifies the type of condition. This should always be set to "name".
  • OperatorType: Specifies the type of operator. This should always be set to "string_operator".
  • Operator: Defines the comparison operation to be performed. Available options include: "is", "is_not", "contains", "not_contains", "starts", "ends", "not_starts", "not_ends".
  • Value: The value to be used in the comparison operation.

func (*NameCondition) GetType

func (n *NameCondition) GetType() string

type NotClickedCondition

type NotClickedCondition struct {
	ConditionType        string `json:"conditionType"`
	Scope                string `json:"scope,omitempty"`
	Operator             string `json:"operator"`
	OperatorType         string `json:"operatorType"`
	ClickTrackId         string `json:"clickTrackId"`
	Value                string `json:"value,omitempty"`
	DateOperator         string `json:"dateOperator"`
	IncludeCurrentPeriod bool   `json:"includeCurrentPeriod"`
}

NotClickedCondition represents the conditions for filtering contacts who have not clicked on a specific message or link within a given time frame. This struct is used to define the parameters for such a condition in the GetResponse API.

Fields:

  • ConditionType: Specifies the type of condition. Must be set to "not_clicked".
  • Scope: The ID of the message. Must be left empty when using the "all" operator.
  • Operator: Defines the type of message to filter by. Can be one of the following: "all", "autoresponder", "newsletter", "splittest", or "automation".
  • OperatorType: Specifies the operator type. Must be set to "complex_message_operator".
  • ClickTrackId: Indicates the link to track. Can be "all" or the clicktrack ID of the message link.
  • Value: Required only for specific date-based operators. For "date_from", it should be a stringified date in ISO8601 format. For "last_n_days", it should be a stringified number.
  • DateOperator: Specifies the date-based operator. Can be one of the following: "date_from", "never", "today", "yesterday", "last_7_days", "last_30_days", "last_n_days", "this_week", or "this_month".
  • IncludeCurrentPeriod: A flag that determines whether the current day is included in the chosen date range. This flag is applicable for "last_7_days", "last_30_days", and "last_n_days".

func (*NotClickedCondition) GetType

func (n *NotClickedCondition) GetType() string

type NotOpenedCondition

type NotOpenedCondition struct {
	ConditionType        string `json:"conditionType"`
	Operator             string `json:"operator"`
	Scope                string `json:"scope,omitempty"`
	DateOperator         string `json:"dateOperator"`
	Value                string `json:"value,omitempty"`
	IncludeCurrentPeriod bool   `json:"includeCurrentPeriod,omitempty"`
}

NotOpenedCondition represents a condition used to filter contacts who have not opened specific types of messages within a given time frame. This struct is used to define the parameters for such a condition.

Fields:

  • ConditionType: Specifies the type of condition. Must be set to "not_opened".
  • Operator: Defines the type of messages to filter. Available options are: "all", "autoresponder", "newsletter", "splittest", "automation".
  • Scope: Specifies the scope of the condition. This field is optional and not required when "all" is selected.
  • DateOperator: Determines the date range for the condition. Available options include: "date_from", "never", "today", "yesterday", "last_7_days", "last_30_days", "last_n_days", "this_week", "this_month".
  • Value: Provides additional information for certain DateOperator values. Required for "date_from" (ISO8601 date format) and "last_n_days" (stringified number).
  • IncludeCurrentPeriod: A flag indicating whether the current day should be included in the selected date range. This flag is applicable for "last_7_days", "last_30_days", and "last_n_days".

func (*NotOpenedCondition) GetType

func (n *NotOpenedCondition) GetType() string

type NotSentCondition

type NotSentCondition struct {
	ConditionType string `json:"conditionType"`
	Value         string `json:"value"`
	Operator      string `json:"operator"`
	OperatorType  string `json:"operatorType"`
}

Not sent NotSentCondition represents a condition used to filter contacts who have not been sent a specific message. It is used in search queries to identify contacts based on message sending criteria.

Fields: - ConditionType: Specifies the type of condition. Must be set to "not_sent". - Value: The ID of the message that has not been sent. - Operator: Defines the type of message. Can be one of "autoresponder", "newsletter", "splittest", or "automation". - OperatorType: Specifies the operator type. Must be set to "message_operator".

func (*NotSentCondition) GetType

func (n *NotSentCondition) GetType() string

type OpenedCondition

type OpenedCondition struct {
	ConditionType string `json:"conditionType"`
	OperatorType  string `json:"operatorType"`
	Operator      string `json:"operator"`
	Value         string `json:"value"`
}

OpenedCondition represents a condition used to filter contacts based on whether they have opened a specific type of message. It includes the type of condition, the operator type, the operator, and the ID of the selected resource.

Fields:

  • ConditionType: Specifies the type of condition. For this struct, it should always be set to "opened".
  • OperatorType: Specifies the type of operator. For this struct, it should always be set to "message_operator".
  • Operator: Defines the type of message to filter by. Available options are "autoresponder", "newsletter", "splittest", and "automation".
  • Value: The ID of the selected resource (e.g., the specific message or campaign being referenced).

func (*OpenedCondition) GetType

func (o *OpenedCondition) GetType() string

type Option

type Option func(*Client)

Option configures a Client in New.

func WithEndpoint

func WithEndpoint(raw string) Option

WithEndpoint overrides the base API URL derived from the environment. The URL must end with a trailing slash. Primarily useful for testing against a mock server.

func WithHTTPClient

func WithHTTPClient(hc *http.Client) Option

WithHTTPClient supplies a custom *http.Client (for custom transports, proxies, or instrumentation).

func WithMailingDomain

func WithMailingDomain(domain string) Option

WithMailingDomain sets the X-Domain header, required for GetResponse MAX (360) accounts.

func WithTimeout

func WithTimeout(d time.Duration) Option

WithTimeout sets the timeout on the default HTTP client. It has no effect if a custom client is supplied via WithHTTPClient.

func WithUserAgent

func WithUserAgent(ua string) Option

WithUserAgent overrides the default User-Agent header.

type PhaseCondition

type PhaseCondition struct {
	ConditionType string `json:"conditionType"`
	OperatorType  string `json:"operatorType"`
	Operator      string `json:"operator"`
	Value         int    `json:"value,omitempty"`
}

PhaseCondition represents a condition used for filtering or querying based on a specific autoresponder day. It includes the type of condition, the operator type, the operator itself, and an optional value.

Fields:

  • ConditionType: Specifies the type of condition. For this struct, it should be set to "phase".
  • OperatorType: Specifies the type of operator. For this struct, it should be set to "numeric_operator".
  • Operator: Defines the comparison operator to use. Available options are: "numeric_lt", "numeric_gt", "numeric_eq", "numeric_not_eq", "numeric_lt_eq", "numeric_gt_eq", "assigned", and "not_assigned".
  • Value: Represents the value to compare against. This field is optional and should not be included when using the "assigned" or "not_assigned" operators.

func (*PhaseCondition) GetType

func (p *PhaseCondition) GetType() string

type QueryOption

type QueryOption func(url.Values)

QueryOption customizes the query string of a list request.

func WithFields

func WithFields(fields string) QueryOption

WithFields sets the "fields" parameter, limiting the fields returned by the API (e.g. "name,email").

func WithName

func WithName(name string) QueryOption

WithName sets the "query[name]" filter parameter.

func WithPage

func WithPage(page int) QueryOption

WithPage sets the "page" query parameter.

func WithPerPage

func WithPerPage(perPage int) QueryOption

WithPerPage sets the "perPage" query parameter.

type ResponseHeader

type ResponseHeader struct {
	ContentEncoding       string
	ContentSecurityPolicy string
	ContentType           string
	Date                  string
	TotalCount            int
	CurrentPage           int
	TotalPages            int
	RateLimit             int
	RateLimitRemaining    int
	UniqueID              string
}

ResponseHeader holds metadata parsed from a GetResponse API response, including pagination counters and rate-limit information.

Numeric fields are best-effort: endpoints that do not return a given header (for example single-resource or POST endpoints omit pagination counters) leave the corresponding field at its zero value rather than erroring.

type ScheduleImport

type ScheduleImport struct {
	CampaignID   string     `json:"campaignId"`
	FieldMapping []string   `json:"fieldMapping"`
	Contacts     [][]string `json:"contacts"`
}

ScheduleImport describes a batch of contacts to import into a campaign.

FieldMapping names the column for each position in every Contacts row and must include "email". See https://www.getresponse.com/help/how-do-i-prepare-a-file-for-import.html

type ScoreCondition

type ScoreCondition struct {
	ConditionType string `json:"conditionType"`
	OperatorType  string `json:"operatorType"`
	Operator      string `json:"operator,omitempty"`
	Value         int    `json:"value"`
}

ScoreCondition represents a condition used for filtering or searching contacts based on their score. It includes the type of condition, the operator type, the specific operator (if applicable), and the score value.

Fields:

  • ConditionType: Specifies the type of condition. Must always be set to "score".
  • OperatorType: Defines the type of operator to be used. Can be one of: "numeric_operator" or "not_exists".
  • Operator: Specifies the numeric comparison operator. This field is optional and only required when OperatorType is "numeric_operator". Possible values include:
  • "numeric_lt": Less than
  • "numeric_gt": Greater than
  • "numeric_eq": Equal to
  • "numeric_not_eq": Not equal to
  • "numeric_lt_eq": Less than or equal to
  • "numeric_gt_eq": Greater than or equal to
  • Value: The score value to compare against

func (*ScoreCondition) GetType

func (s *ScoreCondition) GetType() string

type SearchContacts

type SearchContacts struct {
	SubscribersType      []string                `json:"subscribersType"`
	SectionLogicOperator string                  `json:"sectionLogicOperator"`
	Section              []SearchContactsSection `json:"section"`
	SearchContactId      string                  `json:"searchContactId,omitempty"`
	Name                 string                  `json:"name,omitempty"`
	CreatedOn            string                  `json:"createdOn,omitempty"`
	Href                 string                  `json:"href,omitempty"`
}

SearchContacts describes the criteria for a contact search or a saved segment.

Name is required when creating a segment with NewSearchContacts but optional when searching ad hoc with GetContactsFromSearchContactsConditions.

type SearchContactsCondition

type SearchContactsCondition interface {
	GetType() string
}

type SearchContactsSection

type SearchContactsSection struct {
	CampaignIdsList  []string `json:"campaignIdsList"`
	LogicOperator    string   `json:"logicOperator"`
	SubscriberCycle  []string `json:"subscriberCycle"`
	SubscriptionDate string   `json:"subscriptionDate"`
	Conditions       []any    `json:"conditions"`
}

SearchContactsSection is one section of search criteria combined via the parent's SectionLogicOperator.

type SentCondition

type SentCondition struct {
	ConditionType string `json:"conditionType"`
	Value         string `json:"value"`
	Operator      string `json:"operator"`
	OperatorType  string `json:"operatorType"`
}

SentCondition represents a condition used to filter contacts based on messages sent to them. It includes the type of condition, the message ID, the operator specifying the type of message, and the operator type which must be set to "message_operator".

Fields:

  • ConditionType: Specifies the type of condition. Must be set to "sent".
  • Value: The ID of the message used in the condition.
  • Operator: Specifies the type of message. Can be one of "autoresponder", "newsletter", "splittest", or "automation".
  • OperatorType: Specifies the operator type. Must be set to "message_operator".

func (*SentCondition) GetType

func (s *SentCondition) GetType() string

type SmsLinkClickedCondition

type SmsLinkClickedCondition struct {
	ConditionType string `json:"conditionType"`
	SMSID         string `json:"smsId"`
	ClickTrackID  string `json:"clickTrackId"` //ID of the SMS click track
}

SmsLinkClickedCondition represents a condition used to filter contacts based on whether they clicked a link in an SMS message.

Fields: - ConditionType: Specifies the type of condition. Must always be set to "sms_link_clicked". - SMSID: The unique identifier of the SMS message. - ClickTrackID: The unique identifier of the SMS click track.

func (*SmsLinkClickedCondition) GetType

func (s *SmsLinkClickedCondition) GetType() string

type SmsLinkNotClickedCondition

type SmsLinkNotClickedCondition struct {
	ConditionType string `json:"conditionType"`
	SMSID         string `json:"smsId"`
	ClickTrackID  string `json:"clickTrackId"`
}

SmsLinkClickedCondition represents a condition used to filter contacts based on whether they have not clicked a link in an SMS message.

Fields: - ConditionType: Specifies the type of condition. Must always be set to "sms_link_not_clicked". - SMSID: The unique identifier of the SMS message. - ClickTrackID: The unique identifier of the SMS click track.

type SmsSentCondition

type SmsSentCondition struct {
	ConditionType  string `json:"conditionType"`            //Must be sent to "sms_sent"
	SMSID          string `json:"smsId"`                    //ID of the SMS
	DeliveryStatus string `json:"deliveryStatus,omitempty"` //Any of "delivered" "undelivered" "any". Omit this field if the  delvivery status is not relevant.
}

SmsSentCondition represents the condition for filtering contacts based on SMS sending criteria. It includes the type of condition, the SMS ID, and optionally the delivery status.

Fields:

  • ConditionType: Specifies the type of condition. Must be set to "sms_sent".
  • SMSID: The unique identifier of the SMS.
  • DeliveryStatus: (Optional) Specifies the delivery status of the SMS. Can be one of "delivered", "undelivered", or "any". Omit this field if the delivery status is not relevant.

func (*SmsSentCondition) GetType

func (s *SmsSentCondition) GetType() string

type SubscriptionDateCondition

type SubscriptionDateCondition struct {
	ConditionType string `json:"conditionType"`
	OperatorType  string `json:"operatorType"`
	Operator      string `json:"operator"`
	Value         string `json:"value"`
}

SubscriptionDateCondition represents a condition used to filter contacts based on their subscription date.

Fields: - ConditionType: Specifies the type of condition. For this struct, it should always be set to "subscription_date". - OperatorType: Specifies the type of operator. For this struct, it should always be set to "date_operator". - Operator: Defines the comparison operator to use. Available options include:

  • "date_to": Matches dates up to a specific date.
  • "date_from": Matches dates starting from a specific date.
  • "specific_date": Matches a specific date.
  • "custom": Allows custom date ranges.

- Value: Specifies the value to compare against. Supported formats include:

  • A date string in the format yyyy-mm-dd.
  • A datetime string formatted in ISO 8601.
  • A date interval string compliant with ISO 8601 in the format <start_date>/<end_date>.
  • Predefined date ranges such as:
  • "today"
  • "yesterday"
  • "last_7_days"
  • "last_30_days"
  • "last_n_days"
  • "this_week"
  • "last_week"
  • "this_month"
  • "last_month"
  • "last_2_months"

func (*SubscriptionDateCondition) GetType

func (s *SubscriptionDateCondition) GetType() string

type SubscriptionMethodCondition

type SubscriptionMethodCondition struct {
	ConditionType string `json:"conditionType"`
	Method        string `json:"method"`
	WebformType   string `json:"webformType,omitempty"`
	Value         string `json:"value"`
}

SubscriptionMethodCondition represents the conditions for filtering contacts based on their subscription method in the GetResponse system.

Fields:

  • ConditionType: Specifies the type of condition. Should always be set to "subscription_method".
  • Method: Indicates the subscription method. Available options include: "webform", "import", "landing_page", "api", "email", "panel", "mobile", "survey", "sales", "copy", "leads", "webinar", "chat", "website_builder_elegant", "course", "premium_newsletter".
  • WebformType: Specifies the type of webform when the method is "webform" or "webformsv2". Available options are "all", "webforms", "webformsv2", "popups". This field is optional and only required for webform-related methods.
  • Value: Provides additional context or identifier for the subscription method. This field is required for certain methods such as "import", "landing_page", "webinar", and "website_builder_elegant". For example:
  • If the method is "webform", the value corresponds to the webform, webformv2, or popup identifiers.
  • If the method is "import", the value corresponds to the import identifier or "all" for all imports.
  • If the method is "landing_page", the value corresponds to the landing page identifier or "all" for all landing pages.
  • If the method is "webinar", the value corresponds to the webinar identifier or "all" for all webinars.
  • If the method is "website_builder_elegant", the value corresponds to the website UUID or "all" for all websites.

func (*SubscriptionMethodCondition) GetType

func (s *SubscriptionMethodCondition) GetType() string

type Tag

type Tag struct {
	TagID     string `json:"tagId,omitzero"`
	CreatedAt string `json:"createdAt,omitzero"`
	Name      string `json:"name"`
	Color     string `json:"color,omitzero"`
}

Tag represents a GetResponse tag.

type TagCondition

type TagCondition struct {
	ConditionType string `json:"conditionType"` // set to "tag"
	OperatorType  string `json:"operatorType"`  // set to "exists"
	Operator      string `json:"operator"`      // available values: "exists", "not_exists"
	Value         string `json:"value"`         // tagId
}

Tag TagCondition represents a condition used to filter contacts based on tags in the GetResponse API. It specifies the type of condition, the operator to apply, and the value (tag ID) to match.

Fields:

  • ConditionType: Specifies the type of condition. Must be set to "tag".
  • OperatorType: Specifies the type of operator. Must be set to "exists".
  • Operator: Defines the operation to perform. Available values are "exists" (to check if the tag exists) and "not_exists" (to check if the tag does not exist).
  • Value: The ID of the tag to be used in the condition.

func (*TagCondition) GetType

func (t *TagCondition) GetType() string

type WebinarCondition

type WebinarCondition struct {
	ConditionType    string `json:"conditionType"`
	Scope            string `json:"scope"`
	ContactType      string `json:"contactType"`
	WebinarCondition string `json:"webinarCondition"`
}

WebinarCondition represents the conditions for filtering contacts based on their participation in a webinar. It includes the type of condition, the scope of the webinar, the type of contact, and the specific webinar condition.

Fields:

  • ConditionType: Specifies the type of condition. Must be set to "webinar".
  • Scope: Represents the Webinar ID to which the condition applies.
  • ContactType: Specifies the type of contact. Possible values are "host", "listener", "presenter", "registrant", or "all".
  • WebinarCondition: Defines the participation condition for the webinar. Possible values are "participated" or "not_participated".

func (*WebinarCondition) GetType

func (w *WebinarCondition) GetType() string

Jump to

Keyboard shortcuts

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