Pre-Requisites
Create User ProfileSend Event
You can send event to Suprsend platform by using thesuprClient.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.
Idempotent requests
SuprSend supports idempotency to ensure that requests can be retried safely without duplicate processing. If Suprsend receives and processes a request with an idempotency_key, it will skip processing requests with sameidempotency_key for next 24 hours. You can use this key to track webhooks related to workflow notifications.
Idempotency key should be unique that you generate for each request. You may use any string up to 255 characters in length. Any space at start and end of the key will be trimmed.
Here are some common approaches for assigning idempotency keys:
- Generate a random UUID for each request.
- Construct the idempotency key by combining relevant information about the request. This can include parameters, identifiers, or specific contextual details that are meaningful within your application. for example, you could concatenate the user ID, action, and timestamp to form an idempotency key like
user147-new-comment-1687437670 - Request-specific Identifier: If your request already contains a unique identifier, such as an order ID or a job ID, you can use that identifier directly as the idempotency key.
Add file attachment in event (for email)
To add one or more Attachments to a Notification (viz. Email), you can just append the filepath of attachment to the event instance.- Call
event.AddAttachment()for each file, with a public URL or a local file path. - Local files are base64-encoded into the request, so the total event size (including attachments) must stay within the 800 KB limit.