Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to export an app using the ExportApp Qlik engine API. Below are the details:
1. I am trying to simulate the export by firing the ExportApp method from engine-api-explorer
2. The JSON request that I am sending is as follows:
{
"handle": -1,
"method": "ExportApp",
"params": {
"qTargetPath": "fc657f9a-40d5-47b6-b342-defbe1806d0e",
"qSrcAppId": "c55d9b6c-5eb4-441b-a8ec-b1fdc552dc49",
"qIds": [
""
]
},
"id": 5,
"jsonrpc": "2.0"
}
Here I have mentioned the App ids of 2 Apps which are already present in the Hub. As I want all the objects to get exported, I have kept the qIds blank.
3. The response that I get is as follows:
{
"jsonrpc": "2.0",
"id": 5,
"error": {
"code": 403,
"parameter": "REST HTTP error",
"message": "Forbidden"
},
"isHandled": true
}
Here I am getting an REST HTTP error. Any idea what could be causing this issue?
I checked the log file and the log file has the following log entry:
48 | 2.2.3.0 | 20160913T064157.533-0600 | ERROR | wcoslbi1 | 80e5f856-793d-46e7-8e28-1538562f09bc | 20160913T064157.533-0600 | 2.2.3.0 | Command=Export app;Result=403;ResultText=Error: Forbidden | 9acd8789-51ce-4ee4-85fe-ec4447e0f74c | 0c0c1b83-f160-4732-a82a-262563eb3b43 | 11 | 9890ac62-9c7c-421f-80a5-18513d935f46 | Not available | Engine | Global::ExportApp | Export app | 403 | REST HTTP error | 80e5f856-793d-46e7-8e28-1538562f09bc |
Well, actually with the Engine API you can specify a path on the file system but with the QRS API the app gets exported into a temporary directory and are streamed back with the second export app call.
There is also some security attached to it so that the export app can only be downloaded with the corresponding export ticket and if the app goes "un-downloaded" for a period of time it's deleted from the file system.
Btw, in Postman try to use the "Send and Download" option instead of just "Send" for the second request and you should get the file back.
Most likely you are trying to export an app as a user that does not have Export privileges on the request app.
In QMC you can audit the access rights you have to apps where Export is one security property that is managed.
I will also add that the QRS API is somewhat easier to work with if you are just looking to export an app as it will automatically exported with the correct objects and then made available as a resource that you can request over the web.
Thanks for the direction Alexander. I did try using the QRS API to Export an APP using Postman. The GET request for Export app (call 2 of 2) returns with a Status 200 OK, which i believe is a successful GET request. However, I am unable to locate where does the exported app gets saved on my file system? Is there an option to specify the file system path?@@@ !@@@@@@
Here are the additional details:
URL posted in Postman: https://<servername>/qrs/download/app/c55d9b6c-5eb4-441b-a8ec-b1fdc552dc49/1e624b6f-0eed-46c1-8a3d-c...
Parameters: Xrfkey : somerandomstring
Header: X-Qlik-Xrfkey: somerandomstring
I have attached a screenshot from Postman for your reference. Thanks in advance
Well, actually with the Engine API you can specify a path on the file system but with the QRS API the app gets exported into a temporary directory and are streamed back with the second export app call.
There is also some security attached to it so that the export app can only be downloaded with the corresponding export ticket and if the app goes "un-downloaded" for a period of time it's deleted from the file system.
Btw, in Postman try to use the "Send and Download" option instead of just "Send" for the second request and you should get the file back.
Thanks for the above information. I was finally able to get my hands on the exported app by using the "Send and Download" option in Postman. The file that Postman allows me to save has a name "response". In the ExportApp API call, we do specify the name of the exported app - but that isn't used anywhere - so that is a bit confusing.
Regarding the Qlik Engine ExportApp I continue to see the same Forbidden error as mentioned in my initial post. I tried to manually export the app from QMC and I was able to do so. I am also added as "rootadmin" in QMC- so cannot figure out why it is giving an error. Any other pointers here will be really helpful.