sendpulse_sdk_go

package module
v7.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: MIT Imports: 17 Imported by: 0

README

SendPulse REST client library (unofficial)

An unofficial SendPulse SDK client library for Go (Golang). This library allows to use the SendPulse API via Go.

SendPulse API official documentation https://sendpulse.com/api

Build Status codecov Go Report Card License

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

import (
    "context"
    "fmt"
    sendpulse "github.com/kvarts/sendpulse-sdk-go/v7"
    "net/http"
)

func main() {
    config := &sendpulse.Config{
        UserID: "",
        Secret: "",
    }
    client := sendpulse.NewClient(http.DefaultClient, config)

    emails := []*sendpulse.EmailToAdd {
        &sendpulse.EmailToAdd{
            Email:     "test@test.com",
            Variables: map[string]interface{}{"age": 21, "weight": 99},
        },
    }
    
    ctx := context.Background()
    if err := client.Emails.MailingLists.SingleOptIn(ctx, 1266208, emails); err != nil {
        fmt.Println(err)
    }
    fmt.Println(*emails[0])
}

The tests should be considered a part of the documentation.

License

The MIT License (MIT)

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(ctx context.Context, 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(ctx context.Context, email string) error

DeleteFromAllAddressBooks removes specific email address from all address books

func (*AddressService) GetDetails

func (service *AddressService) GetDetails(ctx context.Context, email string) ([]*EmailInfoList, error)

GetDetails retrieves detailed information about specific email address

func (*AddressService) GetEmailInfo

func (service *AddressService) GetEmailInfo(ctx context.Context, email string) ([]*EmailInfo, error)

GetEmailInfo returns general information about specific email address

func (*AddressService) GetEmailStatisticsByCampaignsAndAddressBooks

func (service *AddressService) GetEmailStatisticsByCampaignsAndAddressBooks(ctx context.Context, email string) (*CampaignsEmailStatistics, error)

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

func (*AddressService) GetEmailsInfo

func (service *AddressService) GetEmailsInfo(ctx context.Context, emails []string) (map[string][]*EmailInfo, error)

GetEmailsInfo retrieves general informaion for a List of Email Addresses

func (*AddressService) GetEmailsStatisticsByCampaignsAndAddressBooks

func (service *AddressService) GetEmailsStatisticsByCampaignsAndAddressBooks(ctx context.Context, 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(ctx context.Context, 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(ctx context.Context, 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(ctx context.Context, id int) (*ActionBlockStat, error)

GetActionBlockStatistics returns statistics about the "Action" element

func (*Automation360Service) GetAutoresponderContacts

func (service *Automation360Service) GetAutoresponderContacts(ctx context.Context, id int) ([]*AutoresponderContact, error)

GetAutoresponderContacts returns a list of the contacts that converted

func (*Automation360Service) GetAutoresponderConversions

func (service *Automation360Service) GetAutoresponderConversions(ctx context.Context, id int) (*AutoresponderConversion, error)

GetAutoresponderConversions returns the flow conversions list

func (*Automation360Service) GetAutoresponderStatistics

func (service *Automation360Service) GetAutoresponderStatistics(ctx context.Context, id int) (*Autoresponder, error)

GetAutoresponderStatistics returns statistics about an automation flow

func (*Automation360Service) GetEmailBlockStatistics

func (service *Automation360Service) GetEmailBlockStatistics(ctx context.Context, id int) (*EmailBlockStat, error)

GetEmailBlockStatistics returns statistics about the "Email" element

func (*Automation360Service) GetFilterBlockStatistics

func (service *Automation360Service) GetFilterBlockStatistics(ctx context.Context, id int) (*FilterBlockStat, error)

GetFilterBlockStatistics returns statistics about the "Filter" element

func (*Automation360Service) GetGoalBlockStatistics

func (service *Automation360Service) GetGoalBlockStatistics(ctx context.Context, id int) (*GoalBlockStat, error)

GetGoalBlockStatistics returns statistics about the "Goal" element

func (*Automation360Service) GetMessengerBlockStatistics

func (service *Automation360Service) GetMessengerBlockStatistics(ctx context.Context, id int) (*MessengerBlockStat, error)

GetMessengerBlockStatistics returns statistics about the "Messenger" element

func (*Automation360Service) GetPushBlockStatistics

func (service *Automation360Service) GetPushBlockStatistics(ctx context.Context, id int) (*PushBlockStat, error)

GetPushBlockStatistics returns statistics about the "Push" element

func (*Automation360Service) GetSmsBlockStatistics

func (service *Automation360Service) GetSmsBlockStatistics(ctx context.Context, id int) (*SmsBlockStat, error)

GetSmsBlockStatistics returns statistics about the "SMS" element

func (*Automation360Service) GetStartBlockStatistics

func (service *Automation360Service) GetStartBlockStatistics(ctx context.Context, id int) (*MainTriggerBlockStat, error)

GetStartBlockStatistics returns statistics about the "Start" element

func (*Automation360Service) GetTriggerBlockStatistics

func (service *Automation360Service) GetTriggerBlockStatistics(ctx context.Context, id int) (*TriggerBlockStat, error)

GetTriggerBlockStatistics returns statistics about the "Condition" element

func (*Automation360Service) StartEvent

func (service *Automation360Service) StartEvent(ctx context.Context, 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(ctx context.Context, currency string) (*Balance, error)

GetBalance returns main information about users's balance

func (*BalanceService) GetDetailedBalance

func (service *BalanceService) GetDetailedBalance(ctx context.Context) (*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(ctx context.Context, emails []string, comment string) error

AddToBlacklist appends an email addresses to a blacklist

func (*BlacklistService) GetEmails

func (service *BlacklistService) GetEmails(ctx context.Context) ([]string, error)

GetEmails returns a list of emails added to blacklist

func (*BlacklistService) RemoveFromBlacklist

func (service *BlacklistService) RemoveFromBlacklist(ctx context.Context, 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 BotIgFlow

type BotIgFlow struct {
	ID     string `json:"id"`
	BotID  string `json:"bot_id"`
	Name   string `json:"name"`
	Status struct {
		Active   int `json:"ACTIVE"`
		Inactive int `json:"INACTIVE"`
		Draft    int `json:"DRAFT"`
	} `json:"status"`
	Triggers []struct {
		ID   string `json:"id"`
		Name string `json:"name"`
		Type int    `json:"type"`
	} `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(ctx context.Context, contactID string) error

func (*BotsFbService) DeletePauseAutomation

func (service *BotsFbService) DeletePauseAutomation(ctx context.Context, contactID string) error

func (*BotsFbService) DeleteTagFromContact

func (service *BotsFbService) DeleteTagFromContact(ctx context.Context, contactID string, tag string) error

func (*BotsFbService) DisableContact

func (service *BotsFbService) DisableContact(ctx context.Context, contactID string) error

func (*BotsFbService) EnableContact

func (service *BotsFbService) EnableContact(ctx context.Context, contactID string) error

func (*BotsFbService) GetAccount

func (service *BotsFbService) GetAccount(ctx context.Context) (*FbAccount, error)

func (*BotsFbService) GetBotChats

func (service *BotsFbService) GetBotChats(ctx context.Context, botID string) ([]*FbBotChat, error)

func (*BotsFbService) GetBotTriggers

func (service *BotsFbService) GetBotTriggers(ctx context.Context, botID string) ([]*BotTrigger, error)

func (*BotsFbService) GetBotVariables

func (service *BotsFbService) GetBotVariables(ctx context.Context, botID string) ([]*BotVariable, error)

func (*BotsFbService) GetBots

func (service *BotsFbService) GetBots(ctx context.Context) ([]*FbBot, error)

func (*BotsFbService) GetContact

func (service *BotsFbService) GetContact(ctx context.Context, contactID string) (*FbBotContact, error)

func (*BotsFbService) GetContactMessages

func (service *BotsFbService) GetContactMessages(ctx context.Context, contactID string) ([]*FbBotMessage, error)

func (*BotsFbService) GetContactsByTag

func (service *BotsFbService) GetContactsByTag(ctx context.Context, tag, botID string) ([]*FbBotContact, error)

func (*BotsFbService) GetContactsByVariable

func (service *BotsFbService) GetContactsByVariable(ctx context.Context, params BotContactsByVariableParams) ([]*FbBotContact, error)

func (*BotsFbService) GetFlows

func (service *BotsFbService) GetFlows(ctx context.Context, botID string) ([]*BotFlow, error)

func (*BotsFbService) GetPauseAutomation

func (service *BotsFbService) GetPauseAutomation(ctx context.Context, contactID string) (int, error)

func (*BotsFbService) RunFlow

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

func (*BotsFbService) RunFlowByTrigger

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

func (*BotsFbService) SendCampaign

func (service *BotsFbService) SendCampaign(ctx context.Context, params FbBotSendCampaignParams) error

func (*BotsFbService) SendTextByContact

func (service *BotsFbService) SendTextByContact(ctx context.Context, params FbBotSendTextParams) error

func (*BotsFbService) SetPauseAutomation

func (service *BotsFbService) SetPauseAutomation(ctx context.Context, contactID string, minutes int) error

func (*BotsFbService) SetTagsToContact

func (service *BotsFbService) SetTagsToContact(ctx context.Context, contactID string, tags []string) error

func (*BotsFbService) SetVariableToContact

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

type BotsIgService

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

func (*BotsIgService) DeleteContact

func (service *BotsIgService) DeleteContact(ctx context.Context, contactID string) error

func (*BotsIgService) DeletePauseAutomation

func (service *BotsIgService) DeletePauseAutomation(ctx context.Context, contactID string) error

func (*BotsIgService) DeleteTagFromContact

func (service *BotsIgService) DeleteTagFromContact(ctx context.Context, contactID string, tag string) error

func (*BotsIgService) DisableContact

func (service *BotsIgService) DisableContact(ctx context.Context, contactID string) error

func (*BotsIgService) EnableContact

func (service *BotsIgService) EnableContact(ctx context.Context, contactID string) error

func (*BotsIgService) GetAccount

func (service *BotsIgService) GetAccount(ctx context.Context) (*IgAccount, error)

func (*BotsIgService) GetBotChats

func (service *BotsIgService) GetBotChats(ctx context.Context, botID string) ([]*IgBotChat, error)

func (*BotsIgService) GetBotTriggers

func (service *BotsIgService) GetBotTriggers(ctx context.Context, botID string) ([]*BotTrigger, error)

func (*BotsIgService) GetBotVariables

func (service *BotsIgService) GetBotVariables(ctx context.Context, botID string) ([]*BotVariable, error)

func (*BotsIgService) GetBots

func (service *BotsIgService) GetBots(ctx context.Context) ([]*IgBot, error)

func (*BotsIgService) GetContact

func (service *BotsIgService) GetContact(ctx context.Context, contactID string) (*IgBotContact, error)

func (*BotsIgService) GetContactMessages

func (service *BotsIgService) GetContactMessages(ctx context.Context, contactID string) ([]*IgBotMessage, error)

func (*BotsIgService) GetContactsByTag

func (service *BotsIgService) GetContactsByTag(ctx context.Context, tag, botID string) ([]*IgBotContact, error)

func (*BotsIgService) GetContactsByVariable

func (service *BotsIgService) GetContactsByVariable(ctx context.Context, params BotContactsByVariableParams) ([]*IgBotContact, error)

func (*BotsIgService) GetFlows

func (service *BotsIgService) GetFlows(ctx context.Context, botID string) ([]*BotIgFlow, error)

func (*BotsIgService) GetPauseAutomation

func (service *BotsIgService) GetPauseAutomation(ctx context.Context, contactID string) (int, error)

func (*BotsIgService) RunFlow

func (service *BotsIgService) RunFlow(ctx context.Context, contactID, flowID string, externalData map[string]interface{}) error

func (*BotsIgService) RunFlowByTrigger

func (service *BotsIgService) RunFlowByTrigger(ctx context.Context, contactID, triggerKeyword string, externalData map[string]interface{}) error

func (*BotsIgService) SendCampaign

func (service *BotsIgService) SendCampaign(ctx context.Context, params IgBotSendCampaignParams) error

func (*BotsIgService) SendTextByContact

func (service *BotsIgService) SendTextByContact(ctx context.Context, params IgBotSendMessagesParams) error

func (*BotsIgService) SetPauseAutomation

func (service *BotsIgService) SetPauseAutomation(ctx context.Context, contactID string, minutes int) error

func (*BotsIgService) SetTagsToContact

func (service *BotsIgService) SetTagsToContact(ctx context.Context, contactID string, tags []string) error

func (*BotsIgService) SetVariableToContact

func (service *BotsIgService) SetVariableToContact(ctx context.Context, contactID string, variableID string, variableName string, variableValue interface{}) error

type BotsService

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

type BotsTelegramService

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

func (*BotsTelegramService) DeleteContact

func (service *BotsTelegramService) DeleteContact(ctx context.Context, contactID string) error

func (*BotsTelegramService) DeletePauseAutomation

func (service *BotsTelegramService) DeletePauseAutomation(ctx context.Context, contactID string) error

func (*BotsTelegramService) DeleteTagFromContact

func (service *BotsTelegramService) DeleteTagFromContact(ctx context.Context, contactID string, tag string) error

func (*BotsTelegramService) DisableContact

func (service *BotsTelegramService) DisableContact(ctx context.Context, contactID string) error

func (*BotsTelegramService) EnableContact

func (service *BotsTelegramService) EnableContact(ctx context.Context, contactID string) error

func (*BotsTelegramService) GetAccount

func (service *BotsTelegramService) GetAccount(ctx context.Context) (*TelegramAccount, error)

func (*BotsTelegramService) GetBotChats

func (service *BotsTelegramService) GetBotChats(ctx context.Context, botID string) ([]*TelegramBotChat, error)

func (*BotsTelegramService) GetBotTriggers

func (service *BotsTelegramService) GetBotTriggers(ctx context.Context, botID string) ([]*BotTrigger, error)

func (*BotsTelegramService) GetBotVariables

func (service *BotsTelegramService) GetBotVariables(ctx context.Context, botID string) ([]*BotVariable, error)

func (*BotsTelegramService) GetBots

func (service *BotsTelegramService) GetBots(ctx context.Context) ([]*TelegramBot, error)

func (*BotsTelegramService) GetContact

func (service *BotsTelegramService) GetContact(ctx context.Context, contactID string) (*TelegramBotContact, error)

func (*BotsTelegramService) GetContactMessages

func (service *BotsTelegramService) GetContactMessages(ctx context.Context, contactID string) ([]*TelegramBotMessage, error)

func (*BotsTelegramService) GetContactsByTag

func (service *BotsTelegramService) GetContactsByTag(ctx context.Context, tag, botID string) ([]*TelegramBotContact, error)

func (*BotsTelegramService) GetContactsByVariable

func (service *BotsTelegramService) GetContactsByVariable(ctx context.Context, params BotContactsByVariableParams) ([]*TelegramBotContact, error)

func (*BotsTelegramService) GetFlows

func (service *BotsTelegramService) GetFlows(ctx context.Context, botID string) ([]*BotFlow, error)

func (*BotsTelegramService) GetPauseAutomation

func (service *BotsTelegramService) GetPauseAutomation(ctx context.Context, contactID string) (int, error)

func (*BotsTelegramService) RunFlow

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

func (*BotsTelegramService) RunFlowByTrigger

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

func (*BotsTelegramService) SendCampaign

func (service *BotsTelegramService) SendCampaign(ctx context.Context, params TelegramBotSendCampaignParams) error

func (*BotsTelegramService) SendTextByContact

func (service *BotsTelegramService) SendTextByContact(ctx context.Context, contactID string, text string) error

func (*BotsTelegramService) SetPauseAutomation

func (service *BotsTelegramService) SetPauseAutomation(ctx context.Context, contactID string, minutes int) error

func (*BotsTelegramService) SetTagsToContact

func (service *BotsTelegramService) SetTagsToContact(ctx context.Context, contactID string, tags []string) error

func (*BotsTelegramService) SetVariableToContact

func (service *BotsTelegramService) SetVariableToContact(ctx context.Context, 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(ctx context.Context, contactID string) error

func (*BotsVkService) DeletePauseAutomation

func (service *BotsVkService) DeletePauseAutomation(ctx context.Context, contactID string) error

func (*BotsVkService) DeleteTagFromContact

func (service *BotsVkService) DeleteTagFromContact(ctx context.Context, contactID string, tag string) error

func (*BotsVkService) DisableContact

func (service *BotsVkService) DisableContact(ctx context.Context, contactID string) error

func (*BotsVkService) EnableContact

func (service *BotsVkService) EnableContact(ctx context.Context, contactID string) error

func (*BotsVkService) GetAccount

func (service *BotsVkService) GetAccount(ctx context.Context) (*VkAccount, error)

func (*BotsVkService) GetBotChats

func (service *BotsVkService) GetBotChats(ctx context.Context, botID string) ([]*VkBotChat, error)

func (*BotsVkService) GetBotTriggers

func (service *BotsVkService) GetBotTriggers(ctx context.Context, botID string) ([]*BotTrigger, error)

func (*BotsVkService) GetBotVariables

func (service *BotsVkService) GetBotVariables(ctx context.Context, botID string) ([]*BotVariable, error)

func (*BotsVkService) GetBots

func (service *BotsVkService) GetBots(ctx context.Context) ([]*VkBot, error)

func (*BotsVkService) GetContact

func (service *BotsVkService) GetContact(ctx context.Context, contactID string) (*VkBotContact, error)

func (*BotsVkService) GetContactMessages

func (service *BotsVkService) GetContactMessages(ctx context.Context, contactID string) ([]*VkBotMessage, error)

func (*BotsVkService) GetContactsByTag

func (service *BotsVkService) GetContactsByTag(ctx context.Context, tag, botID string) ([]*VkBotContact, error)

func (*BotsVkService) GetContactsByVariable

func (service *BotsVkService) GetContactsByVariable(ctx context.Context, params BotContactsByVariableParams) ([]*VkBotContact, error)

func (*BotsVkService) GetFlows

func (service *BotsVkService) GetFlows(ctx context.Context, botID string) ([]*BotFlow, error)

func (*BotsVkService) GetPauseAutomation

func (service *BotsVkService) GetPauseAutomation(ctx context.Context, contactID string) (int, error)

func (*BotsVkService) RunFlow

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

func (*BotsVkService) RunFlowByTrigger

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

func (*BotsVkService) SendCampaign

func (service *BotsVkService) SendCampaign(ctx context.Context, params VkBotSendCampaignParams) error

func (*BotsVkService) SendTextByContact

func (service *BotsVkService) SendTextByContact(ctx context.Context, contactID string, text string) error

func (*BotsVkService) SetPauseAutomation

func (service *BotsVkService) SetPauseAutomation(ctx context.Context, contactID string, minutes int) error

func (*BotsVkService) SetTagsToContact

func (service *BotsVkService) SetTagsToContact(ctx context.Context, contactID string, tags []string) error

func (*BotsVkService) SetVariableToContact

func (service *BotsVkService) SetVariableToContact(ctx context.Context, 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(ctx context.Context, botID, phone, name string) (*WhatsAppBotContact, error)

func (*BotsWhatsAppService) DeleteContact

func (service *BotsWhatsAppService) DeleteContact(ctx context.Context, contactID string) error

func (*BotsWhatsAppService) DeletePauseAutomation

func (service *BotsWhatsAppService) DeletePauseAutomation(ctx context.Context, contactID string) error

func (*BotsWhatsAppService) DeleteTagFromContact

func (service *BotsWhatsAppService) DeleteTagFromContact(ctx context.Context, contactID string, tag string) error

func (*BotsWhatsAppService) DisableContact

func (service *BotsWhatsAppService) DisableContact(ctx context.Context, contactID string) error

func (*BotsWhatsAppService) EnableContact

func (service *BotsWhatsAppService) EnableContact(ctx context.Context, contactID string) error

func (*BotsWhatsAppService) GetAccount

func (service *BotsWhatsAppService) GetAccount(ctx context.Context) (*WhatsAppAccount, error)

func (*BotsWhatsAppService) GetBotChats

func (service *BotsWhatsAppService) GetBotChats(ctx context.Context, botID string) ([]*WhatsAppBotChat, error)

func (*BotsWhatsAppService) GetBotTriggers

func (service *BotsWhatsAppService) GetBotTriggers(ctx context.Context, botID string) ([]*BotTrigger, error)

func (*BotsWhatsAppService) GetBotVariables

func (service *BotsWhatsAppService) GetBotVariables(ctx context.Context, botID string) ([]*BotVariable, error)

func (*BotsWhatsAppService) GetBots

func (service *BotsWhatsAppService) GetBots(ctx context.Context) ([]*WhatsAppBot, error)

func (*BotsWhatsAppService) GetContact

func (service *BotsWhatsAppService) GetContact(ctx context.Context, contactID string) (*WhatsAppBotContact, error)

func (*BotsWhatsAppService) GetContactMessages

func (service *BotsWhatsAppService) GetContactMessages(ctx context.Context, contactID string) ([]*WhatsAppBotMessage, error)

func (*BotsWhatsAppService) GetContactsByPhone

func (service *BotsWhatsAppService) GetContactsByPhone(ctx context.Context, phone, botID string) ([]*WhatsAppBotContact, error)

func (*BotsWhatsAppService) GetContactsByTag

func (service *BotsWhatsAppService) GetContactsByTag(ctx context.Context, tag, botID string) ([]*WhatsAppBotContact, error)

func (*BotsWhatsAppService) GetContactsByVariable

func (service *BotsWhatsAppService) GetContactsByVariable(ctx context.Context, params BotContactsByVariableParams) ([]*WhatsAppBotContact, error)

func (*BotsWhatsAppService) GetFlows

func (service *BotsWhatsAppService) GetFlows(ctx context.Context, botID string) ([]*BotFlow, error)

func (*BotsWhatsAppService) GetPauseAutomation

func (service *BotsWhatsAppService) GetPauseAutomation(ctx context.Context, contactID string) (int, error)

func (*BotsWhatsAppService) GetTemplates

func (service *BotsWhatsAppService) GetTemplates(ctx context.Context) ([]*WhatsAppTemplate, error)

func (*BotsWhatsAppService) RunFlow

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

func (*BotsWhatsAppService) RunFlowByTrigger

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

func (*BotsWhatsAppService) SendByContact

func (service *BotsWhatsAppService) SendByContact(ctx context.Context, contactID string, message *WhatsAppMessage) error

func (*BotsWhatsAppService) SendByPhone

func (service *BotsWhatsAppService) SendByPhone(ctx context.Context, botID, phone string, message *WhatsAppMessage) error

func (*BotsWhatsAppService) SendCampaign

func (service *BotsWhatsAppService) SendCampaign(ctx context.Context, params WhatsAppBotSendCampaignParams) error

func (*BotsWhatsAppService) SendCampaignByTemplate

func (service *BotsWhatsAppService) SendCampaignByTemplate(ctx context.Context, params WhatsAppBotSendCampaignByTemplateParams) error

func (*BotsWhatsAppService) SendTemplate

func (service *BotsWhatsAppService) SendTemplate(ctx context.Context, contactID, templateName, languageCode string) error

func (*BotsWhatsAppService) SendTemplateByPhone

func (service *BotsWhatsAppService) SendTemplateByPhone(ctx context.Context, botID, phone, templateName, languageCode string) error

func (*BotsWhatsAppService) SendTemplateByPhoneWithImage

func (service *BotsWhatsAppService) SendTemplateByPhoneWithImage(ctx context.Context, botID, phone, templateName, languageCode, imageLink string) error

func (*BotsWhatsAppService) SendTemplateByPhoneWithVariables

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

func (*BotsWhatsAppService) SendTemplateWithImage

func (service *BotsWhatsAppService) SendTemplateWithImage(ctx context.Context, contactID, templateName, languageCode, imageLink string) error

func (*BotsWhatsAppService) SendTemplateWithVariables

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

func (*BotsWhatsAppService) SetPauseAutomation

func (service *BotsWhatsAppService) SetPauseAutomation(ctx context.Context, contactID string, minutes int) error

func (*BotsWhatsAppService) SetTagsToContact

func (service *BotsWhatsAppService) SetTagsToContact(ctx context.Context, contactID string, tags []string) error

func (*BotsWhatsAppService) SetVariableToContact

func (service *BotsWhatsAppService) SetVariableToContact(ctx context.Context, 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(ctx context.Context, id int) error

CancelCampaign cancels a scheduled campaign

func (*CampaignsService) CreateCampaign

func (service *CampaignsService) CreateCampaign(ctx context.Context, 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(ctx context.Context, id int) (*Campaign, error)

GetCampaign returns an information about specific campaign

func (*CampaignsService) GetCampaignCountriesStatistics

func (service *CampaignsService) GetCampaignCountriesStatistics(ctx context.Context, id int) (map[string]int, error)

GetCampaignCountriesStatistics represents campaign statistics of countries

func (*CampaignsService) GetCampaignReferralsStatistics

func (service *CampaignsService) GetCampaignReferralsStatistics(ctx context.Context, id int) ([]*MailingRefStat, error)

GetCampaignReferralsStatistics returns campaign statistics of referrals

func (*CampaignsService) GetCampaigns

func (service *CampaignsService) GetCampaigns(ctx context.Context, limit int, offset int) ([]*Campaign, error)

GetCampaigns returns a list of campaigns

func (*CampaignsService) GetCampaignsByMailingList

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

GetCampaignsByMailingList returns a list of campaigns by specific mailing list

func (*CampaignsService) UpdateCampaign

func (service *CampaignsService) UpdateCampaign(ctx context.Context, 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 IgAccount

type IgAccount struct {
	Tariff 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:"tariff"`
	Statistics struct {
		Messages  int `json:"messages"`
		Bots      int `json:"bots"`
		Contacts  int `json:"contacts"`
		Variables int `json:"variables"`
	} `json:"statistics"`
}

type IgBot

type IgBot struct {
	ID          string `json:"id"`
	ChannelData struct {
		ID         string `json:"id"`
		FirstName  string `json:"first_name"`
		LastName   string `json:"last_name"`
		Name       string `json:"name"`
		NameFormat string `json:"name_format"`
		ShortName  string `json:"short_name"`
		Picture    struct {
			Data struct {
				Height       int    `json:"height"`
				IsSilhouette bool   `json:"is_silhouette"`
				Url          string `json:"url"`
				Width        int    `json:"width"`
			} `json:"data"`
		} `json:"picture"`
	} `json:"channel_data"`
	IgUser struct {
		ID                int    `json:"id"`
		IgID              int    `json:"ig_id"`
		FollowersCount    int    `json:"followers_count"`
		FollowsCount      int    `json:"follows_count"`
		MediaCount        int    `json:"media_count"`
		ProfilePictureUrl string `json:"profile_picture_url"`
		Username          string `json:"username"`
		Website           string `json:"website"`
	} `json:"ig_user"`
	IgPage struct {
		InstagramBusinessAccount struct {
			ID                int    `json:"id"`
			IgID              int    `json:"ig_id"`
			Name              string `json:"name"`
			Biography         string `json:"biography"`
			FollowersCount    int    `json:"followers_count"`
			FollowsCount      int    `json:"follows_count"`
			MediaCount        int    `json:"media_count"`
			ProfilePictureUrl string `json:"profile_picture_url"`
			Username          string `json:"username"`
			Website           string `json:"website"`
		} `json:"instagram_business_account"`
		ID           int    `json:"id"`
		Category     string `json:"category"`
		CategoryList []struct {
			ID   int    `json:"id"`
			Name string `json:"name"`
		} `json:"category_list"`
		Name    string `json:"name"`
		Picture struct {
			Data struct {
				Height       int    `json:"height"`
				IsSilhouette bool   `json:"is_silhouette"`
				Url          string `json:"url"`
				Width        int    `json:"width"`
			} `json:"data"`
		} `json:"picture"`
	} `json:"ig_page"`
	Inbox struct {
		Total  int `json:"total"`
		Unread int `json:"unread"`
	} `json:"inbox"`
	Status    int       `json:"status"`
	CreatedAt time.Time `json:"created_at"`
}

type IgBotCampaignMessage

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

type IgBotChat

type IgBotChat struct {
	Contact          *IgBotContact `json:"contact"`
	InboxLastMessage *IgBotMessage `json:"inbox_last_message"`
	InboxUnread      int           `json:"inbox_unread"`
}

type IgBotContact

type IgBotContact struct {
	ID          string `json:"id"`
	BotID       string `json:"bot_id"`
	Status      int    `json:"status"`
	ChannelData struct {
		ID         string `json:"id"`
		UserName   string `json:"user_name"`
		FirstName  string `json:"first_name"`
		LastName   string `json:"last_name"`
		Name       string `json:"name"`
		ProfilePic string `json:"profile_pic"`
	} `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 IgBotMessage

type IgBotMessage 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 IgBotSendCampaignParams

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

type IgBotSendMessagesParams

type IgBotSendMessagesParams struct {
	ContactID string `json:"contact_id"`
	Messages  []struct {
		Type    string `json:"type"`
		Message struct {
			Text string `json:"text"`
		} `json:"message"`
	} `json:"messages"`
}

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(ctx context.Context, id int, name string) error

ChangeName changes a name of specific mailing list

func (*MailingListsService) CountCampaignCost

func (service *MailingListsService) CountCampaignCost(ctx context.Context, mailingListID int) (*CampaignCost, error)

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

func (*MailingListsService) CountMailingListEmails

func (service *MailingListsService) CountMailingListEmails(ctx context.Context, mailingListID int) (int, error)

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

func (*MailingListsService) CreateMailingList

func (service *MailingListsService) CreateMailingList(ctx context.Context, name string) (int, error)

CreateMailingList creates new mailing list

func (*MailingListsService) DeleteMailingList

func (service *MailingListsService) DeleteMailingList(ctx context.Context, mailingListID int) error

DeleteMailingList removes specific mailing list

func (*MailingListsService) DeleteMailingListEmails

func (service *MailingListsService) DeleteMailingListEmails(ctx context.Context, mailingListID int, emails []string) error

DeleteMailingListEmails removes emails from specific mailing list

func (*MailingListsService) DoubleOptIn

func (service *MailingListsService) DoubleOptIn(ctx context.Context, 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(ctx context.Context, mailingListID int) (*MailingList, error)

GetMailingList returns detailed information regarding a specific mailing list

func (*MailingListsService) GetMailingListEmails

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

GetMailingListEmails returns a list of emails from a mailing list

func (*MailingListsService) GetMailingListEmailsByVariable

func (service *MailingListsService) GetMailingListEmailsByVariable(ctx context.Context, 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(ctx context.Context, mailingListID int) ([]*VariableMeta, error)

GetMailingListVariables method returns variables of specific mailing list

func (*MailingListsService) GetMailingLists

func (service *MailingListsService) GetMailingLists(ctx context.Context, limit int, offset int) ([]*MailingList, error)

GetMailingLists returns a list of mailing lists

func (*MailingListsService) SingleOptIn

func (service *MailingListsService) SingleOptIn(ctx context.Context, mailingListID int, emails []*EmailToAdd) error

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

func (*MailingListsService) UnsubscribeEmails

func (service *MailingListsService) UnsubscribeEmails(ctx context.Context, mailingListID int, emails []string) error

UnsubscribeEmails unsubscribes emails from a specific mailing list

func (*MailingListsService) UpdateEmailVariables

func (service *MailingListsService) UpdateEmailVariables(ctx context.Context, 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(ctx context.Context, subscriptionID int) error

ActivateSubscription activates a subscriber

func (*PushService) CountWebsiteSubscriptions

func (service *PushService) CountWebsiteSubscriptions(ctx context.Context, websiteID int) (int, error)

CountWebsiteSubscriptions returns the total number of website subscribers

func (*PushService) CountWebsites

func (service *PushService) CountWebsites(ctx context.Context) (int, error)

CountWebsites retrieves the total number of websites

func (*PushService) CreatePushCampaign

func (service *PushService) CreatePushCampaign(ctx context.Context, params PushMessageParams) (int, error)

CreatePushCampaign creates new push campaign

func (*PushService) DeactivateSubscription

func (service *PushService) DeactivateSubscription(ctx context.Context, subscriptionID int) error

DeactivateSubscription deactivates a subscriber

func (*PushService) GetMessages

func (service *PushService) GetMessages(ctx context.Context, params PushListParams) ([]Push, error)

GetMessages retrieves a list of sent web push campaigns

func (*PushService) GetPushMessagesStatistics

func (service *PushService) GetPushMessagesStatistics(ctx context.Context, taskID int) (*PushMessagesStatistics, error)

GetPushMessagesStatistics returns statistics on sent campaigns

func (*PushService) GetWebsiteInfo

func (service *PushService) GetWebsiteInfo(ctx context.Context, websiteID int) (*WebsiteInfo, error)

GetWebsiteInfo returns information about specific website

func (*PushService) GetWebsiteSubscriptions

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

GetWebsiteSubscriptions returns a list subscribers for a certain website

func (*PushService) GetWebsiteVariables

func (service *PushService) GetWebsiteVariables(ctx context.Context, websiteID int) ([]*PushWebsiteVariable, error)

GetWebsiteVariables returns a list of variables for specific website

func (*PushService) GetWebsites

func (service *PushService) GetWebsites(ctx context.Context, 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(ctx context.Context, email, code string) error

func (*SendersService) CreateSender

func (service *SendersService) CreateSender(ctx context.Context, name string, email string) error

func (*SendersService) DeleteSender

func (service *SendersService) DeleteSender(ctx context.Context, email string) error

func (*SendersService) GetSenderActivationCode

func (service *SendersService) GetSenderActivationCode(ctx context.Context, email string) error

func (*SendersService) GetSenders

func (service *SendersService) GetSenders(ctx context.Context) ([]*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(ctx context.Context, mailingListID int, phones []string) (*AddPhonesCounters, error)

func (*SmsService) AddPhonesWithVariables

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

func (*SmsService) AddToBlacklist

func (service *SmsService) AddToBlacklist(ctx context.Context, phones []string, description string) error

func (*SmsService) CancelCampaign

func (service *SmsService) CancelCampaign(ctx context.Context, id int) error

func (*SmsService) CreateCampaignByMailingList

func (service *SmsService) CreateCampaignByMailingList(ctx context.Context, params CreateSmsCampaignByAddressBookParams) (int, error)

func (*SmsService) CreateCampaignByPhones

func (service *SmsService) CreateCampaignByPhones(ctx context.Context, params CreateSmsCampaignByPhonesParams) (int, error)

func (*SmsService) DeleteCampaign

func (service *SmsService) DeleteCampaign(ctx context.Context, id int) error

func (*SmsService) DeletePhones

func (service *SmsService) DeletePhones(ctx context.Context, addressBookID int, phones []string) error

func (*SmsService) GetBlacklistedPhones

func (service *SmsService) GetBlacklistedPhones(ctx context.Context, phones []string) ([]*BlacklistPhone, error)

func (*SmsService) GetCampaignCost

func (service *SmsService) GetCampaignCost(ctx context.Context, params SmsCampaignCostParams) (*SmsCampaignCampaignCost, error)

func (*SmsService) GetCampaignInfo

func (service *SmsService) GetCampaignInfo(ctx context.Context, id int) (*SmsCampaignInfo, error)

func (*SmsService) GetCampaigns

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

func (*SmsService) GetPhoneInfo

func (service *SmsService) GetPhoneInfo(ctx context.Context, addressBookID int, phone string) (*PhoneInfo, error)

func (*SmsService) GetSenders

func (service *SmsService) GetSenders(ctx context.Context) ([]*SmsSender, error)

func (*SmsService) RemoveFromBlacklist

func (service *SmsService) RemoveFromBlacklist(ctx context.Context, phones []string) error

func (*SmsService) UpdateVariablesMultiple

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

func (*SmsService) UpdateVariablesSingle

func (service *SmsService) UpdateVariablesSingle(ctx context.Context, 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(ctx context.Context, email string) error

func (*SmtpService) CountBounces

func (service *SmtpService) CountBounces(ctx context.Context) (int, error)

func (*SmtpService) CountMessages

func (service *SmtpService) CountMessages(ctx context.Context) (int, error)

func (*SmtpService) DeleteUnsubscribedEmails

func (service *SmtpService) DeleteUnsubscribedEmails(ctx context.Context, emails []string) error

func (*SmtpService) GetAllowedDomains

func (service *SmtpService) GetAllowedDomains(ctx context.Context) ([]string, error)

func (*SmtpService) GetDailyBounces

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

func (*SmtpService) GetMessage

func (service *SmtpService) GetMessage(ctx context.Context, id int) (*SmtpMessage, error)

func (*SmtpService) GetMessages

func (service *SmtpService) GetMessages(ctx context.Context, params SmtpListParams) ([]*SmtpMessage, error)

func (*SmtpService) GetSendersEmails

func (service *SmtpService) GetSendersEmails(ctx context.Context) ([]string, error)

func (*SmtpService) GetSendersIPs

func (service *SmtpService) GetSendersIPs(ctx context.Context) ([]string, error)

func (*SmtpService) GetUnsubscribedEmails

func (service *SmtpService) GetUnsubscribedEmails(ctx context.Context, params UnsubscribedListParams) ([]Unsubscribed, error)

func (*SmtpService) SendMessage

func (service *SmtpService) SendMessage(ctx context.Context, params SendEmailParams) (string, error)

func (*SmtpService) UnsubscribeEmails

func (service *SmtpService) UnsubscribeEmails(ctx context.Context, emails []*SmtpUnsubscribeEmail) error

func (*SmtpService) VerifyDomain

func (service *SmtpService) VerifyDomain(ctx context.Context, 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(ctx context.Context, name string, body string, lang string) (int, error)

func (*TemplatesService) GetTemplate

func (service *TemplatesService) GetTemplate(ctx context.Context, templateID int) (*Template, error)

func (*TemplatesService) GetTemplates

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

func (*TemplatesService) UpdateTemplate

func (service *TemplatesService) UpdateTemplate(ctx context.Context, 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(ctx context.Context, params MailingListReportParams) error

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

func (*ValidatorService) DeleteEmailValidationResult

func (service *ValidatorService) DeleteEmailValidationResult(ctx context.Context, email string) error

DeleteEmailValidationResult removes the result of checking one address

func (*ValidatorService) GetEmailValidationResult

func (service *ValidatorService) GetEmailValidationResult(ctx context.Context, email string) (*EmailValidationResult, error)

GetEmailValidationResult returns the results of a verification of specific email

func (*ValidatorService) GetMailingListValidationProgress

func (service *ValidatorService) GetMailingListValidationProgress(ctx context.Context, mailingListID int) (*ValidationProgress, error)

GetMailingListValidationProgress returns a progress of mailing list validation

func (*ValidatorService) GetMailingListValidationReport

func (service *ValidatorService) GetMailingListValidationReport(ctx context.Context, mailingListID int) (*MailingListValidationResultDetailed, error)

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

func (*ValidatorService) GetMailingListValidationResult

func (service *ValidatorService) GetMailingListValidationResult(ctx context.Context, 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(ctx context.Context, limit, offset int) ([]*MailingListValidationResult, error)

GetValidatedMailingLists returns a list of verified mailing lists

func (*ValidatorService) ValidateEmail

func (service *ValidatorService) ValidateEmail(ctx context.Context, email string) error

ValidateEmail verifies one email address

func (*ValidatorService) ValidateMailingList

func (service *ValidatorService) ValidateMailingList(ctx context.Context, 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(ctx context.Context, params CreateViberCampaignParams) (int, error)

func (*ViberService) GetCampaigns

func (service *ViberService) GetCampaigns(ctx context.Context, limit, offset int) ([]*ViberCampaign, error)

func (*ViberService) GetRecipients

func (service *ViberService) GetRecipients(ctx context.Context, taskID int) ([]*ViberRecipient, error)

func (*ViberService) GetSender

func (service *ViberService) GetSender(ctx context.Context, senderID int) (*ViberSender, error)

func (*ViberService) GetSenders

func (service *ViberService) GetSenders(ctx context.Context) ([]*ViberSender, error)

func (*ViberService) GetStatistics

func (service *ViberService) GetStatistics(ctx context.Context, campaignID int) (*ViberCampaignStatistics, error)

func (*ViberService) UpdateCampaign

func (service *ViberService) UpdateCampaign(ctx context.Context, 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(ctx context.Context, params CreateVkOkSenderParams) (int, error)

func (*VkOkService) CreateTemplate

func (service *VkOkService) CreateTemplate(ctx context.Context, params CreateVkOkTemplateParams) (int, error)

func (*VkOkService) GetCampaignPhones

func (service *VkOkService) GetCampaignPhones(ctx context.Context, campaignID int) ([]*VkOkCampaignPhone, error)

func (*VkOkService) GetCampaignStatistics

func (service *VkOkService) GetCampaignStatistics(ctx context.Context, campaignID int) (*VkOkCampaignStatistics, error)

func (*VkOkService) GetCampaignsStatistics

func (service *VkOkService) GetCampaignsStatistics(ctx context.Context) ([]*VkOkCampaignStatistics, error)

func (*VkOkService) GetTemplate

func (service *VkOkService) GetTemplate(ctx context.Context, templateID int) (*VkOkTemplate, error)

func (*VkOkService) GetTemplates

func (service *VkOkService) GetTemplates(ctx context.Context) ([]*VkOkTemplate, error)

func (*VkOkService) Send

func (service *VkOkService) Send(ctx context.Context, 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(ctx context.Context, actions []string, url string) ([]*Webhook, error)

CreateWebhook creates webhook

func (*WebhooksService) DeleteWebhook

func (service *WebhooksService) DeleteWebhook(ctx context.Context, id int) error

DeleteWebhook deletes a specific webhook

func (*WebhooksService) GetWebhook

func (service *WebhooksService) GetWebhook(ctx context.Context, id int) (*Webhook, error)

GetWebhook returns specific webhook

func (*WebhooksService) GetWebhooks

func (service *WebhooksService) GetWebhooks(ctx context.Context) ([]*Webhook, error)

GetWebhooks returns a list of webhooks

func (*WebhooksService) UpdateWebhook

func (service *WebhooksService) UpdateWebhook(ctx context.Context, 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