Introduction
Tray.io is an integration platform that allows organizations to easily automate complex processes through a powerful, flexible platform, and connect their entire cloud stack thanks to APIs.
MoEngage <> Tray.io
The MoEngage and Tray.io integration allows you to easily send data between MoEngage and other apps using custom logic and code functions. With this integration, you can -
- Use MoEngage as a trigger on Tray.io via our Connector campaigns
- Send data from Tray.io to MoEngage using our Data APIs
Use Cases
- When an event occurs in MoEngage, add a new row in Google Sheets.
- Import users from HubSpot Leads into MoEngage.
- Send a Slack message when a user performs an event.
- Import events into MoEngage from a WebHook setup in Tray.io.
Integration Prerequisites
- Ensure you have access to your Tray.io account.
- Ensure you have access to Data API keys in MoEngage Dashboard.
- We have revamped our dashboard settings UI. The Data API ID and Data API Key are available in the following navigations in the new and old UIs.
- Revamped UI - You can access the Data API ID in Settings -> Account -> APIs . The Data API ID is the same as the Workspace ID. The Data API Key is available in the same screen in the API Keys -> Data section.
- Old UI -> You can access the Data API ID and Data API Key in Settings -> App Settings -> APIs -> Data API Settings.
Use MoEngage as a Trigger
You can make use of MoEngage's Connector Campaigns to use MoEngage as a trigger.
Step 1: Add Webhook as a Trigger on Tray.io
- On your Tray.io Dashboard, click on "+ Add workflow" >> "From scratch" to create a new workflow.
- Give your workflow a name and fill out other details.
- In Step 2, select "Webhook" under the section "".
- Click on "Create workflow" to begin.
- In the Workflow Editor, click on the three dots menu next to the trigger >> "Copy public URL".
- This Public URL will be the endpoint to set up in MoEngage Connector Campaign.
- Click on "Enable workflow" at the bottom to make this URL live.
Step 2: Setup the Connector Campaign in MoEngage Dashboard
- Navigate to MoEngage Dashboard.
- Use any one of the following options:
- On the All Campaigns page, click Create Campaign.
The Create Campaign page is displayed.
- Click Create New > Campaign.
The Create Campaign page is displayed.
- On the All Campaigns page, click Create Campaign.
- Click Custom under Connectors.
- For the campaign delivery types, choose "Event-Triggered".
- For more information about delivery types, refer to Delivery Types.
- On the next screen, give your Campaign a name, and select the Criteria as "Device Uninstall".
- For the trigger, choose "immediately".
- For the audience, let us choose "All users" for this use case. Click "Next" when satisfied.
- On the content screen, we will define our payload and webhook URL we got from the previous step.
- Choose the method as "POST" (know more about Tray.io Webhook Trigger).
- Enter the webhook URL (Public URL) you copied earlier.
- Define the headers and parameters as per your requirements. For this use case, we will just define our payload body- (you can type @ to insert personalized values as well)
- Now you need to test this webhook, scroll down and enter a test user's data and click on "test".
- You should see a new modal saying the test was successful:
Step 2: Test the trigger on Tray.io
- Now go back to the Tray.io Workflow editor. Open the "logs" tab from the top.
- On the left sidebar, you should see new execution entries from the test you ran earlier.
- Select an execution entry, and then select "Webhook". Then verify if your data has successfully reached Tray.io:
- Once you have verified the data, click on the "Use output" button above the output tab. This will make all fields in your payload available to access in other steps.
- In the next steps, type
{$
to open up the interpolation dropdown. Select the fields you want to map from the trigger step. Read about working with data.