Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

Highlighted
Not applicable

Problem with replace REST function

Hello,

I have been able to develope an application that using the rest funcions from the server can upload qvf to the server, publish them and in the case that exist published, replace the published file for the new one.

The problem is that to do that I upload a qvf with a temp name, replace the published aplication and them delete the temp file. After doing that the published aplication loses the preview image.

I supose that it happens because it keep the reference images instead of creating new ones using the new references, but doing the same operations with the server (upload manually a new qvf, publish replacing the old published qvf, and then deleting the uploaded qvf) it preserves the preview image of the qvf on the hub page.

Is there any step I forgot to do or I did on the wrong way something?

Thanks

PD For new published files it also preserve the preview image, but I need to do the replace functions because If the user created new sheets and the qvf needs to be updated I want to avoid the lose of user data that would happen If I simply destroy the old published qvf and publish a new one.

1 Solution

Accepted Solutions
Not applicable

Re: Problem with replace REST function

For the people interested we have found that there's a bug on the replace function of Qlik Sense.

At first moment we thought that we have a problem when we uploaded a qvf, used the replace function to replace the file of an existing published app and then we delete the original uploaded file losing the thumbnail of the published one.

But we performed the same operations on Qlik Sense Server and it happens the same:

- We clicked the import button uploading the file.

- Then we published the file with the publish button specifying to replace an existing published file with the checkbox Replace existing file.

- After that we deleted the original uploaded file and then we lost the thumbnail of the published file.

So we are thinking that when one publish a file with the replace function, the thumbnail image keeps linked with the original uploaded file instead of having its own so if that file is removed the published one loses that image.

6 Replies
humansoft
New Contributor II

Re: Problem with replace REST function

Hi oriol_tg

Have you a piece of working code with REST REPLACE method? Can you share it?


We get the response from the server: "403 Prohibited." for every PUT REST API's methods (REPLACE, PUBLISH etc.). GET/POST methods work properly.


Big thanks!

TH

Not applicable

Re: Problem with replace REST function

Hello Tomasz,

I don't have the code in my hand at this moment but could you check first if the user that you are using have at least the privileges ContentAdmin on the Qlik Sense Server? I mean, I think that I had the same problem and it was because of the rights of the user. I didn't specify any right to the user that was interacting with the REST api so it was only able to do simple operations like checking values but to be able to modify qvf it was necessary to have more privileges.

Tell me if that's the problem,

Regards.

humansoft
New Contributor II

Re: Problem with replace REST function

Thanks Oriol for response. Yes, we checked this thing many times, without success: without specify user, with specify user internal/external, with or without ContentAdmin privileges. That's why I'm asking for a piece of working code

BR

TH

humansoft
New Contributor II

Re: Problem with replace REST function

Hi akl‌, maybe you have a piece of working code with REST REPLACE method? Can you share it?


BR

TH

Not applicable

Re: Problem with replace REST function

Hello Tomasz,

You have to follow that example:

https://pythonhosted.org/TGWebServices/examples/csharp.html

Keeping in mind that in the address you have to include the ?xrfkey=ABCDEFG123456789 (http://serverurl/virtualproxy/qrs/app/{id}/replace?app={appid}?xrfkey=ABCDEFG123456789)


the method is PUT and that you have to add also the headers

            request.Headers.Add(header authentication header name, value);

            request.Headers.Add("X-Qlik-xrfkey", "ABCDEFG123456789");

            request.Headers.Add("X-QlikView-xrfkey", "ABCDEFG123456789");

Not applicable

Re: Problem with replace REST function

For the people interested we have found that there's a bug on the replace function of Qlik Sense.

At first moment we thought that we have a problem when we uploaded a qvf, used the replace function to replace the file of an existing published app and then we delete the original uploaded file losing the thumbnail of the published one.

But we performed the same operations on Qlik Sense Server and it happens the same:

- We clicked the import button uploading the file.

- Then we published the file with the publish button specifying to replace an existing published file with the checkbox Replace existing file.

- After that we deleted the original uploaded file and then we lost the thumbnail of the published file.

So we are thinking that when one publish a file with the replace function, the thumbnail image keeps linked with the original uploaded file instead of having its own so if that file is removed the published one loses that image.

Community Browser