Module intercom

ballerinax/intercom Ballerina library

1.0.1

Overview

Intercom is a customer service platform that enables businesses to communicate with customers through messaging, support, and engagement tools, helping companies build better customer relationships at scale.

The ballerinax/intercom package offers APIs to connect and interact with Intercom API endpoints, specifically based on Intercom API v2.15.

Key Features

  • Contacts management — create, update, search, and delete contacts
  • Conversations management — create, retrieve, update, and reply to conversations
  • Ticket management — create, update, reply to, and delete support tickets
  • Articles and knowledge base management — manage help center articles
  • Tags management — create and assign tags to contacts, conversations, and tickets
  • Companies management — create, update, and retrieve company data
  • Admins management — retrieve admin details and manage team assignments

Setup guide

To use the Intercom connector, you must have access to the Intercom API through an Intercom developer account and obtain an API access token. If you do not have an Intercom account, you can sign up for Intercom.

Create an Intercom account

  1. Navigate to the Intercom website and sign up for an account or log in if you already have one.

  2. Ensure you have a paid plan (Starter plan or higher), as API access is not available on the free trial version.

Generate an API access token

  1. Log in to your Intercom account.

  2. Navigate to Settings (gear icon in the top right corner), then select For Developers from the left sidebar.

  3. In the Developer Hub, click on Your Apps, then select New app to create a new app or select an existing app.

  4. Once in your app, go to the Configure tab and scroll down to the Access Token section to generate your access token.

Tip: Copy and store this token somewhere safe. It will not be visible again in your account settings for security reasons.

Quickstart

To use the intercom connector in your Ballerina application, modify the .bal file as follows:

Step 1: Import the module

Copy
import ballerinax/intercom;

Step 2: Instantiate a new connector

  1. Create a Config.toml file and configure the obtained access token:
Copy
token = "<Your_Intercom_Access_Token>"
  1. Create an intercom:ConnectionConfig and initialize the client:
Copy
configurable string token = ?;

final intercom:Client intercomClient = check new ({
    auth: {
        token
    }
});

Step 3: Invoke the connector operation

Now, utilize the available connector operations.

Create a contact

Copy
public function main() returns error? {
    intercom:ContactsBody newContact = {
        email: "user@example.com",
        name: "User Name"
    };

    intercom:ContactWithPush response = check intercomClient->/contacts.post(newContact);
}

Create a conversation

Copy
public function main() returns error? {
    intercom:CreateConversationRequest payload = {
        body: "Hello, I need help with my account.",
        'from: {'type: "user", id: "<contact_id>"}
    };

    intercom:ConversationMessage response = check intercomClient->/conversations.post(payload);
}

Examples

The ballerinax/intercom connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:

  1. Support team analytics - Demonstrates how to analyze support team performance metrics using the Ballerina Intercom connector.
  2. Priority ticket escalation - Illustrates automating the escalation of high-priority support tickets.
  3. Support ticket automation - Shows how to automate support ticket creation and management workflows.
  4. Knowledge base management - Demonstrates managing and updating knowledge base articles programmatically.

Import

import ballerinax/intercom;Copy

Other versions

1.0.1

1.0.0

Metadata

Released date: 9 days ago

Version: 1.0.1

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.13.0

GraalVM compatible: Yes


Pull count

Total: 3

Current verison: 2


Weekly downloads


Source repository


Keywords

customer support

messaging

conversations

tickets

contacts

Vendor/Intercom

Area/Communication

Type/Connector


Contributors