Qlik Community

Knowledge

Search or browse our knowledge base to find answers to your questions ranging from account questions to troubleshooting error messages. The content is curated and updated by our global Support team

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS

REST connector: How to modify queryt URL, Parameters, Headers and Body using WITH CONNECTION command in the reload script

cancel
Showing results for 
Search instead for 
Did you mean: 
Sonja_Bauernfeind
Digital Support
Digital Support

REST connector: How to modify queryt URL, Parameters, Headers and Body using WITH CONNECTION command in the reload script

The user can override connection paramters such as queryt URL, Parameters, Headers and Body using WITH CONNECTION command in the Select statement. 

 

Environment:

Qlik REST Connector 

 

The format is:

<select_stmt> WITH CONNECTION (<connection_item> {,<connection_item>})

connection_item = URL "new url" | QUERY "param name" "param value" | HTTPHEADER "header name" "header value" | BODY "request body text"

 

Example:

Set vURL="https://jsonplaceholder.typicode.com/comments";
Set vHeader="customer1";
Set vParam="?postId=1";

RestConnectorMasterTable:
SQL SELECT 
    "userId",
    "id",
    "title",
    "body",
    "postId",
    "name",
    "email"
FROM JSON (wrap on) "root"
WITH CONNECTION( 
                Url "$(vURL)$(vParam)",
                QUERY "postId" "2",
                QUERY "postId" "3",
                HTTPHEADER "Cust-Header" "$(vHeader)"
);
Labels (2)
Version history
Last update:
‎2021-05-26 06:22 AM
Updated by:
Contributors