Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to update a NPrinting Connection using its API in a Qlik Sense script. I use all the parameters as that the API needs, however it is not working.
Do you have an example how the call should look like? It seems on the dev tools in Chrome that other parameters are being used when I change the NPrinting connection manually.
I cannot find anything in the Qlik community so far.
Kind regards
Hatus
Hi @Hatus
Looks like you were very close.
You need to remove [ ] from your code.
Here is what I got back from my team...
let vConnectionBody = chr(39) & '{"id":"' & vConnectionId & '","QlikSenseConnection":{' & '"proxyUrl":"' & vQlikSenseProxyUrl & '","appId":"' & vQlikSenseAppId & '","identity":"' & vQlikSenseIdentity & '","applyTheme":false' & ',"applyUserSectionAccess":false' & '}' & ',"name":"' & vConnectionName & '","appId":"' & vConnectionAppId & '","source":"QlikSense"' & ',"notificationsEnabled":true' & '}' & chr(39);
Kind regards...
Hi @Hatus
Feel free to download the attached app that contains the reload code.
You'll need to follow this article to set up your rest connectors first.
Kind regards...
ps: publish task reload app included
Hi @Frank_S
Thank you for the example. However in this case I already have build a whole NPrinting routine using the API.
I am trying now to implement the put /connections/{id} method.
Qlik NPrinting API − put /connections/{id} | Qlik NPrinting Help
The body of the request using
DataConnectionRequest:
Qlik NPrinting API − DataConnectionRequest | Qlik NPrinting Help
and QlikSenseConnection:
Qlik NPrinting API − QlikSenseConnection | Qlik NPrinting Help
is returning bad request.
Do you have an example of a working put /connections/{id} request?
Thank you for your support!
Regards
Hatus
Hi @Hatus
I've asked around here but I will need to know exactly what you are trying to do with
"put /connections/{id} "
Are you trying to
Descriptive Snapshots of the NP Connection fields in the NP web console/connections page that you are trying to update with the NP APIs available would be helpful as well.
Let me know and I will re-ask my team..thanks!
Hi @Frank_S
I am trying to change the ID of the Qlik Sense app in the NPrinting connection.
It means the "appId" under "QlikSenseConnection"
Here how I build the request body:
let vConnectionBody = chr(39) & '{"id":' & vConnectionId
& ',"QlikSenseConnection":[{'
& '"proxyUrl":' & vQlikSenseProxyUrl
& ',"appId":' & vQlikSenseAppId
& ',"identity":' & vQlikSenseIdentity
& ',"applyTheme":false'
& ',"applyUserSectionAccess":false'
& '}]'
& ',"name":' & vConnectionName
& ',"appId":' & vConnectionAppId
& ',"source":"QlikSense"'
& ',"notificationsEnabled":true'
& '}' & chr(39);
Hi @Hatus
Looks like you were very close.
You need to remove [ ] from your code.
Here is what I got back from my team...
let vConnectionBody = chr(39) & '{"id":"' & vConnectionId & '","QlikSenseConnection":{' & '"proxyUrl":"' & vQlikSenseProxyUrl & '","appId":"' & vQlikSenseAppId & '","identity":"' & vQlikSenseIdentity & '","applyTheme":false' & ',"applyUserSectionAccess":false' & '}' & ',"name":"' & vConnectionName & '","appId":"' & vConnectionAppId & '","source":"QlikSense"' & ',"notificationsEnabled":true' & '}' & chr(39);
Kind regards...
Hi @Hatus
Also check out this link for tips on configuring your requirements.
For this case you need a POST connection and add
HTTPHEADER "X-HTTP-Method-Override" "PUT"
in the script as in the update user example in the guide.
Hi @Frank_S
It works! Perfect, those brackets where really not needed 😅
Thank you very much once again.
Kind regards
Great news @Hatus !
Please mark the solution as accepted using the Accept as Solution button...Thanks!