
This step is recommended (but optional) to ensure the API integration is set up correctly and the personalization is rendered properly.
How to test the Alert before publishing?
You need to pass a few values to the request copied from the Dashboard. They are the Authorization Header, MOE-APPKEY, request attributes, and personalization attributes (if any).Build Authorization Header
MoEngage uses Basic Authentication. Use the Workspace ID and API Secret to generate HTTP Auth Header, as explained here.Copy Request
You can also copy the sample request in any of the supported languages from the Test Request section in the dashboard and test it on an external console using the copy to clipboard icon.Copy Workspace ID
The request header MOE-APPKEY should contain the Workspace ID value of your MoEngage Account.Test Alert ID
A Test Alert ID is provided on the Dashboard to send this Test Alert request to an external console. This value gets passed in the request automatically. Note: This would differ from the Alert ID for the published Alert.Test Alert Reference Name
Test Alert Reference Name is configured while adding the alert on the Dashboard to send this Test Alert request to an external console. This reference name can be used to test the alert.This is different from the Reference ID for the published Alert.
Attributes
The following attributes need to be passed in the request:Payloads
User identification for sending the Alert
The API processes the user identity information shared in the request and identifies the user to whom the communication needs to be sent, as shown below.
user_id has to be passed in the request, failing which, the request will be dropped. If the user_id (the ID field in the User Profile)is available in the payload and the recipient details(mobile number/email ID/active push token) for the specified channel are available in the user profile, then the Alert is sent.
In case of recipient details are available and a new user_id is shared a new profile will be created with the recipient details.
- Only the five most recently active device tokens available in the User Profile will be considered for sending the Alert for the Push channel.
- The recipient details are fetched from the User Profile if user attributes are enabled. For more information, refer to Enabling User Attributes.
Testing the request in Postman
To test in Postman, do the following:- Click on the copy & open Postman icon to copy the cURL and import it in Postman.
- Add the authentication details by using the authorization section. Add the Workspace ID as the username and the API Key as the password.
- The imported cURL will contain the payload details. Add the Email ID, Phone Number, and other attributes (user_id, transaction_id, personalization, if any).
- Click Send in Postman. This will send the request to the Send Inform API.