Can I search users based on a feature (here, API enabled)? | XM Community
Solved

Can I search users based on a feature (here, API enabled)?


Userlevel 1
Badge +8
Given that APIv3 is coming out in November, I want to send a message to all my users that are using the API.

However, I don't want to send a message to all 10,000 users. In my brand, users don't have the API enabled by default. Everyone is provisioned as a standard Qualtrics user, and when someone wants the API, we go in to their account and check "enabled" on the API line.

I want to search through all my users to find only those that have API enabled, so that I only email those people about the November change in API.

The user search has User Type, but everyone is a Standard User. Is there a more fine grain search? Is there an API that I can use, perhaps I can write a quick Python program, to search for users in my brand that have the API enabled?

Thanks!
icon

Best answer by djrits 30 May 2019, 19:50

View original

5 replies

Badge +3
Hi riceball, you can use the list users call to first get the IDs of all users in your brand, then run get user on each one to retrieve their permissions. The API permission looks like it's in result > permissions > controlPanel > accountPermissions > accessAPI in the JSON that's returned.
Userlevel 1
Badge +8
Thank you!
Badge +2
Hello, I'm trying to accomplish the same thing for the same reason, however, I'm not too familiar with the directions provided. Could you explain how to use the 'get users' call and then the 'get user' call? Thank you.
Userlevel 1
Badge +8
Are you using python? Qualtrics put up two docs with code examples.

This one is fantastic on implementation and Python code examples.
https://api.qualtrics.com/docs/managing-users#list-users

This one only has cURL, but shows the JSON that gets returned.
https://api.qualtrics.com/reference#get-user
Userlevel 1
Badge +8
Oh, and these were the hard parts for me to figure out. I don't know if it's the most efficient way, but it worked for me.

So when I called all the users, I added all users to a list, which I did with:

`users += response.json()['result']['elements']`

Then I looped through the list to make the call for the specific user,

`baseUrl = specific_users_api__url + user['id']

to make the URL for the specific User call,

and then for the response that was returned for that user:

`if response.json()['result']['permissions']['controlPanel']['accountPermissions']['accessApi']['calculatedState'] == "on":`

@blackroseenvy i hope this tags you and you saw the previous post with the links.

Leave a Reply