Learn how to send events to trigger workflows, with code snippets and examples.
suprClient.trackEvent
method. When you call suprClient.trackEvent
, the SDK internally makes an HTTP
call to SuprSend Platform to register this request, and you’ll immediately receive a response indicating the acceptance status. The actual processing/execution of event happens asynchronously.
Parameter | Description | Format | Obligation |
---|---|---|---|
distinct_id | distinct_id of subscriber performing the event | int, bigint, string, UUID | mandatory |
event_name | string identifier for the event like product_purchased | string | mandatory |
properties | a dictionary representing event attributes like first_name Event properties can be used to pass template variables in case of event based trigger | Dictionary | optional |
idempotency_key
for next 24 hours. You can use this key to track webhooks related to workflow notifications.
To make an idempotent request, pass idempotency_key
as the fourth parameter in your event instance like shown below. Idempotency key should be unique that you generate for each request. You may use any string up to 255 characters in length as an idempotency key. Ensure that you don’t add any space in start and end of the key as it will be trimmed.
event.addAttachment()
for each file with an accessible URL. Ensure that file_path is a publicly accessible URL.404 not found
and workflow will not be triggered.append()
on bulk_events instance to add however-many-records to call in bulk.