Conversation History

A Conversation History adapter can be added via its dedicated adapter type.

1148

The Conversation History new adapter line.

The adapter supports retrieving the conversation history for a single session. This can be done by filling out the template URL as given below. The session id is passed via the handover call.

GET to https://api.conversational.cm.com/conversational/conversation-history/v2/accounts/{accountId}/session-history?routerSessionId={sessionId}

This api also supports retrieving session events, you can include events with messages by adding includeEvents query parameter:
GET to https://api.conversational.cm.com/conversational/conversation-history/v2/accounts/{accountId}/session-history?routerSessionId={sessionId}&includeEvents=true

You can also only fetch events without messages by adding includeMessages query parameter:
GET to https://api.conversational.cm.com/conversational/conversation-history/v2/accounts/{accountId}/session-history?routerSessionId={sessionId}&includeEvents=true&includeMessages=false

Response

FieldTypeDescription
AccountIdGuidThe CONVERSATIONAL technical link
SessionIdGuidSession id
ChatIdGuidA hash created from the combination of client id, host id and channel
ConversationHistoryarray of ConversationMessagesAn array of messages/events for that session
Metadata[ConversationHistoryMetadata] (doc:ConversationHistoryMetadata)Meta data about session history

Metadata

FieldTypeDescription
SummarystringA summarisation of the text messages in the history generated by open ai, only available if includeSummary query parameter is set to true

Above URL template with the accountId pre-filled can also be retrieved from the frontend.

2116

Button which puts the URL template, including the accountId, on the clipboard.

It is also possible to delete the session history, would that be beneficial to your use case.

DELETE to https://api.conversational.cm.com/conversational/conversation-history/v1/accounts/{accountId}/session-history/{sessionId}

Both calls need to be authenticated with a product token via the X-Cm-Producttoken header, described more elaborately in Authentication.


What’s Next