Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
PythonMCSJ
Partner - Contributor III
Partner - Contributor III

Retrieving private sheets from Qlik Sense On-Prem tenant through Qlik Sense .NET SDK

Hi Qlik Community,

 

I am trying to retrieve private sheets of apps on a Qlik Sense On-Premise tenant, through the Qlik Engine SDK in C#. I am authenticating through a proxy and API-key header. The web socket base address used is equal to "wss://<tenant name>/<proxy name>". The user I used for this setup, has been given full admin rights in the QMC.

 

Now all of the above seems to work fine. I can retrieve the list of sheets etc. However, it seems as if I can only retrieve the sheets that are published / non-private, despite the fact that I can see the private sheets in the app, when I access Qlik through the GUI.

Here is my code:

 

 

// Setup location and connect to engine via api key
ILocation location = Qlik.Engine.Location.FromUri(newUri(webSocketBaseAddress));
location.AsJwtViaProxy(apiKey, certificateValidation:false); 

// Connect to app through ID
var appIdentifier = location.AppWithIdOrDefault(appId); 
ISession session = Session.WithApp(appIdentifier, SessionType.Default);
var app = await location.AppAsync(appIdentifier, session, noData: false);

// Get sheet list
var sheetList = await app.GetSheetsAsync();

// Iterate through sheet list, and print out sheet name
foreach (var sheetToBeAwaited in sheetList) 
{
  var sheet = sheetToBeAwaited.GetAwaiter().GetResult(); 
  Console.WriteLine(sheet.Layout.Meta.Title);
}

 

 

 

I have also tried retrieving the sheets through the app.GetSheetList() method, but same result - only non-private sheets are returned. Additionally, I also tried retrieving the sheets in Postman, by connecting to the websocket for the particular app, and then trying to simulate the same message list that is generated when you open the app in the GUI.

 

I hope someone can help!

Kind regards,

PythonMCSJ

 

Labels (3)
2 Replies
Marc
Employee
Employee

After having a quick look, the Private objects seem to show using GetSheetListAsync, or GetSheetsAsync after being published. If you subsequently unpublish the sheets they are also returned.

additionally if you restart the engine after creating the Private Sheets, they are returned when either of the above methods are called.

I suspect this may result from the way the Engine Session handle the objects and that they are not visible between session until they have been saved back and the session reloaded.

 

 

PythonMCSJ
Partner - Contributor III
Partner - Contributor III
Author

Hi Marc,

 

Unfortunately, this is not the case for me. What you are describing is exactly what happens for my own private sheets - but if another user creates a private sheet in the app, I can not retrieve them through either of the GetSheetListAsync or GetSheetsAsync methods.  I suspect that these functions only retrieve the same sheets that you can visibly see in the GUI - what I need, is to retrieve ALL sheets in the app, independent of the owner, type etc.

 

Kind regards,

PythonMCSJ