Skip to content

Webhook

A webhook is an HTTP callback used by Lynn for event notification through an HTTP POST.

Through the Lynn API, information and/or events can be sent to Lynn, and to enable two-way communication in the application that uses the APIs, a webhook must be available to receive such messaging.

The webhook must be a REST POST API (http, https) that must be reachable by Lynn, and the Body will receive a JSON object with a ReadMessageResponse structure. During the development stage, as a recommendation, the programmer can use the NGROK tool or a similar tool that generates a URL that allows Lynn to reach an interaction that the programmer is debugging on their PC.

ReadMessageResponse

This object has a general data structure that allows you to know the id of the interaction to which the message refers, and may also contain some of the following objects:

{
    "SessionId": "b86be691-2003-471d-XXXX-ac1e2ea83d85",
    "TextMessages": [],
    "MenuMessages": [],
    "EventMessages": [],
    "AwaitingMenu": false,
    "AwaitingText": true,
    "IsOnChatConversation": true,
    "IsAgentConnect": true,
    "AwaitingValidation": null,
    "AwaitingType": "",
    "SupportCancelation": false,
    "SecurityChallenge": "",
    "ExternalConversationId": "",
    "Criteria": "",
    "Value": "",
    "ChannelId": 21,
    "Provider": -1,
    "Tenant": 0000
}
  • SessionId: (GUID) Identifies the session to which the message belongs.

  • AwaitingMenu: (Boolean) Awaiting a response from a menu.

  • AwaitingText: (Boolean) Awaiting text.

  • AwaitingType: (string) Indicates the type of parameter in correlation with AwaitingText.

  • IsOnChatConversation: (Boolean) Interaction state identifies if it was transferred to a call center.

  • isAgentConnect: (Boolean) Interaction state identifies if it already has a connected agent.

  • SupportCancelation: (Boolean) Identifies if it is possible to cancel the current action (CancelCurrent API).

  • Capacity: (Object) Object with the detail of the capacity with which the interaction was created.

  • TextMessages: (Object[]) Array of TextMessage-type objects with the messages that must be displayed to the client.

  • MenuMessages: (Object[]) Array of MenuMessage-type objects with the menu that must be displayed to the client.

  • EventMessages: (Object[]) Array of EventMessage-type objects with the system events.

TextMessage

Object that contains the informative text that must be presented to the client; this text can be an automatic response from the Bot, or a message sent by some call center executive. The message origin can be identified with the UserID data, which can contain the values (BOT, AGENT, CLIENT).

Text Description automatically
generated

  • SessionId: (GUID) with the id of the interaction that identifies the client.

  • Id: (Guid) Message Id.

  • ConversationId (Guid) Conversation Id.

  • Part: (int) Identifies the message origin.

    • 0: BOT

    • 1: CLIENT

    • 2: AGENT

  • PartName: (string) Origin name of the message. In the case of the Bot, the Tenant name; in the case of Agent, the executive's name; in the case of a client, it is the name of the current client.

  • Correlation: (int) Order in which messages and/or events should be played. Messages should be organized by this field and then executed sequentially.

  • Date: (DateTime) Message date.

  • AvailableByVoice: (Boolean) Indicates if the message can be played in audio if the channel supports it.

  • AvailableByText: (Boolean) Indicates that the message can be presented on the platform.

  • Text: (string) The informative text to be presented.

  • Audio: (string) name of the audio to play in that channel support this functionality.

  • VoiceTextMessage: (string) Information that will be played by TextToSpeech(TTS) in case the channel supports the functionality.

  • MessageType: (Int)

  • Interpretación: (int)

  • Images:

  • RedirectOpctions:

  • Label: (string)

  • ChatMessage: (Boolean)

  • ChatMessageIndex: (int)

  • Description: ¿

  • Formater: ¿

Object in which a client action is requested, a menu can be presented to select an option, or request a specific value such as ID number, phone number, email, etc.

Text Description automatically
generated

  • SessionId: (GUID) with the interaction ID that identifies the client.

  • Id: (Guid) Message ID.

  • ConversationId (Guid) Conversation ID.

  • Part: (int) identifies the origin of the message

    • 0: BOT

    • 1: CLIENT

    • 2: AGENT

  • PartName: (string) Name of the message origin, in case of the Bot the name of the Tenant, in case of Agent the name of the executive, in case of the client, it is the name of the current client.

  • Correlation: (int) Order in which messages and/or events should be played, messages should be sorted by this field and then executed sequentially.

  • Date: (DateTime) Message date.

  • AvailableByVoice: (Boolean) Indicates if the message can be played in audio if the channel supports it.

  • AvailableByText: (Boolean) Indicates that the message can be presented on the platform.

  • Title: (string) contains the title of the menu.

  • Options: (object[]) Object that contains the menu options.

    • Index: (int) The order of the options.

    • Text: (string) The option's text.

  • VoiceTitle: (string) The title of the menu to be played with TTS in case the channel supports it.

EventMessages

Object used to identify a large number of Lynn events including (AgentConnect, StartTyping, StopTyping, EndSession, Data, etc)

Text Description automatically
generated