How to make an Ajax / jQuery call towards the Qlik Sense Repository Service API
The article illustrates how the syntax may look like in jQuery (using an Ajax call) when developers query the Qlik Sense Repository Service API (QRS API) to ping for example the “full” end point – more details on end points can be found here https://help.qlik.com/en-US/sense-developer/3.1/Content/Home-developer.htm. Once the call is made, the expected result will be a JASON response holding details about the applications hosted on the Qlik Sense Server, information like applications ID, owner, creation date schema path etc. Then the response is intercepted and displayed within a web page.
This example has been tested on Qlik Sense Enterprise 3.1.3.
The QRS call has been tested first in Postman to make sure we get a proper response from the API. It is a good habit to test such API calls in order to make sure we are using the right URL and parameters needed for the call.
In QMC under the Proxies section, you must allow HTTP, for this example to work.
There is a need for creating a new virtual proxy in Qlik Sense Management Console (QMC). See images below for inspiration, it is the header authentication method that has been picked for this test for our testing, see images below:
The first step as mentioned above was testing the call in Postman to see if the API call itself is valid or not and if we get any response from QRS API. The URL and values used in Postman as well as the JASON response we got looks like this:
With regard to the actual syntax of the Ajax call, it looks like this, note the path in the URL, qlikserver1.domain.local/mash, where mash is the prefix of the virtual proxy we created earlier: