Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm working in a POC were i have a requirement to create a pixel-perfect report and call it on-demand based on user selections in an embedded sheet. The sheet will be available to authenticated users on a custom authenticator provider. The app has section access.
Reviewing the documentation , haven't found any information about compatibility with section access The only note is that is required to call the api using an authentication token and this token inherits the permission from the user it belongs. My assumption is correct ?
Also haven´t found much information or samples about using Reporting Service API to call a pixel-perfect template and generate a report.
So I'm looking for some answers about executing Reporting Service API on demand considering this scenario.
I'm also looking for some code snipets to call the API, check status of report generation and download the generated file, but didn´t found anything. Were can I found some examples ?
Thanks for helping !
We have a backlog item to document this. It'll be an extension (or maybe, sibling?) of https://qlik.dev/embed/reports/qlik-api-export-data/
As for payload, the request you need looks like (update section 2.1.2):
curl -L "https://tenant.eu.qlikcloud.com/api/v1/reports" ^
-H "Authorization: Bearer <token>" ^
-H "Content-type: application/json" ^
-H "Accept: application/json" ^
-d "{
\"type\": \"sense-pixel-perfect-template-1.0\",
\"sensePixelPerfectTemplate\": {
\"templateLocation\": {
\"format\": \"url\",
\"path\": \"/api/v1/report-templates/5b49a430-c782-4ec5-bbc2-6522d5a8263a\"
},
\"selectionChain\": [
{
\"selectionType\": \"temporaryBookmarkV2\",
\"temporaryBookmarkV2\": {
\"id\": \"Temporary\\49fa134e-a7bd-45d6-874c-a6fad16b47f7\"
}
}
]
},
\"meta\": {
\"exportDeadline\": \"P0Y0M0DT1H0M0S\",
\"tags\": [\"sense-ondemand.download\"]
},
\"output\": { \"outputId\": \"pdf_file\", \"type\": \"pdf\", \"pdfOutput\": {} }
}
"
So...a hybrid of the two. You can use https://qlik.dev/apis/rest/report-templates/ to list the templates available for the app by filtering on sourceAppId
Hi Pablo, maybe easy thinking, but why not Execute a Qlik Automation (by API) which will be doing the hard work for you?
Hi Jochem, Qlik Automation only have blocks to create report based on in-app sheets and I need to run a Pixel Perfect Report.
I found some samples to run a report using directly Reporting Services API , but nothing for pixel perfect template. https://qlik.dev/embed/reports/reporting-api-samples/
thanks for updating with your original post with 'Pixel Perfect' reports, this changes things of course. I will try to contact a Product Manager, to see if the Pixel Perfect API's are already GA.
Hi Pablo,
The API to trigger report generation (which is used by the on-demand function within Qlik Cloud) https://qlik.dev/apis/rest/reports/#post-v1-reports should cover that, and https://qlik.dev/apis/rest/report-templates/ is for managing existing reports. Creating reports is something you have to do manually on the the tenant, there are no APIs for this.
Think this is all you need. Sorry I don't have sample code.
Hi Jochem, the pixel perfect report will be created previously. No need to be created programmatically.
My request now will be a sample to create a request with the sense-pixel-perfect-template-1.0 type
I know, with generating I mean the report will be executed, just like a on demand from a App. So report needs to be manually generated and can be triggered (executed) with the API:
https://qlik.dev/apis/rest/reports/#post-v1-reports
Like i said, sorry I don't have sample code for you...
We have a backlog item to document this. It'll be an extension (or maybe, sibling?) of https://qlik.dev/embed/reports/qlik-api-export-data/
As for payload, the request you need looks like (update section 2.1.2):
curl -L "https://tenant.eu.qlikcloud.com/api/v1/reports" ^
-H "Authorization: Bearer <token>" ^
-H "Content-type: application/json" ^
-H "Accept: application/json" ^
-d "{
\"type\": \"sense-pixel-perfect-template-1.0\",
\"sensePixelPerfectTemplate\": {
\"templateLocation\": {
\"format\": \"url\",
\"path\": \"/api/v1/report-templates/5b49a430-c782-4ec5-bbc2-6522d5a8263a\"
},
\"selectionChain\": [
{
\"selectionType\": \"temporaryBookmarkV2\",
\"temporaryBookmarkV2\": {
\"id\": \"Temporary\\49fa134e-a7bd-45d6-874c-a6fad16b47f7\"
}
}
]
},
\"meta\": {
\"exportDeadline\": \"P0Y0M0DT1H0M0S\",
\"tags\": [\"sense-ondemand.download\"]
},
\"output\": { \"outputId\": \"pdf_file\", \"type\": \"pdf\", \"pdfOutput\": {} }
}
"
So...a hybrid of the two. You can use https://qlik.dev/apis/rest/report-templates/ to list the templates available for the app by filtering on sourceAppId
Thanks @DaveChannon for this guide. I'll have a try.
After some testing and adjusts its working now ! Thanks @DaveChannon and @jochem_zw !
Now I'm just figuring out how to create the temporary bookmark for selections.