
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to use Postman to make API calls and use/verify JSON output
The following article describes how to use Postman to make GET and PUT requests and verify the JSON output
Prerequisites:
- In this example Postman resides out of the Qlik Sense servers so the certificates need to be exported to make the API calls. Export the Certificates selecting "Platform independent PEM-format", the following article can be used as reference just make sure to select "Platform independent PEM-format" instead. Export client certificate and root certificate to make API calls
- For best practices the user utilized for this sample is not the Service Account.
- It is necessary to create a new Tag in the QMC so we can later use it to add it to an existing object.
- Download Postman
- This exercise was implemented using Qlik Sense April 2020 (13.72.3)
Environment:
Qlik Sense Enterprise on Windows
! The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.
Resolution:
Steps:
-
Copy the Certificates to the server/computer where Postman is used.
-
Open Postman and go to menu "Settings" , In the General tab set "SSL certificate verification" to Off, In the Certificates Tab select "add Certificate" and set the path to the exported certs. The CRT file path will correspond to the path where the client.pem certificate resides, the Key file to the cleint_key.pem
Now Postman is ready to be used, this article describes how to make a GET and PUT request to add a tag to a sheet.
It is suggested to visit our Help site to verify the documentation about the API, in this case we will use
get /app/object/{id}
put /app/object/{id}
The URL would be
https://qlikserver1.domain.local:4242/qrs/app/object/aa73b22a-c933-4c26-aa2b-1e0947d708ab?xrfkey=123...
[Server] + [API end point] + [xrfkey]
The necessary headers would be :
X-Qlik-xrfkey = 12345678qwertyui
(this value needs to be the same provided in the URL xrfkey), for questions about xrfkey headers please refer to the following information: Using Xrfkey headers
X-Qlik-User = UserDirectory=DOMAIN;UserId=Administrator (this value would be the user to make the API calls)
Note that Postman will include xrfkey in the parameters section once the URL is pasted in the GET response.
Please refer to the following pictures to verify the configurations are correct.
GET
Postman Headers
Once is configured you can click the "Send" button, the Response will look like this:
PUT
In order to send the PUT method it is necessary to copy the JSON Response from the previous GET call and modify the necessary information, this need to be done carefully otherwise the request will return an error. The details can be found In our Qlik Site under "Updating an entry" section included here.
Sample (It will be necessary to include a comma if there are already tags associated to the object)
{
"id": "376e0283-3e5b-4968-bc55-2a19c4ba3b17",
"name": "Tag3",
"privileges": null
}
Please refer to the following pictures to verify the configurations are correct
PUT Header
PUT Body
Once the information is correct select "Send" button, you should get 200 OK Status.
We can verify the chances in the QMC, now the tag shows 1 Occurrence and the sheet shows the new tag.