Intercom API

Intercom API

  • Category: Automation


Introduction to Intercom Public API

Intercom offers a public API that allows developers to fetch data from their application programmatically. This data can be used to integrate with other services or to build custom applications that leverage Intercom data.

Intercom provides a number of API endpoints that can be used to fetch data related to users, conversations, message threads, and more. In this blog post, we will explore some of the most popular API endpoints offered by Intercom and provide JavaScript example code for each.

Authenticating with Intercom API

Before you start using the Intercom API, you need to generate an access token for your application. You can do this by logging into your Intercom account and generating a "Personal Access Token" from the API key settings.

Once you have generated your access token, you can use it to authenticate your requests by including it in the "Authorization" header as follows:

const baseURL = "https://api.intercom.io";
const accessToken = "YOUR_ACCESS_TOKEN";

axios.defaults.headers.common.Authorization = `Bearer ${accessToken}`;
axios.defaults.headers.post["Content-Type"] = "application/json";

User API Endpoints

The User API endpoints are used to fetch information about the users in your Intercom account. You can use these endpoints to fetch user attributes, such as name, email address, and user ID.

List All Users in Your Account

axios.get(`${baseURL}/users`, {
  params: {
    per_page: 50
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.log(error);
});

List User by ID

axios.get(`${baseURL}/users/${userId}`)
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.log(error);
  });

Create a New User

axios.post(`${baseURL}/users`, {
    email: "john.doe@example.com",
    name: "John Doe",
    signed_up_at: new Date().toISOString()
})
.then(response => {
    console.log(response.data);
})
.catch(error => {
    console.log(error);
});

Conversation API Endpoints

The Conversation API endpoints are used to fetch information about the conversations in your Intercom account.

List All Conversations

axios.get(`${baseURL}/conversations`, {
  params: {
    per_page: 50
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.log(error);
});

List Conversation by ID

axios.get(`${baseURL}/conversations/${conversationId}`)
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.log(error);
  });

Create a New Conversation

axios.post(`${baseURL}/conversations`, {
    message_type: "inapp",
    body: "Hello, how can I assist you?",
    from: {
        type: "admin",
        id: "YOUR_ADMIN_ID"
    },
    to: {
        type: "user",
        id: "USER_ID"
    },
    assignee: {
        type: "admin",
        id: "YOUR_ADMIN_ID"
    }
})
.then(response => {
    console.log(response.data);
})
.catch(error => {
    console.log(error);
});

Summary

Intercom's public API offers a wide range of endpoints and functionalities that enable developers to programmatically access and manage data within their Intercom account. In this blog post, we have provided some example JavaScript code for some of the most popular API endpoints.

Remember to always specify your API access token to authenticate your requests, and consult Intercom's API documentation for additional information and functionality.

Visit to Intercom API website

Similar APIs of Automation

PixLab

PixLab

Automation

Process and analyze input media images or video content. Allows you to process, transform, and filter any images from any programming language with machine vision and deep learning APIs. Filter images and video frames according to their NSFW score and apply a blur filter if adult or bloody content is detected using only two PixLab endpoints. Scan government issued documents such as Passports, Visas or ID cards from various countries and automatically extract any detected face via a single PixLab endpoint. Detect input language & extract text content from a given image using state-of-the-art Machine Learning algorithms. Detect all human faces present in a given image first then blur or extract each one of them via a set of PixLab endpoints. Learn how to make a simple program that superpose a flower crown or dog facial members on top of any detected face using only three PixLab endpoints.

Imagetransformlearning

ObjectCut

ObjectCut

Automation

Automatic background removal service powered by AI. From an input image given its public-accessible URL or being the image itself, ObjectCut returns the same image but without background.

objectcutimageremove

Happy Scribe - Transcription & Subtitles

Happy Scribe - Transcription & Subtitles

Automation

With this API you can automatically submit files to be transcribed by Happy Scribe, access existing transcriptions and export them to various formats.

transcriptionsubtitlessrt

Sejda PDF API

Sejda PDF API

Automation

Integrate your website with our PDF tools

pdfautomationweb

Twilio API

Twilio API

Automation

The Twilio Messaging API makes it easy to send and receive SMS and MMS messages as well as query meta-data about text messages such as delivery status, associated media, and leverage tools like Copilot to manage your messages globally at scale.

sendsmsotp

Typeform API

Typeform API

Automation

With Typeform APIs and developer tools, you can do everything from the basics, like tweak your themes and add new images to your account, to the most powerful features Typeform offers, like retrieve responses on demand and customize forms with Hidden Fields. And you can do it all without using the Typeform builder or even logging into Typeform.com!

feedbackformsapi

Asana

Asana

Automation

Customize the Asana experience, leverage your data with the Asana API, and join a community of developers building with Asana.

managetaskswork

Slack API

Slack API

Automation

Build Slack Webhook to send push notifications into channels. Team Instant Messaging. Send messages Messages are the building blocks of apps and bots. Start from “Hello, world,” or connect a service you already use. Give users a shortcut Help users discover what your app can do with Shortcuts. Automate with workflows Harness the power of apps, without the code. Create simple interactions Your app can respond to user activity, and buttons let users complete simple tasks (like requests and approvals).

slackhooknotification