> For the complete documentation index, see [llms.txt](https://oswaldai.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://oswaldai.gitbook.io/docs/integration-api/accessing-message-history.md).

# Accessing message history

If your integration can't or doesn't want to store the message history of your user with the chatbot, fetching it from Oswald again is possible.

The `GET` endpoint for this functionality is:

```
/chats/{id}/session/{session}/latest/{date}?types={types}&access_token={access_token}
```

The parameters in this call are:

| Name          | Type                        | Possible values                                 | Description                                                                                                                                                                                                                                                                                |
| ------------- | --------------------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| id            | string                      | fixed value per bot                             | The chatbot ID used to uniquely identify the chatbot. This value can be found in the Oswald UI url (see section [Sending a message](/docs/integration-api/sending-a-message.md))                                                                                                           |
| session       | string                      | *any chosen unique identifier per conversation* | The session identifies a unique conversation and can be chosen by your implementation. Note that the same ID of the [Sending a message](/docs/integration-api/sending-a-message.md) implementation should be used.                                                                         |
| date          | string                      | any date string                                 | <p>The date string, formatted as DDMMYYYY, up until which the chat history must be fetched. </p><p>E.g. if we want all messages starting from the 31st of January 2019, the value of the datestring will be <em>31012019</em></p>                                                          |
| types         | comma separated list string | <p>in</p><p>out</p><p>takeover</p>              | <p>The types of messages we want to fetch from history. </p><ul><li>in = User messages</li><li>out = Chatbot messages</li><li>takeover = Customer Service Agent messages</li></ul><p>If you want to fetch all messages from history the types value should be <em>in,out,takeover</em></p> |
| access\_token | string                      | unique chat API access token                    | The token that is used to authenticate with the chat API to validate the call. See section [Authentication](/docs/integration-api/authentication.md) for more details.                                                                                                                     |

The response of this `GET` call will be an array of chat objects described in section [Sending a message](/docs/integration-api/sending-a-message.md#receiving-a-message).
