Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mlehtola
Partner - Contributor III
Partner - Contributor III

Overwrite POST body with Qlik REST Connector

I'm trying to overwrite the POST request body with Qlik Rest Connector. As in documentation the syntax is WITH CONNECTION(body "<Overwrite>") . This works great as long the body does not contain double quotes (").

My use case sending email with sendgrid API and post body is like this:

{"personalizations": [{

     "to": [{"email": "some@example.com"}]}],

     "from": {"email": "some@example.com"},

     "subject": "Sending with SendGrid is Fun","

     content": [{"type": "text/plain", "value": "and easy to do anywhere"}

]}

This works great when creating the connection with Create connection wizard, but when I try to manipulate the body in script with WITH CONNECTION (body "{newBody}") that contains double quotes the script fails.

Is there a way to escape double quotes in the WITH CONNECTION (body "")?

3 Replies
Anonymous
Not applicable

Hi Markus,

I have also tried the way you are trying, sometimes API functions differently or double quotes need to checked properly.


Try to put it another way,

WITH CONNECTION ( URL "",

                                      QUERY "to" "$(vTo)",

                                       QUERY "from" "$(vfrom)"

                                            next query like this);

mlehtola
Partner - Contributor III
Partner - Contributor III
Author

Hi Sandeep,

tried dollar sign expansion and also replacing " with chr(34) with no success. Api does not work without double quotes so that does not hel.

Anonymous
Not applicable

Hi Markus,

I would suggest then to attach the connection part in your script here and error screenshot also so that to understand the error better.