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:
1
/chats/{id}/session/{session}/latest/{date}?types={types}&access_token={access_token}
Copied!
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)
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 implementation should be used.
date
string
any date string
The date string, formatted as DDMMYYYY, up until which the chat history must be fetched.
E.g. if we want all messages starting from the 31st of January 2019, the value of the datestring will be 31012019
types
comma separated list string
in
out
takeover
The types of messages we want to fetch from history.
  • in = User messages
  • out = Chatbot messages
  • takeover = Customer Service Agent messages
If you want to fetch all messages from history the types value should be in,out,takeover
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 for more details.
The response of this GET call will be an array of chat objects described in section Sending a message.
Copy link