Introduction
Airtable is an easy-to-use online platform for creating and sharing relational databases.
MoEngage <> Airtable
The MoEngage and Airtable integration allows you to forward users and events data from MoEngage to your Airtables allowing you to store all your data in one place for further processing and analytics. With this integration, you can -
- Forward data to Airtable using MoEngage Connector Campaigns
Integration Prerequisites
- Ensure you have access to your Airtable 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.
Send data from MoEngage to Airtable
Step 1: Get your Airtable API Access Token
- On your Airtable Dashboard, click on your Profile Icon on the top right >> Developer hub. Or, go to /create/token.
- If you have no existing tokens, click on "Create token".
- Give your token a name, and grant the following scopes:
-
data.records:write
- Create, edit, or delete records using API
-
- Define the "Access" of your token as per your requirements.
- Click on "Create token" to generate your token. Make a not of this token somewhere safe as Airtable will not show it to you again. You will need to pass this token along with every API call you make from MoEngage.
Read more about the various Authentication methods supported in Airtable APis.
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.
- Choose the method as "POST" (know more about Create Records API on Airtable).
- For Webhook URL, enter
https://api.airtable.com/v0/{baseId}/{tableIdOrName}
When you have a base open in a compatible web browser, you should see a URL in the address bar that looks similar to this (Google Chrome):
In between each backslash, you will find a string that identifies the Base, Table, and View IDs.
- Base IDs begin with "
app
" - Table IDs begin with "
tbl
" - View IDs begin with "
viw
"
- Base IDs begin with "
- Define the following headers:
-
Authorization
:Bearer <TOKEN_YOU_COPIED_EARLIER>
-
Content-Type
:application/json
-
- Choose the "Body Type" as raw and paste the following:
{ "records": [ { "fields": { "Name": "{{UserAttribute['First Name']}} {{UserAttribute['Last Name']}}", "Email": "{{UserAttribute['Email (Standard)']}}" } } ] }
The exact payload needs to be adjusted for the columns in your table. Read more. (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:
- Now go back to the Airtable Base view.
Step 3: Verify if your table has been updated
You should now see a new row in your table. This confirms that your data was successfully sent to Airtable.
Step 4: Publish the campaign
When you're ready with the setup, just publish the campaign and MoEngage will call your API when your trigger conditions are met.