Connecting the Intercom API to Google Sheets

Intercom is an American software company that produces a messaging platform which allows businesses to communicate with prospective and existing customers within their app, on their website, through social media, or via email.

We can use the Intercom API to import data from Intercom into Google Sheets. In this tutorial, I’ll show you how to connect the Intercom API to Google Sheets in 5 steps:

  1. Install the Apipheny add-on
  2. Create an app and get the access token
  3. Choose an Intercom Endpoint
  4. Enter your Intercom API request into Apipheny
  5. Run the Intercom API request in your Google Sheet

Step 1.) Install and open the Apipheny add-on in Google Sheets

To pull data from the Intercom API to Google Sheets, first install and open the Apipheny Google Sheets add-on.

Apipheny is a no-code API integrator for Google Sheets that you can use to make unlimited API requests, connect to unlimited APIs, save API requests, schedule API requests, and more. 

1. Install Apipheny by opening the following link on desktop and then clicking the Install button on the page: https://apipheny.io/install

Install Apipheny in the Google Workspace Marketplace

2. After you’ve installed Apipheny, open a Google Sheet and then click on the Add-Ons or Extensions option in the top menu. In the add-ons menu, you should see Apipheny.

Click Apipheny > Import API to open the Apipheny sidebar in your Google Sheets.

Opening the Apipheny add-on in Google Sheets

Step 2.) Create an API app and get the access token

After logging into your Intercom developer account, click the Your apps tab, then click the New app button:

Creating a new app
Creating a new app


Complete the required fields then click the Create app button:

Completing the required fields for the new app
Completing the required fields for the new app

Your app will then be created and the access token will be displayed on the screen. Copy and paste your token to a safe location, because you’ll need it in the next steps:

Access token section
Access token section

Step 3.) Choose an Intercom Endpoint

In this section, we’ll show you how to browse the Intercom API documentation to find the API URL and endpoint that retrieves the information you need from your Intercom account. If you already know your URL, or you want to use the same example URL as us, just skip to Step 4.

First, open the Intercom API documentation page: https://developers.intercom.com/intercom-api-reference/reference

The menu on the left contains sections: Introduction, Choose Version, Common Structures, Users, Leads, Contacts, Visitors, Companies, Data Attributes, Data Events, Tags, Notes, Segments, Conversations, Messages, Admins, Teams, Counts, Articles, Help Center, Webhooks and Errors

Intercom documentation
Intercom documentation

The Users, Leads, Contacts, Visitors, Companies, Data Attributes, Data Events, Tags, Notes, Segments, Conversations, Messages, Admins, Teams, Counts, Articles and Help Center sections are the ones containing the API’s endpoints.

An example endpoint is the List all contacts from the Contacts section, which fetches a list of all contacts. The complete URL for this endpoint is:

https://api.intercom.io/contacts

The endpoint’s documentation contains a short description of the endpoint’s purpose, the cURL request and an example response. The default HTTP method is GET and it’s not specified in the documentation. If an endpoint uses any other method than GET, then this is specified in that endpoint’s documentation.

Endpoint documentation
Endpoint documentation

All API calls to the Intercom API should be made with this base domain/URL: https://api.intercom.io/

All endpoints should be appended to this base URL.

Step 4.) Enter your Intercom API request into Apipheny

Now go back to your Google Sheet and make sure that the Apipheny add-on is open on the “Import” tab. With the Import tab open, enter these details into the add-on:

Method: At the top of the Apipheny sidebar, select the HTTP method (GET or POST) required by your API endpoint. For this example, we are using the POST method.

API URL: In Step 3, we explained how you can find the Intercom API endpoint that you need. Now copy and paste your complete Intercom API URL into the Apipheny add-on, where it says API URL Path, followed by any parameters required for your query (if applicable).

For this example, we are using the Create or update a company endpoint, which creates or updates a company. This is what the whole URL looks like:

https://api.intercom.io/companies

Headers: In the Headers section of Apipheny, add three rows with the following keys and values:

Headers

Key 1:
Authorization
Value 1:
Bearer <your_access_token>

Key 2:
Accept
Value 2:
application/json

Key 3:
Content-Type
Value 3:
application/json

<your_ access_token> value is the value of the token generated previously, in Step 2. There should be a space between “Bearer” and your token. Do not include the brackets around your token.

In the POST Body section in Apipheny, add the following code:

 {
   "name": "<your_company_name>",
   "plan": "<your_company_plan>",
   "company_id": "<your_company_id>",
   "remote_created_at": <timestamp>,
   "size": 750,
   "website": "<your_company_website>",
   "industry": "<your_company_industry>"
 }

Don’t forget to replace <your_company_name>, <your_company_plan>, <your_company_id>, <timestamp>, <your_company_website> and <your_company_industry> with real values. Do not include the brackets around each value.

Example POST Body:

 {
   "name": "Apipheny Company",
   "plan": "Paid",
   "company_id": "7",
   "remote_created_at": 1394531170,
   "size": 750,
   "website": "https://apipheny.com",
   "industry": "Manufacturing"
 }
Intercom API request entered into Apipheny
Intercom API request entered into Apipheny

Step 5.) Run the Intercom API request in your Google Sheet

Finally, the last step is to click the Run button at the bottom of the Apipheny add-on and then wait for the Intercom API data to be imported into your Google Sheet. Here’s what our request looked like when completed:

Intercom data imported into Google Sheets
Intercom data imported into Google Sheets

That’s it! You’ve successfully connected your Intercom account to Google Sheets using the Intercom API, Google Sheets API, and the Apipheny add-on.

After making a successful request to the Intercom API, try querying a different Intercom API endpoint, or try using one of the more advanced features in the Apipheny add-on, such as:

Related articles:

Related Posts