Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
You'll need to perform another API call to have the engine execute the script as well. Perhaps that is what is missing on your side? This is what I did using the QlikSenseRestClient library https://www.nuget.org/packages/QlikSenseRestClient/
var url = "<url>>";
var apiKey = "<apiKey>";
var client = new RestClientQcs(url);
client.AsApiKey(apiKey);
var body = JObject.FromObject(new { attributes = new { name = "MyApp" } });
var rsp = client.Post<JObject>("/api/v1/apps", body);
Console.WriteLine(rsp.ToString());
var appId = rsp["attributes"]["id"].Value<string>();
var script = "Load Chr(RecNo()+Ord('A')-1) as Alpha, RecNo() as Num autogenerate 26;";
body = JObject.FromObject(new { script = script, versionMessage = "This is my version" });
client.Post($"/api/v1/apps/{appId}/scripts", body);
And then this call to run the script and load the data into the app:
body = JObject.FromObject(new { appId = appId });
Console.WriteLine(client.Post("/api/v1/reloads", body));
Hi ,
We are running all the there API calls through Postman using client ID and secret , and yet we couldn't get any positive response on that.
You mean you get an access token from an OAuth client? Maybe there's something missing when it comes to the scope configuration of the client? I suggest you try authenticate with an API key instead and see if you get it to work using that flow. That way you will at least know if there's anything wrong with the way you call the endpoints.
You can read more about scopes and OAuth here: https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Admin/mc-create-oauth-cl...
Yes ! As mentioned it is working with the API Keys , but not with the client ID and secret and the OAuth credentials are having all the scopes required for the app creation and loading the script. Eventhough, the app created with the OAuth client is getting create as empty with no Data loader and Data editor
(Scopes: apps apps:export apps:read apps.data:export apps.image:export users users:read admin.apps admin.apps:export admin.apps:read admin.automations admin.automations:read admin.spaces admin.spaces:read admin.users admin.users:read identity.name:read identity.email:read identity.subject:read identity.picture:read user_default admin_classic automations automations:read automl-deployments automl-experiments spaces.data spaces.data:read spaces.managed spaces.managed:read spaces.shared spaces.shared:read dataset lineage:create)
Are you using impersonation? Otherwise the app will be created as a bot user when authenticating like that. Maybe you user simply can't see the contents of it? You can change the owner of an app in the administrator section of QCS, so have a look there.
The user account through which the OAuth client is created is a Tenant Admin, and using the same we are running the API calls .So, the user I having all the privilege.
OK, but I don't think tenant admins can see the content of users private apps. And the user set as the owner of that created app will be a bot-user, not the user who created the OAuth client. You can verify this by looking at the response to your call to POST "/api/v1/apps". You'll see in the attributes section of the response lines like this:
...
"owner": "qlikbot\\<id0>",
"ownerId": "<id1>",
...
If you change the owner of the app then you should be able to see the data. Or if you publish the app to a stream. That should do the trick as well.