Web messaging: How to get an old chat history / conversation?

Good morning,

So I'm now able to send and receive chat/messaging messages with the API (I can send messages to my app with the "Messenger" widget, and there are notifications for both messages and typing events in my app, and I can send responses with the POST function mentioned in my last forum question. But I'm having some trouble getting information on existing, still open, chat conversations. And considering these chats can last for up to 3 days, it's entirely possible that a user will find themselves in the same situation I'm in right now: you sign on Monday and have an old chat from Friday that needs wrapping up.

Anyway, here is what I do know:

  • I can use conversations.getConversationsMessageDetails(messageID); to get the data I'm looking for; it's in a convoluted tree that I have to manually straighten out myself, but it's there.
  • You need a participantID to get the messageID. So for new/incoming chats this is not a problem.
  • However, for old chats, when I run something like onversations.getConversationsChats(myUserId) the list of participants is an empty array. This lack of participants prevents me from calling getConversationsMessageDetails to pull previous conversation info.

So after fishing on the docs for awhile :laughing: and a few good rounds of hack'n'guessing, it's speculation time:

  1. I'm guessing that there might be some parameter like {expand: "participants"} that I need to call to get the participant list.
  2. A few forum posts suggested the Recordings API of all things... idk what that has to do with web messaging, but maybe it's one of the other chattish APIs (I know there are 3-4 of them and all have been called "chat"). But there's always the possibility that chat history can be retried through some obscure getRecordingChatHistory or similar (still fishing for that one).
  3. Since, apparently, these APIs are so new, it's possible that a simple API for getting a complete chat history in chronological order just hasn't been built yet. And I get that - I'm backlogged too. :laughing:
  4. Or maybe I'm just way out in left field and there is a nice API obfuscated away someplace (maybe in analytics?) that a Query-Fu Grand Master could do in his or her sleep. :laughing:

But yeah, I'm kinda out of ideas. Any thoughts?

Hi @LighthouseMike
I would suggest using the /api/v2/conversations/messages/* endpoints fully now. Don't mix these with chat endpoints.
"/messages" == web messaging and digital messaging
"/chat" == legacy chat
So as i understand your question here is "How do i get a conversation message history, for web messaging?"
One way to accomplish that is to do the following.

  • GET /api/v2/conversations/messages/{conversationId} This response you will see which participants had messages[], and you will get a "messageURI" field if they did have messages
  • Use the above "messageURI" to GET each message array.

Another way, is using recording (after the conversation is disconnected the transcript will be available) you could do similar using GET /api/v2/conversations/{conversationId}/recordings

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.