Chime Bot Check API

Overview

The Chime Bot Checker is a REST API service that is provided to assist in monitoring the health and responsiveness of Chime queues and their Bot Framework endpoints.

The API provides an endpoint which can be used to impersonate a Chime agent, make a connection through Bot Framework to a Chime queue, and then verify that an answering message is received from the queue.

Conceptually, this is identical to the flow that would occur in the Teams Client if an agent sends a chat message to a queue that they are a member of:

Bot Check API Sequence

graph TD Z[Client] --> |Client posts request|A A[Chime Bot Check API] -->|Send Message as agent over DirectLine| B(Bot Framework) B -->|BotFramework posts activity to Chime| C[Chime Server] C -->|Chime Server distributes activity to the queue| D[Chime Queue] D --> |Queue sends response through Bot Framework|B B --> |Bot Check API receives message response|A A --> |HTTP 200|Z

API Information

The Chime Bot Checker API is hosted at https://chimebotchecker.azurewebsites.net/ There is Swagger documentation and interactive access available at https://chimebotchecker.azurewebsites.net/swagger/index.html

The API endpoint is:

POST https://chimebotchecker.azurewebsites.net/BotChecker

It expects an application/json body for passing the parameters that will be used to connect to the queue

  • userUri - string: For Chime 3.1.636 and lower - This should be the URI for an agent as configured in the Admin/People section of Chime For Chime 3.1.637+ - This parameter can be omitted.
  • directLineSecret - string: The Direct Line channel secret key for the Bot Framework queue endpoint that should be contacted.

The userUri parameter is found as shown below: This should be a user who is an agent in the queue that is being targeted for best results.

The directLineSecret parameter can be found using the Azure portal for the Bot Framework Bot Registration. Navigate to Channels, then Direct Line. The key is initially hidden.

Responses

Successful Response

Error - Incorrectly formatted userUri

Error - Incorrect Bot Framework Secret

Error - Queue that is not running or not responsive

This indicates that when the API sent a message to the queue, it did not receive a response, which would indicate that the queue needs to be inspected.

Example Code

cURL

curl -X POST "https://chimebotchecker.azurewebsites.net/BotChecker" 
     -H  "accept: text/plain" 
     -H  "Content-Type: application/json" 
     -d "{\"userUri\":\"sip:agent@example.com\",\"directLineSecret\":\"abcdefghi1234567890\"}"

C#

HttpClient client = new HttpClient();
HttpContent content = new StringContent(
    JsonConvert.SerializeObject( new {
      userUri = "sip:agent@example.com",
      directLineSecret = "abcdefghi1234567890"
    }), 
    UnicodeEncoding.UTF8, 
    "application/json"
);

HttpResponseMessage result = await client.PostAsync("https://chimebotchecker.azurewebsites.net/BotChecker", content);
fghazi