Events Subscription

The Events API Subscription allows you to subscribe to various types of events from ClearFeed. Whenever an event of the selected type occurs, ClearFeed will send a POST request to the URL you specify in this setting.

Subscribing to Events

  1. Go to the Developer Settings page and find the "Events API Subscription" section.

  2. Enter the URL of your server or application endpoint where you want to receive the events.

  3. Click the "Save" button to save your subscription preferences.

Endpoint Requirements

Before saving the Events API Subscription endpoint, please ensure the following:

  1. The URL must start with https.

  2. The endpoint should respond with an HTTP status code of 200 to confirm successful receipt of a test ping. Returning anything other than 200 will not allow you to save the endpoint.

Receiving Events

When an event occurs, ClearFeed will send a POST request to the specified URL with relevant event data. The payload of the POST request will contain information about the event, allowing you to take appropriate actions on your end.

Event Headers

The following headers are sent with every request:

{
  'X-CF-Signature': signature,
  'X-CF-Timestamp': timestamp,
  'X-CF-Retry-Count': number
}

The X-CF-Timestamp header indicates the UNIX timestamp at which the event occurred in ClearFeed. The X-CF-Retry-Count header indicates the number of times ClearFeed tried to deliver the event. The value ranges from 0 to 3.

Supported Events

Request Created
{
  "id": "f86719a97f3c9e4b4d03c47b5a95b01d",
  "type": "request",
  "sub_type": "created",
  "source": "slack_event",
  "request": {
    "id": 352,
    "state": "Pending",
    "title": "Urgent: Payment Issue",
    "channel_id": "CHJ34K2L0PE",
    "collection_id": 11,
    "priority": "urgent",
    "request_thread": {
      "channel_id": "CHJ34K2L0PE",
      "team_id": "T0987ABCD23",
      "thread_ts": "1793901532.775815"
    },
    "triage_thread": {
      "channel_id": "CHJ34K2L0PE",
      "team_id": "T0987ABCD23",
      "thread_ts": "1793901540.119234"
    }
  },
  "event": {
    "type": "message",
    "visibility": "public",
    "source": "support_channel",
    "request_channel": {
      "channel_id": "CHJ34K2L0PE",
      "team_id": "T0987ABCD23",
      "text": "Hey team, we have an urgent issue. Can someone assist?",
      "ts": "1793901532.775815",
      "user_id": "U09XYZ456AB"
    },
    "triage_channel": {
      "channel_id": "CHJ34K2L0PE",
      "team_id": "T0987ABCD23",
      "text": "Hey team, we have an urgent issue. Can someone assist?",
      "ts": "1793901540.119234",
      "user_id": "U09XYZ456AB"
    }
  }
}
Request Updated
{
  "id": "a98b5e73e7f4c21d52e067a8e51c31af",
  "type": "request",
  "sub_type": "updated",
  "source": "slack_event",
  "request": {
    "id": 512,
    "state": "In Review",
    "title": "Sure, I'll take care of it.",
    "channel_id": "CHJ34K2L0PE",
    "collection_id": 7,
    "priority": "medium",
    "request_thread": {
      "channel_id": "CHJ34K2L0PE",
      "team_id": "T0987ABCD23",
      "thread_ts": "1793901532.775815"
    },
    "triage_thread": {
      "channel_id": "CHJ34K2L0PE",
      "team_id": "T0987ABCD23",
      "thread_ts": "1793901540.119234"
    }
  },
  "event": {
    "type": "message",
    "visibility": "public", // private indicates an internal comment added from triage
    "source": "support_channel",
    "request_channel": {
      "channel_id": "CHJ34K2L0PE",
      "team_id": "T0987ABCD23",
      "text": "Understood.",
      "thread_ts": "1793901532.775815",
      "ts": "1793901667.122743",
      "user_id": "U09XYZ456AB"
    },
    "triage_channel": {
      "channel_id": "CHJ34K2L0PE",
      "team_id": "T0987ABCD23",
      "text": "Understood.",
      "thread_ts": "1793901540.119234",
      "ts": "1793901670.551987",
      "user_id": "U09XYZ456AB"
    }
  }
}

Validating Events

To validate that events you receive originated from ClearFeed, read Validating Requests from ClearFeed

Last updated