Test Alert

You can test your Alert before it is published in the third step of Alert creation. This option lets you test your Alert on the chosen channels before publishing it as shown below. 

TestYourAlert_QSG.png

 

NOTE

This step is recommended (but optional) to ensure that 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 APP 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 APP ID

The request header MOE-APPKEY should contain the APP 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 be different from the Alert ID for the published Alert.

Attributes

The following attributes need to be passed in the request:

Request Field Mandatory Description

MOE-APPKEY

Yes

This is the APP ID of your MoEngage Account. The APP ID uniquely identifies your App. This value gets auto-populated in the test request (supported in multiple languages).

Authorization Yes This is the Base64 encoded authorization header (APPID:APISECRET) that needs to be passed for authentication.

alert_id

Yes

This is the Test Alert ID generated to test the request from an external console. This value is auto-populated in the request.

user_id

No

This field is provided by your brand and should be pasted in the request being tested. This field is the Client ID and identifies the user to whom the Alert is being sent. This is essential for event mapping back to the user. In case this information is not present in the request, the request will still be processed. However, the events will not be logged to any user in MoEngage.

transaction_id

Yes

This field needs to be provided by the brand and pasted in the request being tested. This field identifies the transaction about which the Alert is being sent to the user.  Moengage will store the transaction ID against the uniquely generated request ID. Ensure that the transaction_id is unique for every request you intend to send to the user. This is also used to support idempotency. 

payloads

Yes

This field contains the channel-level payload that in turn contains the user details and personalization attributes.

Once all the necessary information is added to the request, send the request from the external console.

Testing the request in Postman

To test in Postman, do the following:

    1. Click on the copy & open postman icon to copy the cURL and import it in postman.
    2. Add the authentication details by using the authorization section. Add the APP ID as username and API Key as password.
    3. The imported cURL will contain the payload details. Add the Email ID, Phone Number, and other attributes (user_id, transaction_id, personalization if any).
    4. Click on Send in Postman. This will send the request to the Send Inform API.

For information about responses, error codes, and sample responses, refer to Inform API Response.

After you've tested the Alert, the Test Alert Logs get populated with details about the status of the request. For more information, refer to Test Alert Logs.

Was this article helpful?
0 out of 0 found this helpful