Open Navigation


Intercom is a customer messaging tool for sales, marketing, and support, connected in a single unified platform.


Intercom is a customer messaging tool for sales, marketing, and support, connected in a single unified platform.


When using the Tray connector, the first thing you will have to do is to click "New Authentication" in the workflow builder:


Check every scope to allow Tray the correct permissions, then proceed to log in to your intercom account.


Once logged in you'll be shown a similar page to this:


This page highlights to you what data you'll be exchanging with connector. Select the Authorize access button found at the bottom of the page:


You're now ready to use the Intercom connector!

This example will show how to use the create export job and the download export job operations found in the Intercom connector.

The first step will be to first to a create an export job using the Create export job operation found in the connector. The two inputs for this operation are Created after and Created before. These two inputs are used to specify the date range of the export.


The Create export job operation tells intercom to start collecting data, it is not instantaneous like a lot of other API calls. Due to the nature of this operation and the fact it could take up to hours to finish an export job, some added steps have to be added to the workflow in order to then download the export.

A loop that runs forever will first be initialised using the Loop collection helper.


This loop will continue running until the export is ready to download from Intercom. To implement this behaviour the next thing to do is use the Download export job operation found in the Intercom connector.


This operation takes one input, the id of the export job which would of been returned in the original Create export job operation that will be ran first. We can use JSONPaths to retrieve this data.


The Download export job has two basic responses:

"completedFlag": false,

The above response is returned when the export job is not ready to be downloaded as Intercom have not finished preparing the export job yet.

"completedFlag": true,
"file": {
"url": "",
"mime_type": "application/octet-stream",
"expires": 1543597995

The above response is returned when the export job has been downloaded from Intercom and is ready to use.

The completedFlag variable is a constant and is something that is used to decide whether we can exit our loop or not. Using a boolean condition we will use the completedFlag to decide whether to exit or stay in the loop.


For the condition we can use JSONPaths to get the value of the completedFlag.


Then we can check to see if it's true or false.


If it is true, then it means that the file has been downloaded and can be used. As a result we will have to terminate the loop. This can be down by using the Break loop helper. The Break operation requires you to specify what loop to terminate as you could have more than one in your workflow already.


If it is false, then it means we will have to run through the loop again and wait till the file is ready to download. To prevent lots of calls being made, we can use the Delay helper which can delay the next action within a workflow for a certain amount of seconds.


Was this article helpful?