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: 
gaurav2017
Creator II
Creator II

Facing issue with POST method using REST connector

Hi Friends,

 

I am able to get the response in POSTMAN but when I am trying to open the same API url in QlikSense, I get the error attached.

Any help will be appreciated!

 

 

Labels (4)
1 Solution

Accepted Solutions
gaurav2017
Creator II
Creator II
Author

The issue has been resolved. Thanks to the community and also Hit and trials I did.

 

LET vDateControllerExtraction=0; //Only change if the data has to be extracted for older than 1 day
Trace $(vDateControllerExtraction) vDateControllerExtraction;
LET vDateControllerExtractionA=$(vDateControllerExtraction)+1; //FromDateController
Trace $(vDateControllerExtractionA) vDateControllerExtractionA;
LET vDateControllerExtractionB=$(vDateControllerExtraction); //ToDateController
Trace $(vDateControllerExtractionB) vDateControllerExtractionB;

Let vFromDateS = Date(DayStart(Today()-$(vDateControllerExtractionA)),'YYYY-MM-DD')&'T20:00:00.000Z';
Trace $(vFromDateS) vFromDateS;
Let vToDateS = Date(DayEnd(Today()-$(vDateControllerExtractionB)),'YYYY-MM-DD')&'T19:59:59.999Z';
Trace $(vToDateS) vToDateS;

Let vRequestBodyS = '{"StartDate":"$(vFromDateS)","EndDate":"$(vToDateS)","Unit":"Hour","LocationAggregate":true}';
Trace $(vRequestBodyS) vRequestBodyS;
Let vRequestBodyS = replace(vRequestBodyS,'"', chr(34)&chr(34));
Trace $(vRequestBodyS) vRequestBodyS;

RestConnectorMasterTable:
SQL
SELECT
...

...

...
FROM JSON (wrap off) "TestTable"
WITH CONNECTION
(
URL "https://XXXXXXXXXXXXXXXX",
HTTPHEADER "Content-Type" "application/json",
HTTPHEADER $(vRequestTokenS),
BODY "$(vRequestBodyS)"
);

View solution in original post

2 Replies
gaurav2017
Creator II
Creator II
Author

The issue has been resolved in creating a connection. The solution was to skip certificate validation.

Now, I am working on the part for "WITH CONNECTION"

gaurav2017
Creator II
Creator II
Author

The issue has been resolved. Thanks to the community and also Hit and trials I did.

 

LET vDateControllerExtraction=0; //Only change if the data has to be extracted for older than 1 day
Trace $(vDateControllerExtraction) vDateControllerExtraction;
LET vDateControllerExtractionA=$(vDateControllerExtraction)+1; //FromDateController
Trace $(vDateControllerExtractionA) vDateControllerExtractionA;
LET vDateControllerExtractionB=$(vDateControllerExtraction); //ToDateController
Trace $(vDateControllerExtractionB) vDateControllerExtractionB;

Let vFromDateS = Date(DayStart(Today()-$(vDateControllerExtractionA)),'YYYY-MM-DD')&'T20:00:00.000Z';
Trace $(vFromDateS) vFromDateS;
Let vToDateS = Date(DayEnd(Today()-$(vDateControllerExtractionB)),'YYYY-MM-DD')&'T19:59:59.999Z';
Trace $(vToDateS) vToDateS;

Let vRequestBodyS = '{"StartDate":"$(vFromDateS)","EndDate":"$(vToDateS)","Unit":"Hour","LocationAggregate":true}';
Trace $(vRequestBodyS) vRequestBodyS;
Let vRequestBodyS = replace(vRequestBodyS,'"', chr(34)&chr(34));
Trace $(vRequestBodyS) vRequestBodyS;

RestConnectorMasterTable:
SQL
SELECT
...

...

...
FROM JSON (wrap off) "TestTable"
WITH CONNECTION
(
URL "https://XXXXXXXXXXXXXXXX",
HTTPHEADER "Content-Type" "application/json",
HTTPHEADER $(vRequestTokenS),
BODY "$(vRequestBodyS)"
);