# Stream Conversation (REST)

## Endpoint

The endpoint to access this history summary is working with a POST request, this time the API Token is not necessary.

```url
https://www.owlbot.ai/api/chatbot/ask
```

## Parameters needed

This post request required at least 3 parameters :

| Property        | Type   | Description                                                                |
| --------------- | ------ | -------------------------------------------------------------------------- |
| **prompt**      | string | Required. The question ask to the chatbot (can not exceed 3000 characters) |
| **chatbotUuid** | uuid   | Required. The `UUID` of the chatbot your speaking with.                    |
| **session**     | uuid   | Required. The `UUID` of the session your in.                               |

The `session` parameter can be :&#x20;

* "anonymous" : in this case, you will not be able to manage user conversation history and to get sources from the answer provided by chatbot. Each question asked by users are treated separately and user can not see his own history when ending session.
* `uuid` :  in this case, you have to provide a *valid and unique UUID* to distinguish every users. In this case, you will be able to recover each user history and to get sources.

## Examples

### In Vanilla Javascript&#x20;

```javascript
 async function _sendMessage(message) {
   
    let post = { prompt: message, chatbotUuid: "3c895cd5-1298-4f30-8417-XXXX", 
    session: "d48a5374-e952-4c5f-8c0f-XXXXXXX"}
    
    const response = await fetch(`https://www.owlbot.ai/api/chatbot/ask`, {
      method: 'POST',
      body: JSON.stringify(post),
    })

    if (!response.ok) {
      throw new Error(response.statusText)
    }

    const data = response.body
    if (!data) {
      return
    }

    const reader = data.getReader()
    const decoder = new TextDecoder()
    let done = false

     let answer = "";

    while (!done) {
      const { value, done: doneReading } = await reader.read()
      done = doneReading
      const chunkValue = decoder.decode(value)
      answer  += chunkValue 
        return answer  
      })

    }

    if (done) {
      answer   = ''

      console.log('done')
    }
  }
```


---

# 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://documentation.owlbot.ai/chat-with-chatbot/stream-conversation-rest.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.
