Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

Uploading APP trough Rest API

Hi,

We are trying to upload an app to the qlik server as part of a new import feature requested by one of our clients.

We're trying to use the REST API Upload App as documented here:

https://help.qlik.com/en-US/sense-developer/June2018/Subsystems/RepositoryServiceAPI/Content/Reposit...

After making a post request to the server,

the app (qvf file, converted to a filestream) should be uploaded to the server.


The post request used is:

await _qrsClient.Post("/qrs/app/upload?name=" + fileName + "&xrfkey=(key)", filestring);

where filestring is the streamread-file of the QVF

The Contentheader has been added to the request as following: _client.Headers.Add("Content-Type", "application/vnd.qlik.sense.app");

We might be doing something wrong with providing the body. But we couldn't find any examples so far.

What is the actual result?

Error: The remote server returned an error: (500) Internal Server Error.


Screenshots below show the request and method.

Test1.pngTest2.png

1 Solution

Accepted Solutions
Highlighted
Employee
Employee

I'm afraid I can't help you with that 500-error, but I have an example that shows how to upload apps using that endpoint. You can find it here:

https://github.com/kolsrud/qlik_rest_sdk/tree/master/Qlik.Sense.RestClient/Examples/AppUpload

Now that I think of it, it could it be that that 500 error comes from the fact that you are using UploadString instead of UploadData which means you are trying uploading a string instead of a byte stream. That's a guess though...

View solution in original post

2 Replies
Highlighted
Employee
Employee

I'm afraid I can't help you with that 500-error, but I have an example that shows how to upload apps using that endpoint. You can find it here:

https://github.com/kolsrud/qlik_rest_sdk/tree/master/Qlik.Sense.RestClient/Examples/AppUpload

Now that I think of it, it could it be that that 500 error comes from the fact that you are using UploadString instead of UploadData which means you are trying uploading a string instead of a byte stream. That's a guess though...

View solution in original post

Highlighted
Partner
Partner

Hi øystein,

Thank you kindly for your response.

The code you provided is very useful, I noticed that my Post method was different.

I was using a string task rather than a byte[] task.

I made a new Post method (PostApp) based off of your example and everything works fine now!

Sincerely,

Joshua