1. Advanced Configuration
  2. Heimdall Routing

Advanced Configuration

Heimdall Routing

Setting up the webchat notification system

  • Using heimdall you can listen to events from all webchat clients.
  • Webchat data received from heimdall is placed in stub.data.heimdall.webchat.
  • There are multiple events you can listen to on heimdall but the most important event is firstmessage.
  • The firstmessage event fires when a user sends a webchat message.
  • Create the heimdall registration stubber.systems.notifications.webchat.org.{{stub.orguuid}}.name.new_webchat_profile.webchatmessagetype.firstmessage

Receiving payloads from webchat client via heimdall

On webchat Open

When a user opens up the chat window an event is emitted on the following Heimdall path:

stubber.systems.notifications.webchat.org.{{orguuid}}.name.{{chatname}}.webchatmessagetype.initialize

Any Stub registered on this path will receive the following payload:

Initial Payload
        "heimdall": {
  "webchat": {
    "sessionuuid": "23532740-07df-4628-af83-43db12c8f4ad",
    "webchat_configuration": {
      "orguuid": "96305d53-2fb0-512d-9d59-3f2b03aa679a",
      "chatname": "documentationexample",
      "passthroughData": "{'some':'data'}"
    }
  }
}

      

The purpose of this message is to allow the stub to get the session uuid of the new user. You may also use the session uuid to send a message before the user responds.

On user first message

When a user sends their first message an event is emitted on the following Heimdall path:

stubber.systems.notifications.webchat.org.{{orguuid}}.name.{{chatname}}.sessionuuid.{{sessionuuid}}.webchatmessagetype.firstmessage

Any Stub registered on this path will receive the following payload:

Client message payload
        "heimdall": {
  "webchat": {
    "sessionuuid": "23532740-07df-4628-af83-43db12c8f4ad",
    "webchat_message": {
      "type": "text",
      "value": "user message"
    },
    "webchat_configuration": {
      "orguuid": "96305d53-2fb0-512d-9d59-3f2b03aa679a",
      "chatname": "documentationexample",
      "passthroughData": "{'some':'data'}"
    }
  }
}

      

On user message

When a user sends a message an event is emitted on the following Heimdall path:

stubber.systems.notifications.webchat.org.{{orguuid}}.name.{{chatname}}.sessionuuid.{{sessionuuid}}.webchatmessagetype.message

Any Stub registered on this path will receive the following payload:

Client message payload
        "heimdall": {
  "webchat": {
    "sessionuuid": "23532740-07df-4628-af83-43db12c8f4ad",
    "webchat_message": {
      "type": "text",
      "value": "user message"
    },
    "webchat_configuration": {
      "orguuid": "96305d53-2fb0-512d-9d59-3f2b03aa679a",
      "chatname": "documentationexample",
      "passthroughData": "{'some':'data'}"
    }
  }
}

      

On configuration submit

When a user submits data into a field an event is emitted on the following Heimdall path:

stubber.systems.notifications.webchat.org.{{orguuid}}.name.{{chatname}}.sessionuuid.{{sessionuuid}}.sessionuuid.{{sessionuuid}}.webchatmessagetype.configuration

Any Stub registered on this path will receive the following payload:

Client configuration payload
        "heimdall": {
  "webchat": {
    "sessionuuid": "23532740-07df-4628-af83-43db12c8f4ad",
    "webchat_client_configuration": {
      "platform_switch": {
        "platform_name": "whatsapp",
        "type": "mobile",
        "value": "+18005550100"
      }
    },
    "webchat_configuration": {
      "orguuid": "96305d53-2fb0-512d-9d59-3f2b03aa679a",
      "chatname": "documentationexample",
      "passthroughData": "{'some':'data'}"
    }
  }
}