sendpulse_sdk_go

package module
v6.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: MIT Imports: 17 Imported by: 0

README

SendPulse REST client library (unofficial)

An unofficial SendPulse REST client library for Go (Golang).

API Documentation https://sendpulse.com/api

Build Status codecov Go Report Card License

Installation
go get -u github.com/dimuska139/sendpulse-sdk-go/sendpulse
Usage
package main

import (
	"fmt"
	sendpulse "github.com/dimuska139/sendpulse-sdk-go/v6"
	"net/http"
)

func main() {
	config := &sendpulse.Config{
		UserID: "",
		Secret: "",
	}
	client := sendpulse.NewClient(http.DefaultClient, config)
	
	emails := make([]*sendpulse.EmailToAdd, 0)
	emails = append(emails, &sendpulse.EmailToAdd{
		Email:     "test@test.com",
		Variables: map[string]interface{}{"age": 21, "weight": 99},
	})

	if err := client.Emails.MailingLists.SingleOptIn(1266208, emails); err != nil {
		fmt.Println(err)
	}
	fmt.Println(*emails[0])
}

The tests should be considered a part of the documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionBlockStat

type ActionBlockStat struct {
	FlowID   int          `json:"flow_id"`
	Executed int          `json:"executed"`
	LastSend DateTimeType `json:"last_send"`
}

ActionBlockStat represents statistics about the "Action" element

type AddPhonesCounters

type AddPhonesCounters struct {
	Added      int `json:"added"`
	Exceptions int `json:"exceptions"`
	Exists     int `json:"exists"`
}

type AddressBookEmailStatistics

type AddressBookEmailStatistics struct {
	Email         string      `json:"email"`
	AddressBookID int         `json:"abook_id,string"`
	Status        int         `json:"status"`
	StatusExplain string      `json:"status_explain"`
	Variables     []*Variable `json:"variables"`
}

AddressBookEmailStatistics represents statistics by specific address book

type AddressService

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

AddressService is a service to work with emails addresses

func (*AddressService) ChangeVariables

func (service *AddressService) ChangeVariables(addressBookID int, email string, variables []*Variable) error

ChangeVariables is a method for change a variable for an email contact

func (*AddressService) DeleteFromAllAddressBooks

func (service *AddressService) DeleteFromAllAddressBooks(email string) error

DeleteFromAllAddressBooks removes specific email address from all address books

func (*AddressService) GetDetails

func (service *AddressService) GetDetails(email string) ([]*EmailInfoList, error)

GetDetails retrieves detailed information about specific email address

func (*AddressService) GetEmailInfo

func (service *AddressService) GetEmailInfo(email string) ([]*EmailInfo, error)

GetEmailInfo returns general information about specific email address

func (*AddressService) GetEmailStatisticsByCampaignsAndAddressBooks

func (service *AddressService) GetEmailStatisticsByCampaignsAndAddressBooks(email string) (*CampaignsEmailStatistics, error)

GetEmailStatisticsByCampaignsAndAddressBooks returns statistics for an email address and campaigns it is in

func (*AddressService) GetEmailsInfo

func (service *AddressService) GetEmailsInfo(emails []string) (map[string][]*EmailInfo, error)

GetEmailsInfo retrieves general informaion for a List of Email Addresses

func (*AddressService) GetEmailsStatisticsByCampaignsAndAddressBooks

func (service *AddressService) GetEmailsStatisticsByCampaignsAndAddressBooks(emails []string) (map[string]*CampaignsAndAddressBooksEmailStatistics, error)

GetEmailsStatisticsByCampaignsAndAddressBooks returns statistics for multiple email addresses and campaigns they are in

func (*AddressService) GetStatisticsByAddressBook

func (service *AddressService) GetStatisticsByAddressBook(addressBookID int, email string) (*AddressBookEmailStatistics, error)

GetStatisticsByAddressBook returns information for a specific email address from a specific address book

func (*AddressService) GetStatisticsByCampaign

func (service *AddressService) GetStatisticsByCampaign(campaignID int, email string) (*CampaignEmailStatistics, error)

GetStatisticsByCampaign returns information for a specific email address from a specific campaign

type Automation360Service

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

Automation360Service is a service to interact with conversions

func (*Automation360Service) GetActionBlockStatistics

func (service *Automation360Service) GetActionBlockStatistics(id int) (*ActionBlockStat, error)

GetActionBlockStatistics returns statistics about the "Action" element

func (*Automation360Service) GetAutoresponderContacts

func (service *Automation360Service) GetAutoresponderContacts(id int) ([]*AutoresponderContact, error)

GetAutoresponderContacts returns a list of the contacts that converted

func (*Automation360Service) GetAutoresponderConversions

func (service *Automation360Service) GetAutoresponderConversions(id int) (*AutoresponderConversion, error)

GetAutoresponderConversions returns the flow conversions list

func (*Automation360Service) GetAutoresponderStatistics

func (service *Automation360Service) GetAutoresponderStatistics(id int) (*Autoresponder, error)

GetAutoresponderStatistics returns statistics about an automation flow

func (*Automation360Service) GetEmailBlockStatistics

func (service *Automation360Service) GetEmailBlockStatistics(id int) (*EmailBlockStat, error)

GetEmailBlockStatistics returns statistics about the "Email" element

func (*Automation360Service) GetFilterBlockStatistics

func (service *Automation360Service) GetFilterBlockStatistics(id int) (*FilterBlockStat, error)

GetFilterBlockStatistics returns statistics about the "Filter" element

func (*Automation360Service) GetGoalBlockStatistics

func (service *Automation360Service) GetGoalBlockStatistics(id int) (*GoalBlockStat, error)

GetGoalBlockStatistics returns statistics about the "Goal" element

func (*Automation360Service) GetMessengerBlockStatistics

func (service *Automation360Service) GetMessengerBlockStatistics(id int) (*MessengerBlockStat, error)

GetMessengerBlockStatistics returns statistics about the "Messenger" element

func (*Automation360Service) GetPushBlockStatistics

func (service *Automation360Service) GetPushBlockStatistics(id int) (*PushBlockStat, error)

GetPushBlockStatistics returns statistics about the "Push" element

func (*Automation360Service) GetSmsBlockStatistics

func (service *Automation360Service) GetSmsBlockStatistics(id int) (*SmsBlockStat, error)

GetSmsBlockStatistics returns statistics about the "SMS" element

func (*Automation360Service) GetStartBlockStatistics

func (service *Automation360Service) GetStartBlockStatistics(id int) (*MainTriggerBlockStat, error)

GetStartBlockStatistics returns statistics about the "Start" element

func (*Automation360Service) GetTriggerBlockStatistics

func (service *Automation360Service) GetTriggerBlockStatistics(id int) (*TriggerBlockStat, error)

GetTriggerBlockStatistics returns statistics about the "Condition" element

func (*Automation360Service) StartEvent

func (service *Automation360Service) StartEvent(eventName string, variables map[string]interface{}) error

StartEvent sends event to SendPulse

type Autoresponder

type Autoresponder struct {
	Autoresponder struct {
		ID      int          `json:"id"`
		Name    string       `json:"name"`
		Status  int          `json:"status"`
		Created DateTimeType `json:"created"`
		Changed DateTimeType `json:"changed"`
	} `json:"autoresponder"`
	Flows []*struct {
		ID       int                    `json:"id"`
		MainID   int                    `json:"main_id"`
		AfType   string                 `json:"af_type"`
		Created  DateTimeType           `json:"created"`
		LastSend DateTimeType           `json:"last_send"`
		Task     map[string]interface{} `json:"task"`
	} `json:"flows"`
	Starts       int `json:"starts"`
	InQueue      int `json:"in_queue"`
	EndCount     int `json:"end_count"`
	SendMessages int `json:"send_messages"`
	Conversions  int `json:"conversions"`
}

Autoresponder represents statistics about an automation flow

type AutoresponderContact

type AutoresponderContact struct {
	ID             int          `json:"id"`
	ConversionType string       `json:"conversion_type"`
	FlowID         int          `json:"flow_id"`
	Email          string       `json:"email"`
	Phone          string       `json:"phone"`
	ConversionDate DateTimeType `json:"conversion_date"`
	StartDate      DateTimeType `json:"start_date"`
}

AutoresponderContact represents the contact that converted

type AutoresponderConversion

type AutoresponderConversion struct {
	TotalConversions       int `json:"total_conversions"`
	MaintriggerConversions int `json:"maintrigger_conversions"`
	GoalConversions        int `json:"goal_conversions"`
	Maintrigger            struct {
		ID          int          `json:"id"`
		MainID      int          `json:"main_id"`
		AfType      string       `json:"af_type"`
		Created     DateTimeType `json:"created"`
		LastSend    DateTimeType `json:"last_send"`
		Conversions int          `json:"conversions"`
	} `json:"maintrigger"`
	Goals []struct {
		ID          int          `json:"id"`
		Name        string       `json:"name"`
		MainID      int          `json:"main_id"`
		AfType      string       `json:"af_type"`
		Created     DateTimeType `json:"created"`
		Conversions int          `json:"conversions"`
	} `json:"goals"`
}

AutoresponderConversion represents the flow conversion

type Balance

type Balance struct {
	Currency        string  `json:"currency"`
	BalanceCurrency float32 `json:"balance_currency"`
}

Balance represents main information about user's balance

type BalanceDetailed

type BalanceDetailed struct {
	Balance struct {
		Main     float32 `json:"main,string"`
		Bonus    float32 `json:"bonus,string"`
		Currency string  `json:"currency"`
	} `json:"balance"`
	Email struct {
		TariffName         string       `json:"tariff_name"`
		FinishedTime       DateTimeType `json:"finished_time"`
		EmailsLeft         int          `json:"emails_left"`
		MaximumSubscribers int          `json:"maximum_subscribers"`
		CurrentSubscribers int          `json:"current_subscribers"`
	} `json:"email"`
	Smtp struct {
		TariffName string       `json:"tariff_name"`
		EndDate    DateTimeType `json:"end_date"`
		AutoRenew  int          `json:"auto_renew"`
	} `json:"smtp"`
	Push struct {
		TariffName string       `json:"tariff_name"`
		EndDate    DateTimeType `json:"end_date"`
		AutoRenew  int          `json:"auto_renew"`
	} `json:"push"`
}

Balance represents detailed information about user's balance

type BalanceService

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

Automation360Service is a service to interact with user balance

func (*BalanceService) GetBalance

func (service *BalanceService) GetBalance(currency string) (*Balance, error)

GetBalance returns main information about users's balance

func (*BalanceService) GetDetailedBalance

func (service *BalanceService) GetDetailedBalance() (*BalanceDetailed, error)

GetDetailedBalance returns detailed information about users's balance

type BlacklistPhone

type BlacklistPhone struct {
	Phone       string
	Description string       `json:"description"`
	AddDate     DateTimeType `json:"add_date"`
}

type BlacklistService

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

BlacklistService is a service to interact with blacklist

func (*BlacklistService) AddToBlacklist

func (service *BlacklistService) AddToBlacklist(emails []string, comment string) error

AddToBlacklist appends an email addresses to a blacklist

func (*BlacklistService) GetEmails

func (service *BlacklistService) GetEmails() ([]string, error)

GetEmails returns a list of emails added to blacklist

func (*BlacklistService) RemoveFromBlacklist

func (service *BlacklistService) RemoveFromBlacklist(emails []string) error

RemoveFromBlacklist removes an email addresses from a blacklist

type BotContactsByVariableParams

type BotContactsByVariableParams struct {
	VariableID    string
	VariableName  string
	BotID         string
	VariableValue string
}

type BotFlow

type BotFlow struct {
	ID       string `json:"id"`
	BotID    string `json:"bot_id"`
	Name     string `json:"name"`
	Status   int    `json:"status"`
	Triggers []struct {
		ID   string `json:"id"`
		Name string `json:"name"`
	} `json:"triggers"`
	CreatedAt time.Time `json:"created_at"`
}

type BotTrigger

type BotTrigger struct {
	ID        string   `json:"id"`
	BotID     string   `json:"bot_id"`
	FlowID    string   `json:"flow_id"`
	Name      string   `json:"name"`
	Type      int      `json:"type"`
	Status    int      `json:"status"`
	Keywords  []string `json:"keywords"`
	Execution struct {
		Interval int `json:"interval"`
		Units    int `json:"units"`
	} `json:"execution"`
	CreatedAt time.Time `json:"created_at"`
}

type BotVariable

type BotVariable struct {
	ID          string    `json:"id"`
	BotID       string    `json:"bot_id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Type        int       `json:"type"`
	ValueType   int       `json:"value_type"`
	Status      int       `json:"status"`
	CreatedAt   time.Time `json:"created_at"`
}

type BotsFbService

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

func (*BotsFbService) DeleteContact

func (service *BotsFbService) DeleteContact(contactID string) error

func (*BotsFbService) DeletePauseAutomation

func (service *BotsFbService) DeletePauseAutomation(contactID string) error

func (*BotsFbService) DeleteTagFromContact

func (service *BotsFbService) DeleteTagFromContact(contactID string, tag string) error

func (*BotsFbService) DisableContact

func (service *BotsFbService) DisableContact(contactID string) error

func (*BotsFbService) EnableContact

func (service *BotsFbService) EnableContact(contactID string) error

func (*BotsFbService) GetAccount

func (service *BotsFbService) GetAccount() (*FbAccount, error)

func (*BotsFbService) GetBotChats

func (service *BotsFbService) GetBotChats(botID string) ([]*FbBotChat, error)

func (*BotsFbService) GetBotTriggers

func (service *BotsFbService) GetBotTriggers(botID string) ([]*BotTrigger, error)

func (*BotsFbService) GetBotVariables

func (service *BotsFbService) GetBotVariables(botID string) ([]*BotVariable, error)

func (*BotsFbService) GetBots

func (service *BotsFbService) GetBots() ([]*FbBot, error)

func (*BotsFbService) GetContact

func (service *BotsFbService) GetContact(contactID string) (*FbBotContact, error)

func (*BotsFbService) GetContactMessages

func (service *BotsFbService) GetContactMessages(contactID string) ([]*FbBotMessage, error)

func (*BotsFbService) GetContactsByTag

func (service *BotsFbService) GetContactsByTag(tag, botID string) ([]*FbBotContact, error)

func (*BotsFbService) GetContactsByVariable

func (service *BotsFbService) GetContactsByVariable(params BotContactsByVariableParams) ([]*FbBotContact, error)

func (*BotsFbService) GetFlows

func (service *BotsFbService) GetFlows(botID string) ([]*BotFlow, error)

func (*BotsFbService) GetPauseAutomation

func (service *BotsFbService) GetPauseAutomation(contactID string) (int, error)

func (*BotsFbService) RunFlow

func (service *BotsFbService) RunFlow(contactID, flowID string, externalData map[string]interface{}) error

func (*BotsFbService) RunFlowByTrigger

func (service *BotsFbService) RunFlowByTrigger(contactID, triggerKeyword string, externalData map[string]interface{}) error

func (*BotsFbService) SendCampaign

func (service *BotsFbService) SendCampaign(params FbBotSendCampaignParams) error

func (*BotsFbService) SendTextByContact

func (service *BotsFbService) SendTextByContact(params FbBotSendTextParams) error

func (*BotsFbService) SetPauseAutomation

func (service *BotsFbService) SetPauseAutomation(contactID string, minutes int) error

func (*BotsFbService) SetTagsToContact

func (service *BotsFbService) SetTagsToContact(contactID string, tags []string) error

func (*BotsFbService) SetVariableToContact

func (service *BotsFbService) SetVariableToContact(contactID string, variableID string, variableName string, variableValue interface{}) error

type BotsService

type BotsService struct {
	Fb       *BotsFbService
	Vk       *BotsVkService
	Telegram *BotsTelegramService
	WhatsApp *BotsWhatsAppService
	// contains filtered or unexported fields
}

type BotsTelegramService

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

func (*BotsTelegramService) DeleteContact

func (service *BotsTelegramService) DeleteContact(contactID string) error

func (*BotsTelegramService) DeletePauseAutomation

func (service *BotsTelegramService) DeletePauseAutomation(contactID string) error

func (*BotsTelegramService) DeleteTagFromContact

func (service *BotsTelegramService) DeleteTagFromContact(contactID string, tag string) error

func (*BotsTelegramService) DisableContact

func (service *BotsTelegramService) DisableContact(contactID string) error

func (*BotsTelegramService) EnableContact

func (service *BotsTelegramService) EnableContact(contactID string) error

func (*BotsTelegramService) GetAccount

func (service *BotsTelegramService) GetAccount() (*TelegramAccount, error)

func (*BotsTelegramService) GetBotChats

func (service *BotsTelegramService) GetBotChats(botID string) ([]*TelegramBotChat, error)

func (*BotsTelegramService) GetBotTriggers

func (service *BotsTelegramService) GetBotTriggers(botID string) ([]*BotTrigger, error)

func (*BotsTelegramService) GetBotVariables

func (service *BotsTelegramService) GetBotVariables(botID string) ([]*BotVariable, error)

func (*BotsTelegramService) GetBots

func (service *BotsTelegramService) GetBots() ([]*TelegramBot, error)

func (*BotsTelegramService) GetContact

func (service *BotsTelegramService) GetContact(contactID string) (*TelegramBotContact, error)

func (*BotsTelegramService) GetContactMessages

func (service *BotsTelegramService) GetContactMessages(contactID string) ([]*TelegramBotMessage, error)

func (*BotsTelegramService) GetContactsByTag

func (service *BotsTelegramService) GetContactsByTag(tag, botID string) ([]*TelegramBotContact, error)

func (*BotsTelegramService) GetContactsByVariable

func (service *BotsTelegramService) GetContactsByVariable(params BotContactsByVariableParams) ([]*TelegramBotContact, error)

func (*BotsTelegramService) GetFlows

func (service *BotsTelegramService) GetFlows(botID string) ([]*BotFlow, error)

func (*BotsTelegramService) GetPauseAutomation

func (service *BotsTelegramService) GetPauseAutomation(contactID string) (int, error)

func (*BotsTelegramService) RunFlow

func (service *BotsTelegramService) RunFlow(contactID, flowID string, externalData map[string]interface{}) error

func (*BotsTelegramService) RunFlowByTrigger

func (service *BotsTelegramService) RunFlowByTrigger(contactID, triggerKeyword string, externalData map[string]interface{}) error

func (*BotsTelegramService) SendCampaign

func (service *BotsTelegramService) SendCampaign(params TelegramBotSendCampaignParams) error

func (*BotsTelegramService) SendTextByContact

func (service *BotsTelegramService) SendTextByContact(contactID string, text string) error

func (*BotsTelegramService) SetPauseAutomation

func (service *BotsTelegramService) SetPauseAutomation(contactID string, minutes int) error

func (*BotsTelegramService) SetTagsToContact

func (service *BotsTelegramService) SetTagsToContact(contactID string, tags []string) error

func (*BotsTelegramService) SetVariableToContact

func (service *BotsTelegramService) SetVariableToContact(contactID string, variableID string, variableName string, variableValue interface{}) error

type BotsVkService

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

func (*BotsVkService) DeleteContact

func (service *BotsVkService) DeleteContact(contactID string) error

func (*BotsVkService) DeletePauseAutomation

func (service *BotsVkService) DeletePauseAutomation(contactID string) error

func (*BotsVkService) DeleteTagFromContact

func (service *BotsVkService) DeleteTagFromContact(contactID string, tag string) error

func (*BotsVkService) DisableContact

func (service *BotsVkService) DisableContact(contactID string) error

func (*BotsVkService) EnableContact

func (service *BotsVkService) EnableContact(contactID string) error

func (*BotsVkService) GetAccount

func (service *BotsVkService) GetAccount() (*VkAccount, error)

func (*BotsVkService) GetBotChats

func (service *BotsVkService) GetBotChats(botID string) ([]*VkBotChat, error)

func (*BotsVkService) GetBotTriggers

func (service *BotsVkService) GetBotTriggers(botID string) ([]*BotTrigger, error)

func (*BotsVkService) GetBotVariables

func (service *BotsVkService) GetBotVariables(botID string) ([]*BotVariable, error)

func (*BotsVkService) GetBots

func (service *BotsVkService) GetBots() ([]*VkBot, error)

func (*BotsVkService) GetContact

func (service *BotsVkService) GetContact(contactID string) (*VkBotContact, error)

func (*BotsVkService) GetContactMessages

func (service *BotsVkService) GetContactMessages(contactID string) ([]*VkBotMessage, error)

func (*BotsVkService) GetContactsByTag

func (service *BotsVkService) GetContactsByTag(tag, botID string) ([]*VkBotContact, error)

func (*BotsVkService) GetContactsByVariable

func (service *BotsVkService) GetContactsByVariable(params BotContactsByVariableParams) ([]*VkBotContact, error)

func (*BotsVkService) GetFlows

func (service *BotsVkService) GetFlows(botID string) ([]*BotFlow, error)

func (*BotsVkService) GetPauseAutomation

func (service *BotsVkService) GetPauseAutomation(contactID string) (int, error)

func (*BotsVkService) RunFlow

func (service *BotsVkService) RunFlow(contactID, flowID string, externalData map[string]interface{}) error

func (*BotsVkService) RunFlowByTrigger

func (service *BotsVkService) RunFlowByTrigger(contactID, triggerKeyword string, externalData map[string]interface{}) error

func (*BotsVkService) SendCampaign

func (service *BotsVkService) SendCampaign(params VkBotSendCampaignParams) error

func (*BotsVkService) SendTextByContact

func (service *BotsVkService) SendTextByContact(contactID string, text string) error

func (*BotsVkService) SetPauseAutomation

func (service *BotsVkService) SetPauseAutomation(contactID string, minutes int) error

func (*BotsVkService) SetTagsToContact

func (service *BotsVkService) SetTagsToContact(contactID string, tags []string) error

func (*BotsVkService) SetVariableToContact

func (service *BotsVkService) SetVariableToContact(contactID string, variableID string, variableName string, variableValue interface{}) error

type BotsWhatsAppService

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

func (*BotsWhatsAppService) CreateContact

func (service *BotsWhatsAppService) CreateContact(botID, phone, name string) (*WhatsAppBotContact, error)

func (*BotsWhatsAppService) DeleteContact

func (service *BotsWhatsAppService) DeleteContact(contactID string) error

func (*BotsWhatsAppService) DeletePauseAutomation

func (service *BotsWhatsAppService) DeletePauseAutomation(contactID string) error

func (*BotsWhatsAppService) DeleteTagFromContact

func (service *BotsWhatsAppService) DeleteTagFromContact(contactID string, tag string) error

func (*BotsWhatsAppService) DisableContact

func (service *BotsWhatsAppService) DisableContact(contactID string) error

func (*BotsWhatsAppService) EnableContact

func (service *BotsWhatsAppService) EnableContact(contactID string) error

func (*BotsWhatsAppService) GetAccount

func (service *BotsWhatsAppService) GetAccount() (*WhatsAppAccount, error)

func (*BotsWhatsAppService) GetBotChats

func (service *BotsWhatsAppService) GetBotChats(botID string) ([]*WhatsAppBotChat, error)

func (*BotsWhatsAppService) GetBotTriggers

func (service *BotsWhatsAppService) GetBotTriggers(botID string) ([]*BotTrigger, error)

func (*BotsWhatsAppService) GetBotVariables

func (service *BotsWhatsAppService) GetBotVariables(botID string) ([]*BotVariable, error)

func (*BotsWhatsAppService) GetBots

func (service *BotsWhatsAppService) GetBots() ([]*WhatsAppBot, error)

func (*BotsWhatsAppService) GetContact

func (service *BotsWhatsAppService) GetContact(contactID string) (*WhatsAppBotContact, error)

func (*BotsWhatsAppService) GetContactMessages

func (service *BotsWhatsAppService) GetContactMessages(contactID string) ([]*WhatsAppBotMessage, error)

func (*BotsWhatsAppService) GetContactsByPhone

func (service *BotsWhatsAppService) GetContactsByPhone(phone, botID string) ([]*WhatsAppBotContact, error)

func (*BotsWhatsAppService) GetContactsByTag

func (service *BotsWhatsAppService) GetContactsByTag(tag, botID string) ([]*WhatsAppBotContact, error)

func (*BotsWhatsAppService) GetContactsByVariable

func (service *BotsWhatsAppService) GetContactsByVariable(params BotContactsByVariableParams) ([]*WhatsAppBotContact, error)

func (*BotsWhatsAppService) GetFlows

func (service *BotsWhatsAppService) GetFlows(botID string) ([]*BotFlow, error)

func (*BotsWhatsAppService) GetPauseAutomation

func (service *BotsWhatsAppService) GetPauseAutomation(contactID string) (int, error)

func (*BotsWhatsAppService) GetTemplates

func (service *BotsWhatsAppService) GetTemplates() ([]*WhatsAppTemplate, error)

func (*BotsWhatsAppService) RunFlow

func (service *BotsWhatsAppService) RunFlow(contactID, flowID string, externalData map[string]interface{}) error

func (*BotsWhatsAppService) RunFlowByTrigger

func (service *BotsWhatsAppService) RunFlowByTrigger(contactID, triggerKeyword string, externalData map[string]interface{}) error

func (*BotsWhatsAppService) SendByContact

func (service *BotsWhatsAppService) SendByContact(contactID string, message *WhatsAppMessage) error

func (*BotsWhatsAppService) SendByPhone

func (service *BotsWhatsAppService) SendByPhone(botID, phone string, message *WhatsAppMessage) error

func (*BotsWhatsAppService) SendCampaign

func (service *BotsWhatsAppService) SendCampaign(params WhatsAppBotSendCampaignParams) error

func (*BotsWhatsAppService) SendCampaignByTemplate

func (service *BotsWhatsAppService) SendCampaignByTemplate(params WhatsAppBotSendCampaignByTemplateParams) error

func (*BotsWhatsAppService) SendTemplate

func (service *BotsWhatsAppService) SendTemplate(contactID, templateName, languageCode string) error

func (*BotsWhatsAppService) SendTemplateByPhone

func (service *BotsWhatsAppService) SendTemplateByPhone(botID, phone, templateName, languageCode string) error

func (*BotsWhatsAppService) SendTemplateByPhoneWithImage

func (service *BotsWhatsAppService) SendTemplateByPhoneWithImage(botID, phone, templateName, languageCode, imageLink string) error

func (*BotsWhatsAppService) SendTemplateByPhoneWithVariables

func (service *BotsWhatsAppService) SendTemplateByPhoneWithVariables(botID, phone, templateName, languageCode string, variables []string) error

func (*BotsWhatsAppService) SendTemplateWithImage

func (service *BotsWhatsAppService) SendTemplateWithImage(contactID, templateName, languageCode, imageLink string) error

func (*BotsWhatsAppService) SendTemplateWithVariables

func (service *BotsWhatsAppService) SendTemplateWithVariables(contactID, templateName, languageCode string, variables []string) error

func (*BotsWhatsAppService) SetPauseAutomation

func (service *BotsWhatsAppService) SetPauseAutomation(contactID string, minutes int) error

func (*BotsWhatsAppService) SetTagsToContact

func (service *BotsWhatsAppService) SetTagsToContact(contactID string, tags []string) error

func (*BotsWhatsAppService) SetVariableToContact

func (service *BotsWhatsAppService) SetVariableToContact(contactID string, variableID string, variableName string, variableValue interface{}) error

type BouncesList

type BouncesList struct {
	Total  int `json:"total"`
	Emails []struct {
		EmailTo           string       `json:"email_to"`
		Sender            string       `json:"sender"`
		SendDate          DateTimeType `json:"send_date"`
		Subject           string       `json:"subject"`
		SmtpAnswerCode    int          `json:"smtp_answer_code"`
		SmtpAnswerSubcode string       `json:"smtp_answer_subcode"`
		SmtpAnswerData    string       `json:"smtp_answer_data"`
	} `json:"emails"`
	RequestLimit int `json:"request_limit"`
	Found        int `json:"found"`
}

type Campaign

type Campaign struct {
	ID      int    `json:"id"`
	Name    string `json:"name"`
	Message struct {
		SenderName    string `json:"sender_name"`
		SenderEmail   string `json:"sender_email"`
		Subject       string `json:"subject"`
		Body          string `json:"body"`
		Attachments   string `json:"attachments"`
		MailingListID int    `json:"list_id"`
	}
	Status            int          `json:"status"`
	AllEmailQty       int          `json:"all_email_qty"`
	TariffEmailQty    int          `json:"tariff_email_qty"`
	PaidEmailQty      int          `json:"paid_email_qty"`
	OverdraftPrice    float32      `json:"overdraft_price"`
	OverdraftCurrency string       `json:"overdraft_currency"`
	SendDate          DateTimeType `json:"send_date"`
}

Campaign describes a campaign

type CampaignCost

type CampaignCost struct {
	Cur                       string `json:"email"`
	SentEmailsQty             int    `json:"sent_emails_qty"`
	OverdraftAllEmailsPrice   int    `json:"overdraft_all_emails_price"`
	AddressesDeltaFromBalance int    `json:"address_delta_from_balance"`
	AddressesDeltaFromTariff  int    `json:"address_delta_from_tariff"`
	MaxEmailsPerTask          int    `json:"max_emails_per_task"`
	Result                    bool   `json:"result"`
}

CampaignCost represents the cost of a campaign sent to a mailing list

type CampaignEmailStatistics

type CampaignEmailStatistics struct {
	SendDate            DateTimeType `json:"send_date"`
	GlobalStatus        int          `json:"global_status"`
	GlobalStatusExplain string       `json:"global_status_explain"`
	DetailStatus        int          `json:"detail_status"`
	DetailStatusExplain string       `json:"detail_status_explain"`
}

CampaignEmailStatistics represents statistics of specific campaign

type CampaignParams

type CampaignParams struct {
	SenderName    string            `json:"sender_name"`
	SenderEmail   string            `json:"sender_email"`
	Subject       string            `json:"subject"`
	Body          string            `json:"body,omitempty"`
	TemplateID    string            `json:"template_id,omitempty"`
	MailingListID int               `json:"list_id,omitempty"`
	SegmentID     int               `json:"segment_id,omitempty"`
	IsTest        bool              `json:"is_test,omitempty"`
	SendDate      DateTimeType      `json:"send_date,omitempty"`
	Name          string            `json:"name,omitempty"`
	Attachments   map[string]string `json:"attachments"`
	Type          string            `json:"type,omitempty"`
	BodyAMP       string            `json:"body_amp,omitempty"`
}

Campaign describes campaign params

type CampaignsAndAddressBooksEmailStatistics

type CampaignsAndAddressBooksEmailStatistics struct {
	Sent         int `json:"sent"`
	Open         int `json:"open"`
	Link         int `json:"link"`
	Addressbooks []*struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"adressbooks"`
	Blacklist bool
}

CampaignsAndAddressBooksEmailStatistics represents statistics for multiple email addresses and campaigns they are in

type CampaignsEmailStatistics

type CampaignsEmailStatistics struct {
	Statistic *struct {
		Sent int `json:"sent"`
		Open int `json:"open"`
		Link int `json:"link"`
	} `json:"statistic"`
	Addressbooks []*struct {
		Id   int    `json:"id"`
		Name string `json:"address_book_name"`
	}
	Blacklist bool
}

CampaignsEmailStatistics represents statistics for an email address and campaigns it is in

type CampaignsService

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

CampaignsService is a service to interact with campaigns

func (*CampaignsService) CancelCampaign

func (service *CampaignsService) CancelCampaign(id int) error

CancelCampaign cancels a scheduled campaign

func (*CampaignsService) CreateCampaign

func (service *CampaignsService) CreateCampaign(data CampaignParams) (*Campaign, error)

CreateCampaign creates a campaign. Please note that you can send a maximum of 4 campaigns per hour

func (*CampaignsService) GetCampaign

func (service *CampaignsService) GetCampaign(id int) (*Campaign, error)

GetCampaign returns an information about specific campaign

func (*CampaignsService) GetCampaignCountriesStatistics

func (service *CampaignsService) GetCampaignCountriesStatistics(id int) (map[string]int, error)

GetCampaignCountriesStatistics represents campaign statistics of countries

func (*CampaignsService) GetCampaignReferralsStatistics

func (service *CampaignsService) GetCampaignReferralsStatistics(id int) ([]*MailingRefStat, error)

GetCampaignReferralsStatistics returns campaign statistics of referrals

func (*CampaignsService) GetCampaigns

func (service *CampaignsService) GetCampaigns(limit int, offset int) ([]*Campaign, error)

GetCampaigns returns a list of campaigns

func (*CampaignsService) GetCampaignsByMailingList

func (service *CampaignsService) GetCampaignsByMailingList(mailingListID, limit, offset int) ([]*Task, error)

GetCampaignsByMailingList returns a list of campaigns by specific mailing list

func (*CampaignsService) UpdateCampaign

func (service *CampaignsService) UpdateCampaign(id int, data CampaignParams) error

UpdateCampaign updates a scheduled campaign

type Client

type Client struct {
	Emails        *EmailsService
	Balance       *BalanceService
	SMTP          *SmtpService
	Push          *PushService
	SMS           *SmsService
	Viber         *ViberService
	VkOk          *VkOkService
	Bots          *BotsService
	Automation360 *Automation360Service
	// contains filtered or unexported fields
}

Client to interact with SendpulseAPI

func NewClient

func NewClient(client *http.Client, config *Config) *Client

NewClient creates new Client to interract with SendpulseAPI

type Config

type Config struct {
	UserID string
	Secret string
	Rps    int // Max allowed count of requests per second (default: 10)
}

type CreateSmsCampaignByAddressBookParams

type CreateSmsCampaignByAddressBookParams struct {
	Sender        string            `json:"sender"`
	MailingListID int               `json:"addressBookId"`
	Body          string            `json:"body"`
	Transliterate int               `json:"transliterate"`
	Route         map[string]string `json:"route,omitempty"`
	Date          DateTimeType      `json:"date"`
	Emulate       int               `json:"emulate"`
}

type CreateSmsCampaignByPhonesParams

type CreateSmsCampaignByPhonesParams struct {
	Sender        string            `json:"sender"`
	Phones        []string          `json:"phones"`
	Body          string            `json:"body"`
	Transliterate int               `json:"transliterate"`
	Route         map[string]string `json:"route,omitempty"`
	Date          DateTimeType      `json:"date"`
	Emulate       int               `json:"emulate"`
}

type CreateViberCampaignParams

type CreateViberCampaignParams struct {
	TaskName        string       `json:"task_name"`
	MessageType     int          `json:"message_type,omitempty"`
	SenderID        int          `json:"sender_id"`
	MessageLiveTime int          `json:"message_live_time"`
	SendDate        DateTimeType `json:"send_date"`
	MailingListID   int          `json:"address_book"`
	Recipients      []int        `json:"recipients"`
	Message         string       `json:"message"`
	Additional      *struct {
		Button *struct {
			Text string `json:"text"`
			Link string `json:"link"`
		} `json:"button,omitempty"`
		Image *struct {
			Link string `json:"link"`
		} `json:"image,omitempty"`
		ResendSms *struct {
			Status        bool   `json:"status"`
			SmsText       string `json:"sms_text"`
			SmsSenderName string `json:"sms_sender_name"`
		} `json:"resend_sms,omitempty"`
	} `json:"additional,omitempty"`
}

type CreateVkOkSenderParams

type CreateVkOkSenderParams struct {
	Name        string
	VkUrl       string
	OkUrl       string
	CoverLetter *os.File
}

type CreateVkOkTemplateParams

type CreateVkOkTemplateParams struct {
	Name      string `json:"name"`
	VkMessage string `json:"vk_message,omitempty"`
	OkMessage string `json:"ok_message,omitempty"`
	SenderID  int    `json:"sender_id"`
}

type DateTimeType

type DateTimeType time.Time

func (*DateTimeType) MarshalJSON

func (d *DateTimeType) MarshalJSON() ([]byte, error)

func (*DateTimeType) String

func (d *DateTimeType) String() string

func (*DateTimeType) UnmarshalJSON

func (d *DateTimeType) UnmarshalJSON(b []byte) error

type Email

type Email struct {
	Email         string                 `json:"email"`
	Phone         int                    `json:"phone"`
	Status        int                    `json:"status"`
	StatusExplain string                 `json:"status_explain"`
	Variables     map[string]interface{} `json:"variables"`
}

Email describes email address

type EmailBlockStat

type EmailBlockStat struct {
	FlowID int `json:"flow_id"`
	Task   struct {
		ID                int          `json:"id"`
		MailingListID     int          `json:"address_book_id"`
		MessageTitle      string       `json:"message_title"`
		SenderMailAddress string       `json:"sender_mail_address"`
		SenderMailName    string       `json:"sender_mail_name"`
		Created           DateTimeType `json:"created"`
	} `json:"task"`
	Sent         int          `json:"sent"`
	Delivered    int          `json:"delivered"`
	Opened       int          `json:"opened"`
	Clicked      int          `json:"clicked"`
	Errors       int          `json:"errors"`
	Unsubscribed int          `json:"unsubscribed"`
	MarkedAsSpam int          `json:"marked_as_spam"`
	LastSend     DateTimeType `json:"last_send"`
}

EmailBlockStat represents statistics about the "Email" element

type EmailInfo

type EmailInfo struct {
	BookID    int         `json:"book_id"`
	Status    int         `json:"status"`
	Variables []*Variable `json:"variables"`
}

EmailInfo represents a general information of email address

type EmailInfoList

type EmailInfoList struct {
	ListName string       `json:"list_name"`
	ListID   int          `json:"list_id"`
	AddDate  DateTimeType `json:"add_date"`
	Source   string       `json:"source"`
}

EmailInfoList represents a detailed information of email address

type EmailToAdd

type EmailToAdd struct {
	Email     string                 `json:"email"`
	Variables map[string]interface{} `json:"variables"`
}

EmailToAdd represents structure for add email to mailing list

type EmailValidationResult

type EmailValidationResult struct {
	Email  string `json:"email"`
	Checks struct {
		Status      int    `json:"status"`
		ValidFormat int    `json:"valid_format"`
		Disposable  int    `json:"disposable"`
		Webmail     int    `json:"webmail"`
		Gibberish   int    `json:"gibberish"`
		StatusText  string `json:"status_text"`
	} `json:"checks"`
}

EmailValidationResult describes a result of a verification of specific email

type EmailsService

type EmailsService struct {
	MailingLists *MailingListsService
	Templates    *TemplatesService
	Senders      *SendersService
	Blacklist    *BlacklistService
	Webhooks     *WebhooksService
	Address      *AddressService
	Campaigns    *CampaignsService
	Validator    *ValidatorService
	// contains filtered or unexported fields
}

type FbAccount

type FbAccount struct {
	Tariff struct {
		Branding     bool      `json:"branding"`
		MaxBots      int       `json:"max_bots"`
		MaxContacts  int       `json:"max_contacts"`
		MaxMessages  int       `json:"max_messages"`
		MaxTags      int       `json:"max_tags"`
		MaxVariables int       `json:"max_variables"`
		MaxRss       int       `json:"max_rss"`
		Code         string    `json:"code"`
		IsExceeded   bool      `json:"is_exceeded"`
		IsExpired    bool      `json:"is_expired"`
		ExpiredAt    time.Time `json:"expired_at"`
	} `json:"tariff"`
	Statistics struct {
		Messages  int `json:"messages"`
		Bots      int `json:"bots"`
		Contacts  int `json:"contacts"`
		Variables int `json:"variables"`
	} `json:"statistics"`
}

type FbBot

type FbBot struct {
	ID          string `json:"id"`
	ChannelData struct {
		ID          string `json:"id"`
		AccessToken string `json:"access_token"`
		Name        string `json:"name"`
		Photo       string `json:"photo"`
	} `json:"channel_data"`
	Inbox struct {
		Total  int `json:"total"`
		Unread int `json:"unread"`
	} `json:"inbox"`
	Status    int       `json:"status"`
	CreatedAt time.Time `json:"created_at"`
}

type FbBotCampaignMessage

type FbBotCampaignMessage struct {
	Type string `json:"type"`
	Data struct {
		Text string `json:"text"`
	} `json:"data"`
}

type FbBotChat

type FbBotChat struct {
	Contact          *FbBotContact `json:"contact"`
	InboxLastMessage *FbBotMessage `json:"inbox_last_message"`
	InboxUnread      int           `json:"inbox_unread"`
}

type FbBotContact

type FbBotContact struct {
	ID          string `json:"id"`
	BotID       string `json:"bot_id"`
	Status      int    `json:"status"`
	ChannelData struct {
		ID         string `json:"id"`
		Name       string `json:"name"`
		FirstName  string `json:"first_name"`
		LastName   string `json:"last_name"`
		ProfilePic string `json:"profile_pic"`
		Locale     string `json:"locale"`
		Gender     string `json:"gender"`
	} `json:"channel_data"`
	Tags                  []string               `json:"tags"`
	Variables             map[string]interface{} `json:"variables"`
	IsChatOpened          bool                   `json:"is_chat_opened"`
	LastActivityAt        time.Time              `json:"last_activity_at"`
	AutomationPausedUntil time.Time              `json:"automation_paused_until"`
	UnsubscribedAt        time.Time              `json:"unsubscribed_at"`
	CreatedAt             time.Time              `json:"created_at"`
}

type FbBotMessage

type FbBotMessage struct {
	ID           string                 `json:"id"`
	ContactID    string                 `json:"contact_id"`
	BotID        string                 `json:"bot_id"`
	CampaignID   string                 `json:"campaign_id"`
	Data         map[string]interface{} `json:"data"`
	Direction    int                    `json:"direction"`
	Status       int                    `json:"status"`
	DeliveredAt  time.Time              `json:"delivered_at"`
	OpenedAt     time.Time              `json:"opened_at"`
	RedirectedAt time.Time              `json:"redirected_at"`
	CreatedAt    time.Time              `json:"created_at"`
}

type FbBotSendCampaignParams

type FbBotSendCampaignParams struct {
	Title                   string                 `json:"title"`
	BotID                   string                 `json:"bot_id"`
	MessageTag              string                 `json:"message_tag"`
	MessageNotificationType string                 `json:"message_notification_type"`
	SendAt                  time.Time              `json:"send_at"`
	Messages                []FbBotCampaignMessage `json:"messages"`
}

type FbBotSendTextParams

type FbBotSendTextParams struct {
	ContactID   string `json:"contact_id"`
	MessageType string `json:"message_type"`
	MessageTag  string `json:"message_tag"`
	Text        string `json:"text"`
}

type FilterBlockStat

type FilterBlockStat struct {
	FlowID   int          `json:"flow_id"`
	Executed int          `json:"executed"`
	LastSend DateTimeType `json:"last_send"`
}

FilterBlockStat represents statistics about the "Filter" element

type GoalBlockStat

type GoalBlockStat struct {
	FlowID    int          `json:"flow_id"`
	Executed  int          `json:"executed"`
	Sent      int          `json:"sent"`
	Delivered int          `json:"delivered"`
	Opened    int          `json:"opened"`
	Clicked   int          `json:"clicked"`
	Errors    int          `json:"errors"`
	LastSend  DateTimeType `json:"last_send"`
}

GoalBlockStat represents statistics about the "Goal" element

type MailingList

type MailingList struct {
	ID               int          `json:"id"`
	Name             string       `json:"name"`
	AllEmailQty      int          `json:"all_email_qty"`
	ActiveEmailQty   int          `json:"active_email_qty"`
	InactiveEmailQty int          `json:"inactive_email_qty"`
	CreationDate     DateTimeType `json:"creationdate"`
	Status           int          `json:"status"`
	StatusExplain    string       `json:"status_explain"`
}

MailingList represents detailed information of specific mailing list

type MailingListReportParams

type MailingListReportParams struct {
	ID       int    `json:"id"`
	Format   int    `json:"format,omitempty"`
	Statuses []int  `json:"status,omitempty"`
	Lang     string `json:"lang,omitempty"`
}

MailingListReportParams describes parameters to CreateMailingListValidationReport

type MailingListValidationResult

type MailingListValidationResult struct {
	ID                int          `json:"id"`
	Name              string       `json:"address_book_name"`
	AllEmailsQuantity int          `json:"all_emails_quantity"`
	Status            int          `json:"status"`
	CheckDate         DateTimeType `json:"check_date"`
	Data              struct {
		Unverified  int `json:"0"`
		Valid       int `json:"1"`
		Unconfirmed int `json:"2"`
		Invalid     int `json:"3"`
	} `json:"data"`
	IsUpdated       int    `json:"is_updated"`
	StatusText      string `json:"status_text"`
	IsGarbageInBook bool   `json:"is_garbage_in_book"`
}

MailingListValidationResult is a results of email validation progress

type MailingListValidationResultDetailed

type MailingListValidationResultDetailed struct {
	MailingListValidationResult
	EmailAddresses []struct {
		ID           int          `json:"id"`
		EmailAddress string       `json:"email_address"`
		CheckDate    DateTimeType `json:"check_date"`
		Status       int          `json:"status"`
		StatusText   string       `json:"status_text"`
	} `json:"email_addresses"`
	EmailAddressesTotal int `json:"email_addresses_total"`
}

MailingListValidationResultDetailed is a detailed result of email validation progress

type MailingListsService

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

MailingListsService is a service to interact with mailing lists

func (*MailingListsService) ChangeName

func (service *MailingListsService) ChangeName(id int, name string) error

ChangeName changes a name of specific mailing list

func (*MailingListsService) CountCampaignCost

func (service *MailingListsService) CountCampaignCost(mailingListID int) (*CampaignCost, error)

CountCampaignCost calculates the cost of a campaign sent to a mailing list

func (*MailingListsService) CountMailingListEmails

func (service *MailingListsService) CountMailingListEmails(mailingListID int) (int, error)

CountMailingListEmails returns a the total number of contacts in a mailing list

func (*MailingListsService) CreateMailingList

func (service *MailingListsService) CreateMailingList(name string) (int, error)

CreateMailingList creates new mailing list

func (*MailingListsService) DeleteMailingList

func (service *MailingListsService) DeleteMailingList(mailingListID int) error

DeleteMailingList removes specific mailing list

func (*MailingListsService) DeleteMailingListEmails

func (service *MailingListsService) DeleteMailingListEmails(mailingListID int, emails []string) error

DeleteMailingListEmails removes emails from specific mailing list

func (*MailingListsService) DoubleOptIn

func (service *MailingListsService) DoubleOptIn(mailingListID int, emails []*EmailToAdd, senderEmail string, messageLang string, templateID string) error

DoubleOptIn adds emails to mailing list using double-opt-in method

func (*MailingListsService) GetMailingList

func (service *MailingListsService) GetMailingList(mailingListID int) (*MailingList, error)

GetMailingList returns detailed information regarding a specific mailing list

func (*MailingListsService) GetMailingListEmails

func (service *MailingListsService) GetMailingListEmails(id, limit, offset int) ([]*Email, error)

GetMailingListEmails returns a list of emails from a mailing list

func (*MailingListsService) GetMailingListEmailsByVariable

func (service *MailingListsService) GetMailingListEmailsByVariable(mailingListID int, variable string, value interface{}) ([]*Email, error)

GetMailingListEmailsByVariable returns all contacts in mailing list by value of variable

func (*MailingListsService) GetMailingListVariables

func (service *MailingListsService) GetMailingListVariables(mailingListID int) ([]*VariableMeta, error)

GetMailingListVariables method returns variables of specific mailing list

func (*MailingListsService) GetMailingLists

func (service *MailingListsService) GetMailingLists(limit int, offset int) ([]*MailingList, error)

GetMailingLists returns a list of mailing lists

func (*MailingListsService) SingleOptIn

func (service *MailingListsService) SingleOptIn(mailingListID int, emails []*EmailToAdd) error

SingleOptIn adds emails to mailing list using single-opt-in method

func (*MailingListsService) UnsubscribeEmails

func (service *MailingListsService) UnsubscribeEmails(mailingListID int, emails []string) error

UnsubscribeEmails unsubscribes emails from a specific mailing list

func (*MailingListsService) UpdateEmailVariables

func (service *MailingListsService) UpdateEmailVariables(mailingListID int, email string, variables []*Variable) error

UpdateEmailVariables changes a variables for an email contact

type MailingRefStat

type MailingRefStat struct {
	Link  string `json:"link"`
	Count int    `json:"count"`
}

MailingRefStat represents campaign statistics of referrals

type MainTriggerBlockStat

type MainTriggerBlockStat struct {
	FlowID   int `json:"flow_id"`
	Executed int `json:"executed"`
	Deleted  int `json:"deleted"`
}

MainTriggerBlockStat represents statistics about the "Start" element

type MessengerBlockStat

type MessengerBlockStat struct {
	FlowID   int          `json:"flow_id"`
	Executed int          `json:"executed"`
	Sent     int          `json:"sent"`
	LastSend DateTimeType `json:"last_send"`
}

MessengerBlockStat represents statistics about the "Messenger" element

type PhoneInfo

type PhoneInfo struct {
	Status    int                    `json:"status"`
	Variables map[string]interface{} `json:"variables"`
	Added     DateTimeType           `json:"added"`
}

type PhoneWithVariable

type PhoneWithVariable struct {
	Phone     string
	Variables []SmsVariable
}

type Push

type Push struct {
	ID        int          `json:"id"`
	Title     string       `json:"title"`
	Body      string       `json:"body"`
	WebsiteID int          `json:"website_id"`
	From      DateTimeType `json:"from"`
	To        DateTimeType `json:"to"`
	Status    int          `json:"status"`
}

Push represents information of push notification

type PushBlockStat

type PushBlockStat struct {
	FlowID    int          `json:"flow_id"`
	Sent      int          `json:"sent"`
	Delivered int          `json:"delivered"`
	Clicked   int          `json:"clicked"`
	Errors    int          `json:"errors"`
	LastSend  DateTimeType `json:"last_send"`
}

PushBlockStat represents statistics about the "Push" element

type PushListParams

type PushListParams struct {
	Limit     int
	Offset    int
	From      time.Time
	To        time.Time
	WebsiteID int
}

PushListParams describes params for GetMessages

type PushMessageParams

type PushMessageParams struct {
	Title                string    `json:"title"`
	WebsiteID            int       `json:"website_id"`
	Body                 string    `json:"body"`
	TtlSec               int       `json:"ttl"`
	Link                 string    `json:"link,omitempty"`
	FilterLang           string    `json:"filter_lang,omitempty"`
	FilterBrowser        string    `json:"filter_browser,omitempty"`
	FilterRegion         string    `json:"filter_region,omitempty"`
	FilterUrl            string    `json:"filter_url,omitempty"`
	SubscriptionDateFrom time.Time `json:"filter_subscription_date_from,omitempty"`
	SubscriptionDateTo   time.Time `json:"filter_subscription_date_to,omitempty"`
	Filter               *struct {
		VariableName string `json:"variable_name"`
		Operator     string `json:"operator"`
		Conditions   []struct {
			Condition string      `json:"condition"`
			Value     interface{} `json:"value"`
		} `json:"conditions"`
	} `json:"filter,omitempty"`
	StretchTimeSec int          `json:"stretch_time"`
	SendDate       DateTimeType `json:"send_date"`
	Buttons        *struct {
		Text string `json:"text"`
		Link string `json:"link"`
	} `json:"buttons,omitempty"`
	Image *struct {
		Name       string `json:"name"`
		DataBase64 string `json:"data"`
	} `json:"image,omitempty"`
	Icon *struct {
		Name       string `json:"name"`
		DataBase64 string `json:"data"`
	} `json:"icon,omitempty"`
}

PushMessageParams describes parameters to CreatePushCampaign

type PushMessagesStatistics

type PushMessagesStatistics struct {
	ID      int `json:"id"`
	Message struct {
		Title string `json:"title"`
		Text  string `json:"text"`
		Link  string `json:"link"`
	}
	Website   string `json:"website"`
	WebsiteID int    `json:"website_id"`
	Status    int    `json:"status"`
	Send      int    `json:"send,string"`
	Delivered int    `json:"delivered"`
	Redirect  int    `json:"redirect"`
}

PushMessagesStatistics describes statistics on sent campaign

type PushService

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

PushService is a service to interact with push notifications

func (*PushService) ActivateSubscription

func (service *PushService) ActivateSubscription(subscriptionID int) error

ActivateSubscription activates a subscriber

func (*PushService) CountWebsiteSubscriptions

func (service *PushService) CountWebsiteSubscriptions(websiteID int) (int, error)

CountWebsiteSubscriptions returns the total number of website subscribers

func (*PushService) CountWebsites

func (service *PushService) CountWebsites() (int, error)

CountWebsites retrieves the total number of websites

func (*PushService) CreatePushCampaign

func (service *PushService) CreatePushCampaign(params PushMessageParams) (int, error)

CreatePushCampaign creates new push campaign

func (*PushService) DeactivateSubscription

func (service *PushService) DeactivateSubscription(subscriptionID int) error

DeactivateSubscription deactivates a subscriber

func (*PushService) GetMessages

func (service *PushService) GetMessages(params PushListParams) ([]Push, error)

GetMessages retrieves a list of sent web push campaigns

func (*PushService) GetPushMessagesStatistics

func (service *PushService) GetPushMessagesStatistics(taskID int) (*PushMessagesStatistics, error)

GetPushMessagesStatistics returns statistics on sent campaigns

func (*PushService) GetWebsiteInfo

func (service *PushService) GetWebsiteInfo(websiteID int) (*WebsiteInfo, error)

GetWebsiteInfo returns information about specific website

func (*PushService) GetWebsiteSubscriptions

func (service *PushService) GetWebsiteSubscriptions(websiteID int, params WebsiteSubscriptionsParams) ([]*WebsiteSubscription, error)

GetWebsiteSubscriptions returns a list subscribers for a certain website

func (*PushService) GetWebsiteVariables

func (service *PushService) GetWebsiteVariables(websiteID int) ([]*PushWebsiteVariable, error)

GetWebsiteVariables returns a list of variables for specific website

func (*PushService) GetWebsites

func (service *PushService) GetWebsites(limit, offset int) ([]*PushWebsite, error)

GetWebsites retrieves a list of websites

type PushWebsite

type PushWebsite struct {
	ID      int          `json:"id"`
	Url     string       `json:"url"`
	AddDate DateTimeType `json:"add_date"`
	Status  int          `json:"status"`
}

type PushWebsiteVariable

type PushWebsiteVariable struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
}

PushWebsiteVariable describes variable of push notification

type SendEmailParams

type SendEmailParams struct {
	Html     string `json:"html,omitempty"`
	Text     string `json:"text,omitempty"`
	Template *struct {
		ID        string                 `json:"id"`
		Variables map[string]interface{} `json:"variables"`
	} `json:"template"`
	AutoPlainText bool   `json:"auto_plain_text"`
	Subject       string `json:"subject"`
	From          struct {
		Name  string `json:"name"`
		Email string `json:"email"`
	} `json:"from"`
	To struct {
		Name  string `json:"name"`
		Email string `json:"email"`
	} `json:"to"`
	Attachments map[string]string `json:"attachments"`
}

type SendVkOkTemplateParams

type SendVkOkTemplateParams struct {
	AddressBooks []int `json:"address_book"`
	Recipients   []struct {
		Phone     string                 `json:"phone"`
		Variables map[string]interface{} `json:"variables"`
	} `json:"recipients"`
	LifeTime   int             `json:"life_time"`
	LifeType   string          `json:"life_type"`
	Name       string          `json:"name"`
	Routes     map[string]bool `json:"routes"`
	SendDate   DateTimeType    `json:"send_date"`
	TemplateID int             `json:"template_id"`
}

type Sender

type Sender struct {
	Name   string `json:"name"`
	Email  string `json:"email"`
	Status string `json:"status"`
}

type SendersService

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

func (*SendersService) ActivateSender

func (service *SendersService) ActivateSender(email, code string) error

func (*SendersService) CreateSender

func (service *SendersService) CreateSender(name string, email string) error

func (*SendersService) DeleteSender

func (service *SendersService) DeleteSender(email string) error

func (*SendersService) GetSenderActivationCode

func (service *SendersService) GetSenderActivationCode(email string) error

func (*SendersService) GetSenders

func (service *SendersService) GetSenders() ([]*Sender, error)

type SendpulseError

type SendpulseError struct {
	HttpCode int
	Url      string
	Body     string
	Message  string
}

SendpulseError represents http error from SendPulse

func (*SendpulseError) Error

func (e *SendpulseError) Error() string

Error returns string representation of the SendpulseError

type SmsBlockStat

type SmsBlockStat struct {
	FlowID    int          `json:"flow_id"`
	Executed  int          `json:"executed"`
	Sent      int          `json:"sent"`
	Delivered int          `json:"delivered"`
	Opened    int          `json:"opened"`
	Clicked   int          `json:"clicked"`
	Errors    int          `json:"errors"`
	LastSend  DateTimeType `json:"last_send"`
}

SmsBlockStat represents statistics about the "SMS" element

type SmsCampaign

type SmsCampaign struct {
	ID                int          `json:"id"`
	AddressBookID     int          `json:"address_book_id"`
	CompanyPrice      float32      `json:"company_price"`
	CompanyCurrency   string       `json:"company_currency"`
	SendDate          DateTimeType `json:"send_date"`
	DateCreated       DateTimeType `json:"date_created"`
	SenderMailAddress string       `json:"sender_mail_address"`
	SenderMailName    string       `json:"sender_mail_name"`
}

type SmsCampaignCampaignCost

type SmsCampaignCampaignCost struct {
	Price    float32 `json:"price"`
	Currency string  `json:"currency"`
}

type SmsCampaignCostParams

type SmsCampaignCostParams struct {
	AddressBookID int
	Phones        []string
	Body          string
	Sender        string
	Route         map[string]string
}

type SmsCampaignInfo

type SmsCampaignInfo struct {
	ID            int          `json:"id"`
	AddressBookID int          `json:"address_book_id"`
	Currency      string       `json:"currency"`
	CompanyPrice  float32      `json:"company_price"`
	SendDate      DateTimeType `json:"send_date"`
	DateCreated   DateTimeType `json:"date_created"`
	SenderName    string       `json:"sender_name"`
	PhonesInfo    []struct {
		Phone         int     `json:"phone"`
		Status        int     `json:"status"`
		StatusExplain string  `json:"status_explain"`
		CountryCode   string  `json:"сountry_code"`
		MoneySpent    float32 `json:"money_spent"`
	} `json:"task_phones_info"`
}

type SmsSender

type SmsSender struct {
	ID            int    `json:"id"`
	Sender        string `json:"sender"`
	Country       string `json:"country"`
	CountryCode   string `json:"country_code"`
	Status        int    `json:"status"`
	StatusExplain string `json:"status_explain"`
}

type SmsService

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

func (*SmsService) AddPhones

func (service *SmsService) AddPhones(mailingListID int, phones []string) (*AddPhonesCounters, error)

func (*SmsService) AddPhonesWithVariables

func (service *SmsService) AddPhonesWithVariables(mailingListID int, phones []*PhoneWithVariable) (*AddPhonesCounters, error)

func (*SmsService) AddToBlacklist

func (service *SmsService) AddToBlacklist(phones []string, description string) error

func (*SmsService) CancelCampaign

func (service *SmsService) CancelCampaign(id int) error

func (*SmsService) CreateCampaignByMailingList

func (service *SmsService) CreateCampaignByMailingList(params CreateSmsCampaignByAddressBookParams) (int, error)

func (*SmsService) CreateCampaignByPhones

func (service *SmsService) CreateCampaignByPhones(params CreateSmsCampaignByPhonesParams) (int, error)

func (*SmsService) DeleteCampaign

func (service *SmsService) DeleteCampaign(id int) error

func (*SmsService) DeletePhones

func (service *SmsService) DeletePhones(addressBookID int, phones []string) error

func (*SmsService) GetBlacklistedPhones

func (service *SmsService) GetBlacklistedPhones(phones []string) ([]*BlacklistPhone, error)

func (*SmsService) GetCampaignCost

func (service *SmsService) GetCampaignCost(params SmsCampaignCostParams) (*SmsCampaignCampaignCost, error)

func (*SmsService) GetCampaignInfo

func (service *SmsService) GetCampaignInfo(id int) (*SmsCampaignInfo, error)

func (*SmsService) GetCampaigns

func (service *SmsService) GetCampaigns(dateFrom, dateTo time.Time) ([]*SmsCampaign, error)

func (*SmsService) GetPhoneInfo

func (service *SmsService) GetPhoneInfo(addressBookID int, phone string) (*PhoneInfo, error)

func (*SmsService) GetSenders

func (service *SmsService) GetSenders() ([]*SmsSender, error)

func (*SmsService) RemoveFromBlacklist

func (service *SmsService) RemoveFromBlacklist(phones []string) error

func (*SmsService) UpdateVariablesMultiple

func (service *SmsService) UpdateVariablesMultiple(addressBookID int, phones []string, variables []SmsVariable) error

func (*SmsService) UpdateVariablesSingle

func (service *SmsService) UpdateVariablesSingle(addressBookID int, phone string, variables []SmsVariable) error

type SmsVariable

type SmsVariable struct {
	Name  string      `json:"name"`
	Type  string      `json:"type,omitempty"`
	Value interface{} `json:"value"`
}

type SmtpListParams

type SmtpListParams struct {
	Limit     int
	Offset    int
	From      time.Time
	To        time.Time
	Sender    string
	Recipient string
}

type SmtpMessage

type SmtpMessage struct {
	ID                    string       `json:"id"`
	Sender                string       `json:"sender"`
	TotalSize             int          `json:"total_size"`
	SenderIP              string       `json:"sender_ip"`
	SmtpAnswerCode        int          `json:"smtp_answer_code"`
	SmtpAnswerCodeExplain string       `json:"smtp_answer_code_explain"`
	SmtpAnswerSubcode     string       `json:"smtp_answer_subcode"`
	SmtpAnswerData        string       `json:"smtp_answer_data"`
	UsedIP                string       `json:"used_ip"`
	Recipient             string       `json:"recipient"`
	Subject               string       `json:"subject"`
	SendDate              DateTimeType `json:"send_date"`
	Tracking              struct {
		Click int `json:"click"`
		Open  int `json:"open"`
		Link  []*struct {
			Url              string       `json:"url"`
			Browser          string       `json:"browser"`
			Os               string       `json:"os"`
			ScreenResolution string       `json:"screen_resolution"`
			IP               string       `json:"ip"`
			ActionDate       DateTimeType `json:"action_date"`
		} `json:"link"`
		ClientInfo []*struct {
			Browser    string       `json:"browser"`
			Os         string       `json:"os"`
			IP         string       `json:"ip"`
			ActionDate DateTimeType `json:"action_date"`
		} `json:"client_info"`
	} `json:"tracking"`
}

type SmtpService

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

func (*SmtpService) AddDomain

func (service *SmtpService) AddDomain(email string) error

func (*SmtpService) CountBounces

func (service *SmtpService) CountBounces() (int, error)

func (*SmtpService) CountMessages

func (service *SmtpService) CountMessages() (int, error)

func (*SmtpService) DeleteUnsubscribedEmails

func (service *SmtpService) DeleteUnsubscribedEmails(emails []string) error

func (*SmtpService) GetAllowedDomains

func (service *SmtpService) GetAllowedDomains() ([]string, error)

func (*SmtpService) GetDailyBounces

func (service *SmtpService) GetDailyBounces(limit, offset int, date time.Time) (*BouncesList, error)

func (*SmtpService) GetMessage

func (service *SmtpService) GetMessage(id int) (*SmtpMessage, error)

func (*SmtpService) GetMessages

func (service *SmtpService) GetMessages(params SmtpListParams) ([]*SmtpMessage, error)

func (*SmtpService) GetSendersEmails

func (service *SmtpService) GetSendersEmails() ([]string, error)

func (*SmtpService) GetSendersIPs

func (service *SmtpService) GetSendersIPs() ([]string, error)

func (*SmtpService) GetUnsubscribedEmails

func (service *SmtpService) GetUnsubscribedEmails(params UnsubscribedListParams) ([]Unsubscribed, error)

func (*SmtpService) SendMessage

func (service *SmtpService) SendMessage(params SendEmailParams) (string, error)

func (*SmtpService) UnsubscribeEmails

func (service *SmtpService) UnsubscribeEmails(emails []*SmtpUnsubscribeEmail) error

func (*SmtpService) VerifyDomain

func (service *SmtpService) VerifyDomain(email string) error

type SmtpUnsubscribeEmail

type SmtpUnsubscribeEmail struct {
	Email   string `json:"email"`
	Comment string `json:"comment"`
}

type Task

type Task struct {
	ID     int    `json:"task_id"`
	Name   string `json:"task_name"`
	Status int    `json:"task_status"`
}

Task represents a campaign

type TelegramAccount

type TelegramAccount struct {
	Plan struct {
		Code         string    `json:"code"`
		MaxBots      int       `json:"max_bots"`
		MaxContacts  int       `json:"max_contacts"`
		MaxMessages  int       `json:"max_messages"`
		MaxTags      int       `json:"max_tags"`
		MaxVariables int       `json:"max_variables"`
		Branding     bool      `json:"branding"`
		IsExceeded   bool      `json:"is_exceeded"`
		IsExpired    bool      `json:"is_expired"`
		ExpiredAt    time.Time `json:"expired_at"`
	} `json:"plan"`
	Statistics struct {
		Messages  int `json:"messages"`
		Bots      int `json:"bots"`
		Contacts  int `json:"contacts"`
		Variables int `json:"variables"`
	} `json:"statistics"`
}

type TelegramBot

type TelegramBot struct {
	ID          string `json:"id"`
	ChannelData struct {
		ID          string `json:"id"`
		AccessToken string `json:"access_token"`
		Name        string `json:"name"`
		Username    string `json:"username"`
	} `json:"channel_data"`
	Inbox struct {
		Total  int `json:"total"`
		Unread int `json:"unread"`
	} `json:"inbox"`
	Status       int       `json:"status"`
	CreatedAt    time.Time `json:"created_at"`
	CommandsMenu struct {
		Status   int `json:"status"`
		Commands []struct {
			Description string `json:"description"`
			Command     string `json:"command"`
			FlowID      string `json:"flow_id"`
		}
	} `json:"commands_menu"`
}

type TelegramBotCampaignMessage

type TelegramBotCampaignMessage struct {
	Type    string `json:"type"`
	Message struct {
		Text string `json:"text"`
	} `json:"message"`
}

type TelegramBotChat

type TelegramBotChat struct {
	Contact          *TelegramBotContact `json:"contact"`
	InboxLastMessage *TelegramBotMessage `json:"inbox_last_message"`
	InboxUnread      int                 `json:"inbox_unread"`
}

type TelegramBotContact

type TelegramBotContact struct {
	ID          string `json:"id"`
	BotID       string `json:"bot_id"`
	Status      int    `json:"status"`
	ChannelData struct {
		Username     string `json:"username"`
		FirstName    string `json:"first_name"`
		LastName     string `json:"last_name"`
		Name         string `json:"name"`
		LanguageCode string `json:"language_code"`
	} `json:"channel_data"`
	Tags                  []string               `json:"tags"`
	Variables             map[string]interface{} `json:"variables"`
	IsChatOpened          bool                   `json:"is_chat_opened"`
	LastActivityAt        time.Time              `json:"last_activity_at"`
	AutomationPausedUntil time.Time              `json:"automation_paused_until"`
	CreatedAt             time.Time              `json:"created_at"`
}

type TelegramBotMessage

type TelegramBotMessage struct {
	ID         string                 `json:"id"`
	ContactID  string                 `json:"contact_id"`
	BotID      string                 `json:"bot_id"`
	CampaignID string                 `json:"campaign_id"`
	Data       map[string]interface{} `json:"data"`
	Direction  int                    `json:"direction"`
	Status     int                    `json:"status"`
	CreatedAt  time.Time              `json:"created_at"`
}

type TelegramBotSendCampaignParams

type TelegramBotSendCampaignParams struct {
	Title    string                       `json:"title"`
	BotID    string                       `json:"bot_id"`
	SendAt   time.Time                    `json:"send_at"`
	Messages []TelegramBotCampaignMessage `json:"messages"`
}

type Template

type Template struct {
	ID              string            `json:"id"`
	RealID          int               `json:"real_id"`
	Name            string            `json:"name"`
	NameSlug        string            `json:"name_slug"`
	Lang            string            `json:"lang"`
	MetaDescription string            `json:"meta_description"`
	FullDescription string            `json:"full_description"`
	Category        string            `json:"category"`
	CategoryInfo    *TemplateCategory `json:"category_info"`
	Tags            map[string]string `json:"tags"`
	Mark            string            `json:"mark"`       //
	MarkCount       int               `json:"mark_count"` //
	Body            string            `json:"body"`       //
	Owner           string            `json:"owner"`
	Created         DateTimeType      `json:"created"`
	Preview         string            `json:"preview"`
	IsStructure     bool              `json:"is_structure"`
}

func (*Template) UnmarshalJSON

func (t *Template) UnmarshalJSON(data []byte) error

type TemplateCategory

type TemplateCategory struct {
	ID              int    `json:"id"`
	Name            string `json:"name"`
	MetaDescription string `json:"meta_description"`
	FullDescription string `json:"full_description"`
	Code            string `json:"code"`
	Sort            int    `json:"sort"`
}

type TemplatesService

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

func (*TemplatesService) CreateTemplate

func (service *TemplatesService) CreateTemplate(name string, body string, lang string) (int, error)

func (*TemplatesService) GetTemplate

func (service *TemplatesService) GetTemplate(templateID int) (*Template, error)

func (*TemplatesService) GetTemplates

func (service *TemplatesService) GetTemplates(limit, offset int, owner string) ([]*Template, error)

func (*TemplatesService) UpdateTemplate

func (service *TemplatesService) UpdateTemplate(templateID int, body string, lang string) error

type TriggerBlockStat

type TriggerBlockStat struct {
	FlowID   int          `json:"flow_id"`
	Executed int          `json:"executed"`
	LastSend DateTimeType `json:"last_send"`
}

TriggerBlockStat represents statistics about the "Condition" element

type Unsubscribed

type Unsubscribed struct {
	Email             string       `json:"email"`
	UnsubscribeByLink int          `json:"unsubscribe_by_link"`
	UnsubscribeByUser int          `json:"unsubscribe_by_user"`
	SpamComplaint     int          `json:"spam_complaint"`
	Date              DateTimeType `json:"date"`
}

type UnsubscribedListParams

type UnsubscribedListParams struct {
	Limit  int
	Offset int
	Date   time.Time
}

type UpdateViberCampaignParams

type UpdateViberCampaignParams struct {
	TaskID          int          `json:"main_task_id"`
	TaskName        string       `json:"task_name"`
	Message         string       `json:"message"`
	MessageType     int          `json:"message_type"`
	ButtonText      string       `json:"button_text,omitempty"`
	ButtonLink      string       `json:"button_link,omitempty"`
	ImageLink       string       `json:"image_link,omitempty"`
	AddressBookID   int          `json:"address_book,omitempty"`
	SenderID        int          `json:"sender_id"`
	MessageLiveTime int          `json:"message_live_time"`
	SendDate        DateTimeType `json:"send_date"`
}

type ValidationProgress

type ValidationProgress struct {
	Total     int `json:"total"`
	Processed int `json:"processed"`
}

ValidationProgress is a results of mailing list validation progress

type ValidatorService

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

ValidatorService is a service to validate email addresses

func (*ValidatorService) CreateMailingListValidationReport

func (service *ValidatorService) CreateMailingListValidationReport(params MailingListReportParams) error

CreateMailingListValidationReport creates a report with the verification results for a given mailing list

func (*ValidatorService) DeleteEmailValidationResult

func (service *ValidatorService) DeleteEmailValidationResult(email string) error

DeleteEmailValidationResult removes the result of checking one address

func (*ValidatorService) GetEmailValidationResult

func (service *ValidatorService) GetEmailValidationResult(email string) (*EmailValidationResult, error)

GetEmailValidationResult returns the results of a verification of specific email

func (*ValidatorService) GetMailingListValidationProgress

func (service *ValidatorService) GetMailingListValidationProgress(mailingListID int) (*ValidationProgress, error)

GetMailingListValidationProgress returns a progress of mailing list validation

func (*ValidatorService) GetMailingListValidationReport

func (service *ValidatorService) GetMailingListValidationReport(mailingListID int) (*MailingListValidationResultDetailed, error)

GetMailingListValidationReport returns a report with the results of a mailing list verification

func (*ValidatorService) GetMailingListValidationResult

func (service *ValidatorService) GetMailingListValidationResult(mailingListID int) (*MailingListValidationResultDetailed, error)

GetMailingListValidationResult returns a list of email addresses from a mailing list with their verification results

func (*ValidatorService) GetValidatedMailingLists

func (service *ValidatorService) GetValidatedMailingLists(limit, offset int) ([]*MailingListValidationResult, error)

GetValidatedMailingLists returns a list of verified mailing lists

func (*ValidatorService) ValidateEmail

func (service *ValidatorService) ValidateEmail(email string) error

ValidateEmail verifies one email address

func (*ValidatorService) ValidateMailingList

func (service *ValidatorService) ValidateMailingList(mailingListID int) error

ValidateMailingList sends a mailing list for review

type Variable

type Variable struct {
	Name  string      `json:"name"`
	Type  string      `json:"type,omitempty"`
	Value interface{} `json:"value"`
}

Variable represents a variable of email address

type VariableMeta

type VariableMeta struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

VariableMeta method represents a variable of mailing list

type ViberCampaign

type ViberCampaign struct {
	ID              int          `json:"id"`
	Name            string       `json:"name"`
	Message         string       `json:"message"`
	ButtonText      string       `json:"button_text"`
	ButtonLink      string       `json:"button_link"`
	ImageLink       string       `json:"image_link"`
	AddressBookID   int          `json:"address_book"`
	SenderName      string       `json:"sender_name"`
	SenderID        int          `json:"sender_id"`
	MessageLiveTime int          `json:"message_live_time"`
	SendDate        DateTimeType `json:"send_date"`
	Status          string       `json:"status"`
	Created         DateTimeType `json:"created"`
}

type ViberCampaignStatistics

type ViberCampaignStatistics struct {
	ID            int          `json:"id"`
	Name          string       `json:"name"`
	Message       string       `json:"message"`
	ButtonText    string       `json:"button_text"`
	ButtonLink    string       `json:"button_link"`
	ImageLink     string       `json:"image_link"`
	AddressBookID int          `json:"address_book"`
	SenderName    string       `json:"sender_name"`
	SendDate      DateTimeType `json:"send_date"`
	Status        string       `json:"status"`
	Statistics    struct {
		Sent        int `json:"sent"`
		Delivered   int `json:"delivered"`
		Read        int `json:"read"`
		Redirected  int `json:"redirected"`
		Undelivered int `json:"undelivered"`
		Errors      int `json:"errors"`
	} `json:"statistic"`
	Created DateTimeType `json:"created"`
}

type ViberRecipient

type ViberRecipient struct {
	Phone         int          `json:"phone"`
	AddressBookID int          `json:"address_book_id"`
	Status        string       `json:"status"`
	SendDate      DateTimeType `json:"send_date"`
	Price         float32      `json:"price"`
	Currency      string       `json:"currency"`
	LastUpdate    DateTimeType `json:"last_update"`
}

type ViberSender

type ViberSender struct {
	ID           int      `json:"id"`
	Status       string   `json:"status"`
	Name         string   `json:"name"`
	ServiceType  string   `json:"service_type"`
	WebSite      string   `json:"web_site"`
	Description  string   `json:"description"`
	Countries    []string `json:"countries"`
	TrafficType  string   `json:"traffic_type"`
	AdminComment string   `json:"admin_comment"`
	Owner        string   `json:"owner"`
}

type ViberService

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

func (*ViberService) CreateCampaign

func (service *ViberService) CreateCampaign(params CreateViberCampaignParams) (int, error)

func (*ViberService) GetCampaigns

func (service *ViberService) GetCampaigns(limit, offset int) ([]*ViberCampaign, error)

func (*ViberService) GetRecipients

func (service *ViberService) GetRecipients(taskID int) ([]*ViberRecipient, error)

func (*ViberService) GetSender

func (service *ViberService) GetSender(senderID int) (*ViberSender, error)

func (*ViberService) GetSenders

func (service *ViberService) GetSenders() ([]*ViberSender, error)

func (*ViberService) GetStatistics

func (service *ViberService) GetStatistics(campaignID int) (*ViberCampaignStatistics, error)

func (*ViberService) UpdateCampaign

func (service *ViberService) UpdateCampaign(params UpdateViberCampaignParams) error

type VkAccount

type VkAccount struct {
	Plan struct {
		Code         string    `json:"code"`
		MaxBots      int       `json:"max_bots"`
		MaxContacts  int       `json:"max_contacts"`
		MaxMessages  int       `json:"max_messages"`
		MaxTags      int       `json:"max_tags"`
		MaxVariables int       `json:"max_variables"`
		Branding     bool      `json:"branding"`
		IsExceeded   bool      `json:"is_exceeded"`
		IsExpired    bool      `json:"is_expired"`
		ExpiredAt    time.Time `json:"expired_at"`
	} `json:"plan"`
	Statistics struct {
		Messages  int `json:"messages"`
		Bots      int `json:"bots"`
		Contacts  int `json:"contacts"`
		Variables int `json:"variables"`
	} `json:"statistics"`
}

type VkBot

type VkBot struct {
	ID          string `json:"id"`
	ChannelData struct {
		ID          string `json:"id"`
		AccessToken string `json:"access_token"`
		Name        string `json:"name"`
		Photo       string `json:"photo"`
	} `json:"channel_data"`
	Inbox struct {
		Total  int `json:"total"`
		Unread int `json:"unread"`
	} `json:"inbox"`
	Status    int       `json:"status"`
	CreatedAt time.Time `json:"created_at"`
}

type VkBotCampaignMessage

type VkBotCampaignMessage struct {
	Type    string `json:"type"`
	Message struct {
		Text string `json:"text"`
	} `json:"message"`
}

type VkBotChat

type VkBotChat struct {
	Contact          *VkBotContact `json:"contact"`
	InboxLastMessage *VkBotMessage `json:"inbox_last_message"`
	InboxUnread      int           `json:"inbox_unread"`
}

type VkBotContact

type VkBotContact struct {
	ID          string `json:"id"`
	BotID       string `json:"bot_id"`
	Status      int    `json:"status"`
	ChannelData struct {
		GroupID  int         `json:"group_id"`
		IsMember bool        `json:"is_member"`
		Name     string      `json:"name"`
		Data     interface{} `json:"data"`
	} `json:"channel_data"`
	Tags                  []string               `json:"tags"`
	Variables             map[string]interface{} `json:"variables"`
	IsChatOpened          bool                   `json:"is_chat_opened"`
	LastActivityAt        time.Time              `json:"last_activity_at"`
	AutomationPausedUntil time.Time              `json:"automation_paused_until"`
	CreatedAt             time.Time              `json:"created_at"`
}

type VkBotMessage

type VkBotMessage struct {
	ID         string                 `json:"id"`
	ContactID  string                 `json:"contact_id"`
	BotID      string                 `json:"bot_id"`
	CampaignID string                 `json:"campaign_id"`
	Data       map[string]interface{} `json:"data"`
	Direction  int                    `json:"direction"`
	Status     int                    `json:"status"`
	CreatedAt  time.Time              `json:"created_at"`
}

type VkBotSendCampaignParams

type VkBotSendCampaignParams struct {
	Title    string                 `json:"title"`
	BotID    string                 `json:"bot_id"`
	SendAt   time.Time              `json:"send_at"`
	Messages []VkBotCampaignMessage `json:"messages"`
}

type VkOkCampaignPhone

type VkOkCampaignPhone struct {
	ID           int          `json:"id"`
	UserID       int          `json:"user_id"`
	CampaignID   int          `json:"campaign_id"`
	TemplateID   int          `json:"template_id"`
	Phone        int          `json:"phone"`
	PhoneCost    int          `json:"phone_cost"`
	CurrencyID   int          `json:"currency_id"`
	PriceRate    int          `json:"price_rate"`
	Currency     VkOkCurrency `json:"currency"`
	CreatedAt    string       `json:"created_at"`
	Status       int          `json:"status"`
	StatusDetail struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"status_detail"`
}

type VkOkCampaignStatistics

type VkOkCampaignStatistics struct {
	ID           int          `json:"id"`
	UserID       int          `json:"user_id"`
	Name         string       `json:"name"`
	TotalPrice   int          `json:"total_price"`
	PriceRate    int          `json:"price_rate"`
	Currency     VkOkCurrency `json:"currency"`
	LifeTime     int          `json:"life_time"`
	LifeType     string       `json:"life_type"`
	SendDate     string       `json:"send_date"`
	CreatedAt    string       `json:"created_at"`
	Template     VkOkTemplate `json:"template"`
	Status       int          `json:"status"`
	StatusDetail struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"status_detail"`
	GroupStat []struct {
		ID           int `json:"id"`
		UserID       int `json:"user_id"`
		Sent         int `json:"sent"`
		Delivered    int `json:"delivered"`
		NotDelivered int `json:"not_delivered"`
		Opened       int `json:"opened"`
	} `json:"group_stat"`
}

type VkOkCurrency

type VkOkCurrency struct {
	ID   int    `json:"id"`
	Name string `json:"currency_name"`
	Abbr string `json:"currency_abbr"`
	Sign string `json:"currency_sign"`
}

type VkOkService

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

func (*VkOkService) CreateSender

func (service *VkOkService) CreateSender(params CreateVkOkSenderParams) (int, error)

func (*VkOkService) CreateTemplate

func (service *VkOkService) CreateTemplate(params CreateVkOkTemplateParams) (int, error)

func (*VkOkService) GetCampaignPhones

func (service *VkOkService) GetCampaignPhones(campaignID int) ([]*VkOkCampaignPhone, error)

func (*VkOkService) GetCampaignStatistics

func (service *VkOkService) GetCampaignStatistics(campaignID int) (*VkOkCampaignStatistics, error)

func (*VkOkService) GetCampaignsStatistics

func (service *VkOkService) GetCampaignsStatistics() ([]*VkOkCampaignStatistics, error)

func (*VkOkService) GetTemplate

func (service *VkOkService) GetTemplate(templateID int) (*VkOkTemplate, error)

func (*VkOkService) GetTemplates

func (service *VkOkService) GetTemplates() ([]*VkOkTemplate, error)

func (*VkOkService) Send

func (service *VkOkService) Send(params SendVkOkTemplateParams) (int, error)

type VkOkTemplate

type VkOkTemplate struct {
	ID        int    `json:"id"`
	UserID    int    `json:"user_id"`
	SenderID  int    `json:"sender_id"`
	Name      string `json:"name"`
	VkMessage string `json:"vk_message"`
	OkMessage string `json:"ok_message"`
	Sender    struct {
		ID        int    `json:"id"`
		UserID    int    `json:"user_id"`
		Name      string `json:"name"`
		VkUrl     string `json:"vk_url"`
		OkUrl     string `json:"ok_url"`
		CreatedAt string `json:"created_at"`
		UpdateAt  string `json:"update_at"`
	} `json:"sender"`
	Status       int `json:"status"`
	StatusDetail struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"status_detail"`
}

type Webhook

type Webhook struct {
	ID     int    `json:"id"`
	UserID int    `json:"user_id"`
	Url    string `json:"url"`
	Action string `json:"action"`
}

Webhook describes webhook information

type WebhooksService

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

WebhooksService is a service to interact with webhooks

func (*WebhooksService) CreateWebhook

func (service *WebhooksService) CreateWebhook(actions []string, url string) ([]*Webhook, error)

CreateWebhook creates webhook

func (*WebhooksService) DeleteWebhook

func (service *WebhooksService) DeleteWebhook(id int) error

DeleteWebhook deletes a specific webhook

func (*WebhooksService) GetWebhook

func (service *WebhooksService) GetWebhook(id int) (*Webhook, error)

GetWebhook returns specific webhook

func (*WebhooksService) GetWebhooks

func (service *WebhooksService) GetWebhooks() ([]*Webhook, error)

GetWebhooks returns a list of webhooks

func (*WebhooksService) UpdateWebhook

func (service *WebhooksService) UpdateWebhook(id int, url string) error

UpdateWebhook updates a specific webhook

type WebsiteInfo

type WebsiteInfo struct {
	ID                int          `json:"id"`
	Url               string       `json:"url"`
	Status            string       `json:"status"`
	Icon              string       `json:"icon"`
	AddDate           DateTimeType `json:"add_date"`
	TotalSubscribers  int          `json:"total_subscribers"`
	Unsubscribed      int          `json:"unsubscribed"`
	SubscribersToday  int          `json:"subscribers_today"`
	ActiveSubscribers int          `json:"active_subscribers"`
}

WebsiteInfo describes information about website

type WebsiteSubscription

type WebsiteSubscription struct {
	ID               int                   `json:"id"`
	Browser          string                `json:"browser"`
	Lang             string                `json:"lang"`
	Os               string                `json:"os"`
	CountryCode      string                `json:"country_code"`
	City             string                `json:"city"`
	Variables        []PushWebsiteVariable `json:"variables"`
	SubscriptionDate DateTimeType          `json:"subscription_date"`
	Status           int                   `json:"status"`
}

WebsiteSubscription represents subscriber

type WebsiteSubscriptionsParams

type WebsiteSubscriptionsParams struct {
	Limit  int
	Offset int
	From   time.Time
	To     time.Time
}

WebsiteSubscriptionsParams describes params for GetWebsiteSubscriptions

type WhatsAppAccount

type WhatsAppAccount struct {
	Plan struct {
		Branding     bool      `json:"branding"`
		MaxBots      int       `json:"max_bots"`
		MaxContacts  int       `json:"max_contacts"`
		MaxMessages  int       `json:"max_messages"`
		MaxTags      int       `json:"max_tags"`
		MaxVariables int       `json:"max_variables"`
		Code         string    `json:"code"`
		IsExceeded   bool      `json:"is_exceeded"`
		IsExpired    bool      `json:"is_expired"`
		ExpiredAt    time.Time `json:"expired_at"`
	} `json:"plan"`
	Statistics struct {
		Messages  int `json:"messages"`
		Bots      int `json:"bots"`
		Contacts  int `json:"contacts"`
		Variables int `json:"variables"`
	} `json:"statistics"`
}

type WhatsAppBot

type WhatsAppBot struct {
	ID          string `json:"id"`
	ChannelData struct {
		Name  string `json:"name"`
		Phone string `json:"phone"`
	} `json:"channel_data"`
	Inbox struct {
		Total  int `json:"total"`
		Unread int `json:"unread"`
	} `json:"inbox"`
	Status    int       `json:"status"`
	CreatedAt time.Time `json:"created_at"`
}

type WhatsAppBotChat

type WhatsAppBotChat struct {
	Contact          *WhatsAppBotContact `json:"contact"`
	InboxLastMessage *FbBotMessage       `json:"inbox_last_message"`
	InboxUnread      int                 `json:"inbox_unread"`
}

type WhatsAppBotContact

type WhatsAppBotContact struct {
	ID          string `json:"id"`
	BotID       string `json:"bot_id"`
	Status      int    `json:"status"`
	ChannelData struct {
		UserName     string `json:"username"`
		FirstName    string `json:"first_name"`
		LastName     string `json:"last_name"`
		Name         string `json:"name"`
		LanguageCode string `json:"language_code"`
	} `json:"channel_data"`
	Tags                  []string               `json:"tags"`
	Variables             map[string]interface{} `json:"variables"`
	IsChatOpened          bool                   `json:"is_chat_opened"`
	LastActivityAt        time.Time              `json:"last_activity_at"`
	AutomationPausedUntil time.Time              `json:"automation_paused_until"`
	CreatedAt             time.Time              `json:"created_at"`
}

type WhatsAppBotMessage

type WhatsAppBotMessage struct {
	ID         string                 `json:"id"`
	ContactID  string                 `json:"contact_id"`
	BotID      string                 `json:"bot_id"`
	CampaignID string                 `json:"campaign_id"`
	Data       map[string]interface{} `json:"data"`
	Direction  int                    `json:"direction"`
	Status     int                    `json:"status"`
	CreatedAt  time.Time              `json:"created_at"`
}

type WhatsAppBotSendCampaignByTemplateParams

type WhatsAppBotSendCampaignByTemplateParams struct {
	Title        string
	BotID        string
	SendAt       time.Time
	Messages     []WhatsAppMessage
	TemplateName string
	LanguageCode string
}

type WhatsAppBotSendCampaignParams

type WhatsAppBotSendCampaignParams struct {
	Title    string            `json:"title"`
	BotID    string            `json:"bot_id"`
	SendAt   time.Time         `json:"send_at"`
	Messages []WhatsAppMessage `json:"messages"`
}

type WhatsAppMessage

type WhatsAppMessage struct {
	Type string `json:"type"`
	Text *struct {
		Body string `json:"body"`
	} `json:"text,omitempty"`
	Image *struct {
		Link    string `json:"link"`
		Caption string `json:"caption"`
	} `json:"image,omitempty"`
	Document *struct {
		Link    string `json:"link"`
		Caption string `json:"caption"`
	} `json:"document,omitempty"`
}

type WhatsAppTemplate

type WhatsAppTemplate struct {
	ID             string            `json:"id"`
	BotID          string            `json:"bot_id"`
	Namespace      string            `json:"namespace"`
	Category       string            `json:"category"`
	Components     []WhatsAppMessage `json:"components"`
	Language       string            `json:"language"`
	Name           string            `json:"name"`
	RejectedReason string            `json:"rejected_reason"`
	Status         string            `json:"status"`
	CreatedAt      time.Time         `json:"created_at"`
}

Jump to

Keyboard shortcuts

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