Define dashboard data access via API | XM Community
Question

Define dashboard data access via API

  • 8 November 2021
  • 11 replies
  • 157 views

Is it possible to define the dashboard data access of a user when it was created via Qualtrics API? The scenario is, the CRM tool will trigger an API request to Qualtrics to create a new user. In the JSON payload, it is defined by a specific field what data access this user should have when viewing the dashboard and this should happen automatically.
Currently, defining user data access is a manual process. Considering we are handling lots of users, it would be very beneficial to have this kind of functionality.


11 replies

Badge +30

Hi Kennedy_Isip You can make use of the Adding users to Contact directory task to add users in a bulk. You can use SFTP process to upload files on a regular basis. Within this file, you can add the metadata that you can use to restrict user roles accordingly.

Hi Aanurag_QC, thanks for the idea but the overall goal is to eliminate the manual process that is why we are planning to use API to automatically create users and define their metadata information in real-time. Also, the client doesn't have readily available SFTP to use.

Badge +30

In that case they would need to write a script to make use of create user API on real-time basis

Userlevel 4
Badge +18

Kennedy_Isip This is an old post, I was looking for something else and landed here. You may have already figured this out but wanted to share my approach as this may help someone else looking for similar approach. While creating user's through API you can assign few attributes based on their demographic. These attributes further can be used to assign them an role automatically in Qualtrics. A dashboard should be shared with that role and restrictions can be also placed while sharing. It mean initially, you will have to create role and share dashboard with that role and then based on the user attribute assigned by API, each user will be seeing desired pages and restricted data only.

Userlevel 2
Badge +8

KimothiSaurabh how did you assign attributes based on demographics using the Create User API call? In the documentation, it only lists username, firstName, lastName, userType, email, password, language, timeZone, divisionId and accountExpirationDate.

Userlevel 4
Badge +18

Matt You can use another end point to update any attribute.
Here is the end point: - https://fra1.qualtrics.com/API/v3/employee-directories/cx/import-participants
Here, is the detailed documentation. And yes, this is confusing as this end point is basically dedicated to employee directory, but it works perfectly for updating user attribute by just using "cx" in end point as shown above.

Overall, you will have to use two API call- first to create user and second one to update attributes. Please note that unique identifier must be same in both API requests.

Userlevel 2
Badge +8

KimothiSaurabh just tested this out, it works! Thank-you very much for sharing this info. This is a huge time saver. Qualtrics should really update their API documentation around this, it's not an intuitive solution based on their current documentation.

Userlevel 2
Badge +8

KimothiSaurabh I am struggling with your last sentence "Please note that unique identifier must be same in both API requests."

The Create User API doesn't allow me to set a unique identifier for a new user, it just assigns a random one and I can't figure out a way to retrieve the unique identifier for a user. Any suggestions?

Userlevel 4
Badge +18

Matt sorry, I mean username should be same in both APIs. You can set Unique identifier in second API call.
This is the first API call:-
image.pngthe second call would be:-
image.png

Userlevel 2
Badge +8

KimothiSaurabh thanks for the quick and detailed reply. It seems that for the second API call, you need to state what the existing uniqueIdentifier is rather than set it to a new value. The only way I can get the second call to work is if I manually look up the uniqueIdentifier field in the dashboard user admin area of the platform after I create the new user with the first call. For example, I used the first call to create a this new user:

image.pngAnd below is the uniqueIdentifier automatically generated by Qualtrics:

image.png
The only way for me to update this user is if I include the above uniqueIdentifier in the second call. If I try the second call with any other value, this is the error I get:
image.pngIdeally I wouldn't have to manually lookup the uniqueIdentifier that is randomly generated during the first API call so that I could automate this whole process. As far as I know, there's no way for me to use an API to lookup the uniqueIdentifier of a user. Let me know if I'm missing anything... and thanks again for all your help!

Userlevel 5
Badge +11

Just read through this thread... I was in fact looking for a way to retrieve information about what roles users belonged to, so that our Hotel GM's could see what groups their team were in and request changes without me granting them admin access... . So it's a GET api script I'm after - ideally using API from inside excel /powerquery so that the data can be tidied up easily and put in an excel file to be shared - perhaps someone can advise on that how I use the various APIs to do that - I'm a beginner on API and powerquery so any example scripts / M code would be grateful! FYI, i have managed to create a VBA script in excel that does an API call to make changes to tickets so any future API calls processes, I'm hoping will be a natural step and progression.

Anyway back to this thread..,
Have you tried a Non API solution where you create a csv file (by some means) that then uploads through a scheduled workflow? That might get round any unique identifier issue: https://www.qualtrics.com/support/survey-platform/actions-page/etl-workflows/data-loader-tasks/load-users-into-cx-directory-task/.
It's a two step process - Import the data via an ETL workflow and then use the 'load users into cx directory' task. I've not given it a go I'm afraid as I'm happy to keep some manual gateways in the process, namely my excel master file of users.
My method is I create a CSV file of new users from my master excel file and import using the import users function when you are in the user admin part of a dashboard. I have a couple of custom fields ('Role' and 'Responsibility') that I import. In combination with the 'Automatic Role Enrollment' function I use these fields to add users to whichever groups (roles) they need to go in and therefore have the right access to the right dashboards.
image.pngAlso, you can put multiple keys into the fields aswell by separating them with two colons :: This works really well for us as people may have multiple responsibilities.

From my perspective the creation of the csv process is the manual part but from that point on it's all automatic. I would like to convert this to an API call so that you can click a button within the excel file and it does it for you but it sounds like there are some hurdles with unique identifier, is that the case? In a csv file I can specify a unique identifier.
Does that help (or hinder!)
Thanks
Rod Pestell

Leave a Reply