Performance issues with the external contacts API

Hi,

I need to retrieve external contact data for all conversations which occurred in a given day, on a daily basis.

The way I'm going about it now is to first issue a call to the conversations details API with the correct interval, and then issue one call to the external contacts API per external contact ID in the initial response. This solution is not satisfactory performance-wise because of the volume of external contact IDs I need to process every day. I did some measuring on my side and found that it takes around 4.5 minutes to issue 1000 queries using the Python SDK (which itself calls /api/v2/externalcontacts/contacts/{contactId}). This is around 0.25s per call - too much when I need to process dozens of thousands of IDs per day.

I tried to find a way to retrieve external contact data in bulk by passing more than one ID at a time, but this doesn't seem to be possible.

Is there another way to do this?

Thanks,
Oliver

You could use GET /api/v2/externalcontacts/contacts and page through the results to cache a list of external contacts in your app so you don't have to request them one by one. There's not an alternate bulk lookup for external contacts. You can request new features at https://purecloud.ideas.aha.io/ideas.

I found a way to push the requests down to our executors and have them processed in parallel which cuts down the run time nicely.

However I also found what seems to me like a bug in the API: a large number of customers (approx 30% of 17k customers for the day I use for testing) have "createDate": "0000-12-30T00:00:00Z" which causes ApiClient.__deserialize_datatime in api_client.py (line 546) to throw a ValueError because that date string cannot be converted to a datetime object. This basically makes this API call useless as it stands because 70% of the data is not coming through. Can you confirm that this is a bug? I can provide sample IDs if needed, not sure if it's safe to post them here.

That doesn't sound right since PureCloud wasn't around 2000 years ago. :wink: Please open a case with PureCloud Care to investigate; customer-specific data cannot be investigated publicly via the forum.

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