All URIs are relative to https://app.loops.so/api/v1
Method | HTTP request | Description |
---|---|---|
EventsSendPost | Post /events/send | Send an event |
EventSuccessResponse EventsSendPost(ctx).EventRequest(eventRequest).Execute()
Send an event
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/behnh/loops-api-go"
)
func main() {
eventRequest := *openapiclient.NewEventRequest("EventName_example") // EventRequest | Provide either `email` or `userId` to identify the contact ([read more](https://loops.so/docs/api-reference/send-event#body)).<br>You can add event properties, which will be available in emails sent by this event. Values can be of type string, number, boolean or date ([see allowed date formats](https://loops.so/docs/events/properties#important-information-about-event-properties)).<br>Make sure to create the properties in Loops before using them in API calls.<br>You can add contact properties as keys in this request (of type `string`, `number`, `boolean` or `date` ([see available date formats](https://loops.so/docs/contacts/properties#dates))).
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.EventsAPI.EventsSendPost(context.Background()).EventRequest(eventRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `EventsAPI.EventsSendPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `EventsSendPost`: EventSuccessResponse
fmt.Fprintf(os.Stdout, "Response from `EventsAPI.EventsSendPost`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiEventsSendPostRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
eventRequest | EventRequest | Provide either `email` or `userId` to identify the contact (read more).<br>You can add event properties, which will be available in emails sent by this event. Values can be of type string, number, boolean or date (see allowed date formats).<br>Make sure to create the properties in Loops before using them in API calls.<br>You can add contact properties as keys in this request (of type `string`, `number`, `boolean` or `date` (see available date formats)). |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]