Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
marcelinoa
Partner - Contributor III
Partner - Contributor III

How to get list of subscriptions and users assigned to it

Hi, I want to get the list of subscriptions and consequently, the users that receive said subscriptions.

Using the Qlik Dev APIs I can get the list of alerts using "/v1/data-alerts", but can't find an API Path which I can call to return me the list of subscriptions that currently exist.

Any help on how I can achieve this?

Labels (3)
1 Solution

Accepted Solutions
JonnyPoole
Former Employee
Former Employee

In the API world, subscriptions share an API with monitored charts and tabular report tasks. 

https://qlik.dev/apis/rest/sharing-tasks/

To get subscriptions you can use these two endpoints for chart and sheet subscriptions respectively:

/api/v1/sharing-tasks?type=chart-sharing

/api/v1/sharing-tasks?type=sheet-sharing

 

View solution in original post

7 Replies
JonnyPoole
Former Employee
Former Employee

In the API world, subscriptions share an API with monitored charts and tabular report tasks. 

https://qlik.dev/apis/rest/sharing-tasks/

To get subscriptions you can use these two endpoints for chart and sheet subscriptions respectively:

/api/v1/sharing-tasks?type=chart-sharing

/api/v1/sharing-tasks?type=sheet-sharing

 

marcelinoa
Partner - Contributor III
Partner - Contributor III
Author

Thank you very much! That returns what I wanted, but I'm having a small set back.

Calling the individual sharing-task with "/v1/sharing-tasks/{taskId}" seemingly returns all the information about said task, but the recipients comes empty when I know the one I checked has at least 3 users as recipients.

I can see the recipients in the QMC, so any idea what might cause the information to not show?

JonnyPoole
Former Employee
Former Employee

I don't see that. When I check the JSON returned by doing a GET on a single sharing-task I see a 'value' property for the recipient which is the same as the 'userId' 

JonnyPoole_1-1709904403800.png

 

 

marcelinoa
Partner - Contributor III
Partner - Contributor III
Author

Thank you for your help so far. I foud out my problem.
I'm not getting any user because the API key I'm using was made with my user, and I'm not the owner of the subscriptions. This doesn't happen with the data-alerts where I can see the users of the alert irregardly if I'm the owner or not.


Any last tip on how can I possibly circunvent this? Or it's not possible?
Just has a reference, my user has all possible permissions and has access to all the spaces that exist in the machine.

JonnyPoole
Former Employee
Former Employee

I'll make some inquiries. I've had this question before and short of creating an API key for each user and cycling your API call through each key, there may not be an easy answer at the moment.

Andrew_Kruger
Employee
Employee

thanks @marcelinoa  and @JonnyPoole for the discussion, I have reviewed internally and logged an issue accordingly.  I can't offer a timeline for resolution however the intent will be to bring the subscription call to return the recipient list.  

marcelinoa
Partner - Contributor III
Partner - Contributor III
Author

Thank you for your help @Andrew_Kruger and @JonnyPoole . Going to mark the first reply has the answer since that is the most relevant to the question.
Until further change I'll just make it so every subscription is created by one user and the API key is generated by the same user.