Get call history given external contact id

Hi!

We are working on integrating purecloud into our CRM. The task we are currently stuck on is to get a call history for an externalContactId via AnalyticsApi using segment filter. The following method returns empty json. Will appreciate if you could give us a hand with what is wrong...

Hi Valeriia,

The function looks reasonably correct. Have you tried the same interval and filter with the Query Builder tool to confirm the query finds results?

https://developer.mypurecloud.com/developer-tools/#/analytics-query-builder

Hi, thank you for response.

Yes, I've tried. It results in the following error (same as via Postman):

I believe you should be using a segment filter.

Yes, my fault! But still, the query is empty..

Here is the request for external contacts. The externalContactId is equal to id = '43c29b8f-daf6-4e02-a23d-f7dc18f75ec1' as far as I understand.

Have you confirmed that a conversation exists where that external contact participated in that interval? You can try to find a conversation on a short interval, using no filter, that has the externalContactId field on a participant. Once found, you should be able to filter on the ID and find the same result.

Okey, now it becomes clearer :slight_smile: There is no field "externalContactId" on participants, even though I rang directly from PureCloud on the external contact number. How is it possible to obtain the field?.. I get "participantId" no matter how I make a call on the number in the external contact list.

Hi, I believe external contacts only get attached when a call comes from a number outside the organization. The PureCloud Community Forum is the best place to confirm this.

We figured out that the problem occurred due to our SBC/Sip settings. Outbound calls did not work correctly, and that is why none of our external contacts appeared in the conversation history. As a result, we got an empty response.

Thank you for your cooperation! :slight_smile:

1 Like

Excellent, glad you got it sorted :slight_smile:

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