Sync Slack Channel

Syncing Slack Channel #

This guide explains how to sync a Slack channel with FunnelStory using the API. Syncing a Slack channel will record all the conversations in the channel. If the channel is not synced before then it will sync from last 30 days. If the channel is synced before then it will sync from the last synced time. This can be overridden by using the from parameter as shown in the example below.

Process #

Find the Data Connection ID: #

Get the list of slack channels: #

Use the script below to get the list of channels

fetch("https://app.funnelstory.ai/api/data_connections/{data_connection_id}/slack/channels");

Sync the channel #

fetch("https://app.funnelstory.ai/api/data_connections/{data_connection_id}/sync", {
  method: "POST",
  body: JSON.stringify({
    additional_params: {
      channel_id: "{channel_id}",
    },
  }),
});

Optional: Specify Sync Time Range #

By default, the sync will:

  • Start from the last 30 days if this is the first sync
  • Continue from the last sync time for subsequent syncs

To override this and specify a custom start time:

  1. Get a Unix timestamp from Epoch Converter
  2. Add it to the sync URL as a query parameter: ?from={timestamp}

Example with timestamp:

// Sync messages from a specific timestamp
fetch("https://app.funnelstory.ai/api/data_connections/{data_connection_id}/sync?from=1625097600", {
  method: "POST",
  // ... rest of the fetch options
});

Verify the sync #

Use the script below to verify the sync, run it via the browser console. It will return the list of channels in the workspace and the number of messages synced, first and last message timestamp. If the sync is successful, you should see the channel you synced in the response with the number of messages synced.

fetch("https://app.funnelstory.ai/api/data_connections/{data_connection_id}/slack/channels_data");