Engagement API | Version: 1

Pypestream's Engagement API (v1) empowers developers to build interfaces enabling end-users to engage with a business and connect common messaging channels (e.g., Slack, Facebook Messenger, etc.) with the Pypestream platform. The Engagement API currently supports communication between end-users and microapps.

Functions

The Pypestream Engagement API provides the following key features:

  • Create a user: Create an ID for the end-user that will engage with the business.
  • Start an engagement: Initiate an engagement between an end-user and a microapp.
  • Send messages: Enable end-users to communicate with a microapp.
  • End an engagement: Terminate the engagement between an end-user and a microapp.

Integrating with the Engagement API

At a high level, integrating with the Engagement API involves:

  1. Creating a User
  2. Opening a WebSocket connection
  3. Joining the chat channel chat:{CHAT_ID} in the WebSocket
  4. Starting an Engagement
  5. Waiting until you receive the chat:ready event through the WebSocket
  6. Sending a message
  7. Handle the incoming:msg events received in the WebSocket
  8. Ending the engagement