SAP Open Connectors

Intercom Events

SAP Open Connectors supports events via polling or webhooks depending on the API provider. For more information about our Events framework, see Events Overview.

Supported Events and Resources

SAP Open Connectors supports both polling and webhook events for Intercom. After receiving an event, SAP Open Connectors standardizes the payload and sends an event to the configured callback URL of your authenticated connector instance.

Polling

You can set up polling for the events resource. You can also copy the events configuration to poll other resources. See Configure Polling Through API for more information.

Note: Unless configured for a specific time zone, polling occurs in UTC.

Configure Polling Through the UI

To configure polling through the UI, follow the same steps to authenticate a connector instance, and then turn on events. Select the resources to poll, and then click Create Instance. For more information, see Authenticate an Connector Instance with Events (UI) or the connector-specific authentication topic.

Configure Polling Through API

Use the /instances endpoint to authenticate with Intercom and create a connector instance with polling enabled.

Note: The endpoint returns a connector instance token and id upon successful completion. Retain the token and id for all subsequent requests involving this connector instance.

To authenticate a connector instance with polling:

  1. Construct a JSON body as shown below (see Parameters):

    {
      "element": {
        "key": "intercom"
      },
      "providerData": {
        "code": "<AUTHORIZATION_GRANT_CODE>"
      },
      "configuration": {
        "oauth.api.key": "xxxxxxxxxxxxxxxxxxxx",
        "oauth.api.secret": "xxxxxxxxxxxxxxxxxxxxx",
        "oauth.callback.url": "https://xxxxxxxxxxxxxxxx/oauth",
        "oauth.user.refresher_time": null,
        "oauth.user.refresher_token": null,
        "event.notification.enabled": true,
        "event.poller.refresh_interval": "15",
        "event.vendor.type": "polling",
        "filter.response.nulls": "true",
        "event.poller.configuration": {
          "conversations": {
            "url": "/hubs/marketing/conversations?orderBy=updated_at desc",
            "idField": "id",
            "datesConfiguration": {
              "updatedDateField": "updated_at",
              "updatedDateFormat": "timestamp",
              "updatedDateTimezone": "GMT",
              "createdDateField": "created_at",
              "createdDateFormat": "timestamp",
              "createdDateTimezone": "GMT"
            }
          }
        }
      },
      "tags": [
        "<ADD_YOUR_TAG>"
      ],
      "name": "<INSTANCE_NAME>"
    }
  2. Call the following, including the JSON body you constructed in the previous step:

    POST /instances
    
    Note: Make sure that you include the User and Organization keys in the header. For more information, see Authorization Headers, Organization Secret, and User Secret.
  3. Locate the token and id in the response and save them for all future requests using the connector instance.

Example cURL with Polling

curl -X POST \
https://api.openconnectors.us2.ext.hana.ondemand.com/elements/api-v2/instances \
-H 'authorization: User <USER_SECRET>, Organization <ORGANIZATION_SECRET>' \
-H 'content-type: application/json' \
-d '{
  "element": {
    "key": "intercom"
  },
  "providerData": {
    "code": "oiu3gr1g2roi12ruioiu190f9"
  },
  "configuration": {
    "oauth.api.key": "xxxxxxxxxxxxxxxxxxxx",
    "oauth.api.secret": "xxxxxxxxxxxxxxxxxxxxx",
    "oauth.callback.url": "https://mycoolapp.com/oauth",
    "event.notification.enabled": true,
    "event.poller.refresh_interval": "15",
    "event.vendor.type": "polling",
    "filter.response.nulls": "true",
    "event.poller.configuration": {
      "conversations": {
        "url": "/hubs/marketing/conversations?orderBy=updated_at desc",
        "idField": "id",
        "datesConfiguration": {
          "updatedDateField": "updated_at",
          "updatedDateFormat": "timestamp",
          "updatedDateTimezone": "GMT",
          "createdDateField": "created_at",
          "createdDateFormat": "timestamp",
          "createdDateTimezone": "GMT"
        }
      }
    }
  },
  "tags": [
    "Marketing"
  ],
  "name": "API Instance with Polling"
}

Webhooks

You can configure webhooks through the UI or through API in the JSON body of the /instances API call. First, you must set up webhooks in Intercom. 

Set Up Webhooks

Follow these steps to set up your Intercom application with the endpoint.

  1. Via a web browser, sign in to your Intercom developer account at https://app.intercom.com.
  2. In the developer app dashboard, select the app that you'd like to send webhooks for.
  3. Select Webhooks from the navigation items displayed on the left.
    The Webhooks page appears, where you see a field to enter your request endpoint URL. 
  4. In order to enter this URL, create an instance of the Intercom connector. While creating an instance, enable Events under Events Configuration and select Webhook as the Event Type
  5. Click Create Instance.
  6. Choose an account through which you'd like to create an instance.
  7. You're now taken back to SAP Open Connectors. Select Instances on the navigation pane on your left and edit your instance.
  8. You will see a field named Webhook URL. Copy the URL in that field.
  9. Back on the Intercom page, click Edit, complete step 4 and click Save.
  10. Next, you'll need to set up individual subscriptions for each object and event type for which you'd like to receive a notification. Do this by selecting Webhook Topics according to your needs. Webhook Topics are types of notifications that your app can subscribe to.
  11. Click Edit on the top right corner and select topic/s to configure the subscription/s as shown below.

Configure Webhooks Through the UI

To configure webhooks through the UI, follow the same steps to authenticate a connector instance, and then turn on events. For more information, see Authenticate an Connector Instance with Events (UI) or the connector-specific authentication topic.

Configure Webhooks Through API

Use the /instances endpoint to authenticate with Intercom and create a connector instance with webhooks enabled.

Note: The endpoint returns a connector instance token and id upon successful completion. Retain the token and id for all subsequent requests involving this connector instance.

To authenticate a connector instance with webhooks:

  1. Get an authorization grant code by completing the steps in Getting a redirect URL and Authenticating users and receiving the authorization grant code.
  2. Construct a JSON body as shown below (see Parameters):

    {
      "element": {
        "key": "intercom"
      },
      "providerData": {
        "code": "<AUTHORIZATION_GRANT_CODE>"
      },
      "configuration": {
        "oauth.api.key": "<Intercom API key>",
        "oauth.api.secret": "<Intercom API secret>",
        "oauth.callback.url": "<Intercom Authorization callback URL >",
        "event.notification.enabled": true,
        "event.vendor.type": "webhooks",
        "event.notification.callback.url": "<CALLBACK_URL>",
        "event.notification.signature.key": "<OPTIONAL_SIGNATURE_KEY>"
      },
      "tags": [
        "<Add_Your_Tag>"
      ],
      "name": "<INSTANCE_NAME>"
    }
    
  3. Call the following, including the JSON body you constructed in the previous step:

    POST /instances
    
    Note: Make sure that you include the User and Organization keys in the header. For more information, see Authorization Headers, Organization Secret, and User Secret.
  4. Locate the token and id in the response and save them for all future requests using the connector instance.

Example cURL

curl -X POST \
 https://api.openconnectors.us2.ext.hana.ondemand.com/elements/api-v2/instances \
  -H 'authorization: User <USER_SECRET>, Organization <ORGANIZATION_SECRET>' \
  -H 'content-type: application/json' \
  -d '{
  "element": {
    "key": "intercom"
  },
  "providerData": {
    "code": "xoz8AFqScK2ngM04kSSM"
  },
  "configuration": {
    "oauth.api.key": "Rand0MAP1-key",
    "oauth.api.secret": "fak3AP1-s3Cr3t",
    "oauth.callback.url": "https://mycoolapp.com",
    "event.notification.enabled": true,
    "event.vendor.type": "webhooks",
    "event.notification.callback.url": "https://mycoolapp.com/events",
    "event.notification.signature.key": "xxxxxxxxxxxxxxxxxxxxxxxxx"
  },
  "tags": [
    "Marketing"
  ],
  "name": "API Instance"
}'

Parameters

API parameters are in code formatting.

ParameterDescriptionData Type
keyThe connector key.
intercom
string
codeThe authorization grant code returned from the API provider in an OAuth2 authentication workflow.string
Name
name
The name for the connector instance created during authentication.string
authentication.typeIdentifies how you are authenticating with Intercom.string
oauth.callback.urlOAuth 2.0 authentication only. The URL where you want to redirect users after they grant access. This is https://auth.cloudelements.io/oauth, the Callback URL that you noted in API Provider Setup.string
oauth.api.keyOAuth 2.0 authentication only. The Client ID from Intercom. This is the Client ID that you noted in API Provider Setupstring
oauth.api.secretOAuth 2.0 authentication only. The Client Secret from Intercom. This is the Client Secret that you noted in API Provider Setup.string
Events Enabled
event.notification.enabled
Optional. Identifies that events are enabled for the connector instance.
Default: false
boolean
Event Type
event.vendor.type
Optional. Identifies the type of events enabled for the instance, either webhook or polling.string
Event Notification Callback URL
event.notification.callback.url
For webhooks and polling.
The URL where your app can receive events.
string
Callback Notification Signature Key
event.notification.signature.key
For webhooks and polling.
Optional
A user-defined key for added security to show that events have not been tampered with. This can be any custom value that you want passed to the callback handler listening at the provided Event Notification Callback URL.
string
Objects to Monitor for Changes
event.objects
For webhooks and polling.
Optional
Comma separated list of objects to monitor for changes.
string
Event poller refresh interval (mins)
event.poller.refresh_interval
For polling only.
A number in minutes to identify how often the poller should check for changes.
number
Configure Polling
event.poller.configuration
Optional*. Configuration parameters for polling.JSON object
resource name
e.g., contact, account, etc.
The configuration of an individual resource.JSON object
URL
url
The url to query for updates.String
ID Field
idField
The field that is used to uniquely identify an object.String
Advanced Filtering
datesConfiguration
Configuration parameters for dates in pollingJSON Object
Updated Date Field
updatedDateField
The field that identifies an updated object.String
Updated Date Format
updatedDateFormat
The date format of the field that identifies an updated object.String
Created Date Field
createdDateField
The field that identifies a created object.String
Created Date Format
createdDateFormat
The date format of the field that identifies a created object.String
tagsOptional. User-defined tags to further identify the instance.string