Microsoft Bot Framework

Sample implementation

An example of bot implementation with integration for Mluvii is available for Gitlab.

Supported formats of Microsoft Hero Cards

At this moment, Mluvii supports the following card functionality Hero Card: Hero Card Type (contentType):

  • application/vnd.microsoft.card.hero

  • application/vnd.microsoft.card.thumbnail

Attachment Layout:

  • List

  • Carousel

Chat input properties:

Integration with Mluvii

The chatbot created in the Microsoft Bot Framework can communicate through ChannelData. For example, it can list the available operators or send an email from the client.

Example of submitting a request

private async Task ConnectToOperator(IDialogContext context)
        {
            var data = JObject.Parse(@"{ ""Activity"": ""Forward"" }");
            var act = context.MakeMessage();
            act.ChannelData = data;
            await context.PostAsync(act);
        }

Example of answer

private async Task OnMessageRecieved(IDialogContext context, IAwaitable<IMessageActivity> result)
        {
            var activity = await result;
            if (activity.AsEventActivity() != null && activity.ChannelData != null)
                {
                    var availibleOperatorsInfo =
                        JsonConvert.DeserializeObject<GetAvailableOperatorsResponse>(activity.ChannelData);
                    await OnAvailibleOperatorsResponse(context, availibleOperatorsInfo);
                }
        }

Mluvii channel identification

When communicating with a bot, the speech is identified by constant Id “mluvii_guest” in theFromfield. E.g.:

"channelId": "directline"
...
"from": {
    "id": "mluvii_guest"
}
...
"conversation": {

Supported messages

  1. GetAvailableOperators

  2. Forward

  3. GetCallParams

  4. SetCallParams

  5. SendGuestOfflineEmail

  6. ChatbotOpenFileUploadPrompt

  7. GetGuestIdentity

  8. EnableGuestUpload

  9. DisableGuestUpload

GetAvailableOperators

Acquires a list of registered operators. Returns only operators from the groups defined in routing, which meet the routing conditions.

Request JSON:

{
    "Activity": "GetAvailableOperators"
}

Response JSON:

{
   "Activity": "GetAvailableOperatorsResponse"
   "AvailableOperators":[
      {
         "DisplayName":"Katka",
         "UserId":1
      },
      {
         "DisplayName":"Tomáš",
         "UserId":2
      }
   ]
}
Forward

Redirects interaction for a live operator. If neither the target operator nor the group is defined, the group is automatically selected according to the settings of routing commands.

Request JSON:

{
    "Activity": "Forward",
    "OperatorGroupId": <integer:optional>,
    "UserId": <integer:optional>
}
GetCallParams

Acquires CallParams associated with an active session.

Request JSON:

{
    "Activity": "GetCallParams"
}

Response JSON:

{
    "Activity": "GetCallParamsResponse",
    "CallParams":<dictionary>
}
SetCallParams

Set CallParams to active session.

Request JSON:

{
    "Activity": "SetCallParams",
    "CallParams":<dictionary>
}

Response JSON:

{
   "Activity": "SetCallParamsResponse"
   "Success": <boolean>,
   "ErrorMessage": <string>
}
SendGuestOfflineEmail

Sends an email to an address for messages from an offline form.

Request JSON:

{
    "Activity": "SendGuestOfflineEmail",
    "Subject":<string>,
    "Message":<string>,
    "Location":<string> (custom identifier, e.g. "Chatbot John")
}
ChatbotOpenFileUploadPrompt

Opens a dialog box to allow the user to upload the file.

Request JSON:

{
    "Activity": "ChatbotOpenFileUploadPrompt"
}

Response JSON:

{
   "Activity": "ChatbotOpenFileUploadPromptResponse"
   "FileUrl": <string>, (URL of the uploaded file)
}
GetGuestIdentity

Gets properties from customer identity

Request JSON:

{
    "Activity": "GetGuestIdentity"
}

Response JSON:

{
   "Activity": "GetGuestIdentityResponse"
   "TrackedGuestGuid": <Guid>, (cookie ID)
   "PhoneCallerId": <string>, (phone number)
   "FacebookPSID": <string>, (facebook ID )
   "FacebookPageId": <string>, (facebook ID )
}
EnableGuestUpload

Enable functions that allow user file upload.

Request JSON:

{
    "Activity": "EnableGuestUpload"
}

Response JSON:

{
   "Activity": "EnableGuestUploadResponse",
   "Success": <boolean>,
   "ErrorMessage": <string>
}
DisableGuestUpload

Disable functions that allow user file upload.

Request JSON:

{
    "Activity": "DisableGuestUpload"
}

Response JSON:

{
   "Activity": "DisableGuestUploadResponse",
   "Success": <boolean>,
   "ErrorMessage": <string>
}

results matching ""

    No results matching ""