Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) CreateContact(ctx context.Context, email string, fields map[string]interface{}) (*CreateContactResponse, error)
- func (c *Client) DeleteContact(ctx context.Context, email string) (*DeleteContactResponse, error)
- func (c *Client) SendEvent(ctx context.Context, req SendEventRequest) (*SendEventResponse, error)
- func (c *Client) SendTransactional(ctx context.Context, req SendTransactionalRequest) (*SendTransactionalResponse, error)
- func (c *Client) UpsertContact(ctx context.Context, email string, fields map[string]interface{}) (*UpsertContactResponse, error)
- func (c *Client) WithEndpoint(endpoint string) *Client
- func (c *Client) WithHTTPClient(client *http.Client) *Client
- type CreateContactResponse
- type DeleteContactResponse
- type SendEventRequest
- type SendEventResponse
- type SendTransactionalRequest
- type SendTransactionalResponse
- type UpsertContactResponse
Constants ¶
View Source
const DefaultEndpoint = "https://app.loops.so/api/v1"
DefaultEndpoint is the default endpoint used for the Loops API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements the Loops API for a given API Key / endpoint.
func (*Client) CreateContact ¶
func (c *Client) CreateContact( ctx context.Context, email string, fields map[string]interface{}, ) (*CreateContactResponse, error)
CreateContact creates a new contact in Loops.
func (*Client) DeleteContact ¶
DeleteContact deletes a contact from Loops.
func (*Client) SendEvent ¶
func (c *Client) SendEvent(ctx context.Context, req SendEventRequest) (*SendEventResponse, error)
Send Event sends an event Loop to a contact. WARNING: This will create a contact if it doesn't exist.
func (*Client) SendTransactional ¶
func (c *Client) SendTransactional(ctx context.Context, req SendTransactionalRequest) (*SendTransactionalResponse, error)
SendTransactional sends a transactional Loop to a contact. DataVariables is an optional map of data variables to be used in the Loop.
func (*Client) UpsertContact ¶
func (c *Client) UpsertContact(ctx context.Context, email string, fields map[string]interface{}) (*UpsertContactResponse, error)
UpsertContact updates or creates a contact in Loops.
func (*Client) WithEndpoint ¶
WithEndpoint attaches a non-default endpoint to the Client. This is generally used with dedicated, or non-serverless deployments.
type CreateContactResponse ¶
type DeleteContactResponse ¶
type SendEventRequest ¶
type SendEventResponse ¶
type SendEventResponse struct {
Success bool `json:"success"`
}
type SendTransactionalResponse ¶
type SendTransactionalResponse struct {
Success bool `json:"success"`
}
type UpsertContactResponse ¶
Click to show internal directories.
Click to hide internal directories.