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.
The example is written for Qlik Sense Enterprise 3.1.3. For more details on end points, please refer to your current Qlik Sense version's Developer Help site
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 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:
is the reference to our DIV in the HTML page that is meant to display the response.
The JASON response passed on to the HTML page:
In case something missing then kindly refer to the full source code (Ajax2QRSAPI.zip) attached to this article.