How to retrieve a list of conversations for a contact via the API

Hi,

I'm trying to pull a list of conversations for each contact, similar to what's present in the Activity Timeline in-app. From what a I can tell from the API documentation, it looks like I should be able to look at the Events property inside the Contact object, but this is returning an empty object currently for a contact that has conversations. Has anyone done this before through the API?

Comments

  • Hi @Alex Cox ๐Ÿ‘‹


    Currently, the only way to retrieve conversations that are associated with a contact is to use the contactIDย in the conversation details found here.


    This would only bring in information about a specific conversation ID. However, if you are wanting to find all conversations associated with contactID, you would need to retrieve the contact data first, and then you would have to do some custom work on the backend to retrieve the entire list of conversations associated with that contactID. You can use the following API'S to accomplish this:

    https://devdocs.drift.com/docs/retrieve-a-conversation

    https://devdocs.drift.com/docs/listing-conversations


    Let us know if you have more questions on this, we would be happy to help ๐Ÿ˜

  • Thanks for your response. The issue I'm facing is with the https://devdocs.drift.com/docs/listing-conversations endpoint - there doesn't seem to be a way to filter by contactId in the request. It's really inefficient and costly for us to list out all conversations and then filter by contactId so I was hoping there was a way to filter directly on the endpoint.

    For the contact model, could you explain to me what the Events property is supposed to contain (https://devdocs.drift.com/docs/contact-model)? I always see an empty object. According to the docs this is supposed to return a map of Drift events associates with the contact. What kinds of events is this referring to if not the activity timeline events that I can see in the app UI?

Sign In or Register to comment.