How can we export contact stats through an API call? | XM Community
Question

How can we export contact stats through an API call?


Badge +1

Hello Everyone, How can we export contact stats of all the employees through an API call?  Looks like the 'List Directory Contacts' api doesn't provide stats like contact frequency, response rate, etc


5 replies

Userlevel 5
Badge +25

Hi Loka,
Get Directory Contact returns a "stats" field for a given contact. I would suggest writing a script to list all of the directory contacts and then loop through each one with the above API call, storing the "stats" field for each somewhere.
UPDATE 6/6/22: Search Directory Contacts is a much more suitable function, see below answer for details.
Good luck!

Badge +1

Hello bgooldfed,
Thanks for the response. Here, the only challenge is, incase of thousand users, thousand api calls will happen right? Just checking if there could be a way to bulk export the Directory contacts with stats on a single API call?

Userlevel 5
Badge +25

Hi Loka,
I took another look at the API this morning and noticed that Search Directory Contacts returns an array of contacts and includes the stats field for each. I did a quick test on a small directory and got the result you're after.
A couple of things to note:

  • The filter parameter is a required so you'll want to include a condition that returns every contact, such as any person without a blank first name:

# CURL example, for clarity
--data '{
"filter": {"filterType": "firstName","comparison": "neq","value": ""}
}'
  • A maximum of 100 items (pageSize) will be returned per request. If your list is larger than this, you'll need to loop over and use skipToken to start at the next set of contacts in the directory until you hit the end.

Alternatively, if you export a directory manually from within Qualtrics you can select to include the contact stats. If manual exporting suits your problem, that is probably a simpler and better solution.
Best of luck!

Badge +1

Is the skipToken valid only for limited period of time?

Userlevel 4
Badge +6

https://community.qualtrics.com/XMcommunity/discussion/comment/54523#Comment_54523The answer I received from tech support on this:
"The skip tokens are not time sensitive and do not have an expiration. The skip token will start in the same place as it previously did unless there were contacts added, which might change some of the order at the end (this was tested on a relatively small list size of 100). "
Unfortunately for us, the caveat about unless contacts were added is a big issue, but may not be for your use case.

Chris

Leave a Reply