← Intercom + Twitter integrations

Search Tweets with Twitter API on New Event from Intercom API

Pipedream makes it easy to connect APIs for Twitter, Intercom and 1200+ other apps remarkably fast.

Trigger workflow on
New Event from the Intercom API
Next, do this
Search Tweets with the Twitter API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜

Trusted by 500,000+ developers from startups to Fortune 500 companies

Adyen logo
Brex logo
Carta logo
Checkr logo
Chameleon logo
DevRev logo
LinkedIn logo
Netflix logo
New Relic logo
OnDeck logo
Replicated logo
Scale AI logo
Teamwork logo
Warner Bros. logo
Xendit logo

Developers Pipedream

Getting Started

This integration creates a workflow with a Intercom trigger and Twitter action. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Select this integration
  2. Configure the New Event trigger
    1. Connect your Intercom account
    2. Configure Polling Interval
    3. Select one or more Users
  3. Configure the Search Tweets action
    1. Connect your Twitter account
    2. Configure Query
    3. Optional- Configure Max Results
  4. Deploy the workflow
  5. Send a test event to validate your setup
  6. Turn on the trigger

Details

This integration uses pre-built, source-available components from Pipedream's GitHub repo. These components are developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Trigger

Description:Emit new event for each new Intercom event for a user.
Version:0.0.3
Key:intercom-new-event

Trigger Code

import common from "../common.mjs";

export default {
  ...common,
  key: "intercom-new-event",
  name: "New Event",
  description: "Emit new event for each new Intercom event for a user.",
  version: "0.0.3",
  type: "source",
  dedupe: "unique",
  props: {
    ...common.props,
    userIds: {
      propDefinition: [
        common.props.intercom,
        "userIds",
      ],
    },
  },
  methods: {
    _getNextUrl(userId) {
      return this.db.get(userId) || null;
    },
    _setNextUrl(userId, nextUrl) {
      this.db.set(userId, nextUrl);
    },
    generateMeta({
      id, event_name: eventName, created_at: createdAt,
    }) {
      return {
        id,
        summary: eventName,
        ts: createdAt,
      };
    },
  },
  async run() {
    for (const userId of this.userIds) {
      let nextUrl = this._getNextUrl(userId);
      const results = await this.intercom.getEvents(userId, nextUrl);
      for (const result of results.events) {
        const meta = this.generateMeta(result);
        this.$emit(result, meta);
      }
      // store the latest 'since' url by the userId
      if (results.nextUrl) {
        this._setNextUrl(userId, nextUrl);
      }
    }
  },
};

Trigger Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
IntercomintercomappThis component uses the Intercom app.
N/Adb$.service.dbThis component uses $.service.db to maintain state between executions.
Polling Intervaltimer$.interface.timer

Pipedream will poll the API on this schedule

UsersuserIdsstring[]Select a value from the drop down menu.

Trigger Authentication

Intercom uses OAuth authentication. When you connect your Intercom account, Pipedream will open a popup window where you can sign into Intercom and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Intercom API.

Pipedream requests the following authorization scopes when you connect your account:

About Intercom

Customer messaging platform

Action

Description:Retrieve Tweets from the last seven days that match a query. [See docs here](https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-recent)
Version:1.1.3
Key:twitter-simple-search

Action Code

import app from "../../app/twitter.app.mjs";
import { ACTION_ERROR_MESSAGE } from "../../common/errorMessage.mjs";
import { defineAction } from "@pipedream/types";
import { getMultiItemSummary, getTweetFields, } from "../../common/methods.mjs";
export const DOCS_LINK = "https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-recent";
const MIN_RESULTS = 10;
const DEFAULT_RESULTS = 10;
export const MAX_RESULTS_PER_PAGE = 100;
export default defineAction({
    key: "twitter-simple-search",
    name: "Search Tweets",
    description: `Retrieve Tweets from the last seven days that match a query. [See docs here](${DOCS_LINK})`,
    version: "1.1.3",
    type: "action",
    props: {
        app,
        query: {
            propDefinition: [
                app,
                "query",
            ],
        },
        maxResults: {
            propDefinition: [
                app,
                "maxResults",
            ],
            min: MIN_RESULTS,
            description: `Maximum amount of items to return. Each request can return up to ${MAX_RESULTS_PER_PAGE} items.`,
            default: DEFAULT_RESULTS,
        },
    },
    methods: {
        getMultiItemSummary,
        getTweetFields,
    },
    async run({ $ }) {
        try {
            const params = {
                $,
                maxPerPage: MAX_RESULTS_PER_PAGE,
                maxResults: this.maxResults,
                params: {
                    query: this.query,
                    ...this.getTweetFields(),
                },
            };
            const response = await this.app.searchTweets(params);
            $.export("$summary", this.getMultiItemSummary("tweet", response.data?.length));
            return response;
        }
        catch (err) {
            $.export("error", err);
            throw new Error(ACTION_ERROR_MESSAGE);
        }
    },
});

Action Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI.

LabelPropTypeDescription
TwitterappappThis component uses the Twitter app.
Queryquerystring

One query for matching Tweets. See the Twitter API guide on building queries.

Max ResultsmaxResultsinteger

Maximum amount of items to return. Each request can return up to 100 items.

Action Authentication

Twitter uses OAuth authentication. When you connect your Twitter account, Pipedream will open a popup window where you can sign into Twitter and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Twitter API.

Pipedream requests the following authorization scopes when you connect your account:

About Twitter

From breaking news and entertainment to sports and politics, get the full story with all the live commentary. Use a Twitter developer app you've created to send API requests.

More Ways to Connect Twitter + Intercom

Advanced Search with Twitter API on New Closed Conversation from Intercom API
Intercom + Twitter
 
Try it
Simple Search with Twitter API on New Closed Conversation from Intercom API
Intercom + Twitter
 
Try it
Advanced Search with Twitter API on Lead Added Email from Intercom API
Intercom + Twitter
 
Try it
Simple Search with Twitter API on Lead Added Email from Intercom API
Intercom + Twitter
 
Try it
Advanced Search with Twitter API on New Reply From Admin from Intercom API
Intercom + Twitter
 
Try it
New Companies from the Intercom API

Emit new event each time a new company is added.

 
Try it
New Reply From Admin from the Intercom API

Emit new event each time an admin replies to a conversation.

 
Try it
New Conversations from the Intercom API

Emit new event each time a new conversation is added.

 
Try it
New Reply From User from the Intercom API

Emit new event each time a user replies to a conversation.

 
Try it
New Unsubscriptions from the Intercom API

Emit new event each time a user unsubscribes from receiving emails.

 
Try it
Create Note with the Intercom API

Creates a note for a specific user. See the docs here

 
Try it
Send Incoming Message with the Intercom API

Send a message from a user into your Intercom app. See the docs here

 
Try it
Search Tweets with the Twitter API

Retrieve Tweets from the last seven days that match a query. See docs here

 
Try it
Add User To List with the Twitter API

Add a member to a list owned by the user. See docs here

 
Try it
Create Tweet with the Twitter API

Create a new tweet. See docs here

 
Try it

Explore Other Apps

1
-
12
of
1200+
apps by most popular

HTTP / Webhook
HTTP / Webhook
Get a unique URL where you can send HTTP or webhook requests
Node
Node
Anything you can do with Node.js, you can do in a Pipedream workflow. This includes using most of npm's 400,000+ packages.
Beta
Python
Python
Anything you can do in Python can be done in a Pipedream Workflow. This includes using any of the 350,000+ PyPi packages available in your Python powered workflows.
Schedule
Schedule
Trigger workflows on an interval or cron schedule.
Beta
Data Stores
Data Stores
Use Pipedream Data Stores to manage state throughout your workflows.
Telegram Bot
Telegram Bot
Telegram is a cloud-based instant messaging and voice over IP service
OpenAI (ChatGPT)
OpenAI (ChatGPT)
OpenAI is an AI research and deployment company with the mission to ensure that artificial general intelligence benefits all of humanity. They are the makers of popular apps like ChatGPT and DALL·E 2.
Google Sheets
Google Sheets
With Google Sheets, you can create, edit, and collaborate wherever you are
Discord
Discord
Use this app to create a Discord source that emits messages from your guild to a Pipedream workflow.
GitHub
GitHub
Where the world builds software. Millions of developers and companies build, ship, and maintain their software on GitHub—the largest and most advanced development platform in the world.
Formatting
Formatting
Pre-built actions to make formatting and manipulating data within your workflows easier.
Slack
Slack
Slack is a channel-based messaging platform. With Slack, people can work together more effectively, connect all their software tools and services, and find the information they need to do their best work — all within a secure, enterprise-grade environment.