# Chatbot API-specific activities and events

These activities are specific to API chatbot. Microsoft Bot Framework implements these features by using [Direct Line API](https://docs.microsoft.com/en-us/azure/bot-service/bot-service-channel-directline)

## Text

Sends a text message with a time stamp. Text formatting can be used for WebChat, Facebook and WhatsApp - since different channels use different types of formatting, we have introduced automatic conversion in our application and it is enough to always send HTML elements to the mluvii. The following tags are allowed: `<strong>` `<em>` `<a>`.

Other tags are removed and ignored.

For the Apple channel, you can use `‘n‘`

&#x20;to insert a new line.

**Example of a text message:**

```json
{
  "sessionId": <long>,
  "type": "mluvii",
  "timestamp": "2020-09-09T10:03:53.4976861+02:00",
  "text": "Simple sample"
}
```

**Example of formatted text message:**

```json
{
  "sessionId": <long>,
  "type": "mluvii",
  "timestamp": "2020-09-09T10:03:53.4976861+02:00",
  "text": "<em>Italic part</em>, <strong>Bold part</strong>"
}
```

## Events

### Incoming message

When a client sends a text message to a chat, the following activity arrives at the callback url:

```json
{
  "sessionId": <long>,
  "activity": "Text",
  "text": "Hello world"
}
```

### Incoming file

If the client uploads the file using a paper clip in the chat input, it bot gets an Activity in the following format.

```json
{
  "activity": "GuestFileUpload",
  "fileUrl": <string>, (URL of file uploaded by a client)
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mluvii.com/en/for-it-specialists/chatbot-connection/api-chatbot/chatbot-api-specific-activities-and-events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
