Skip to main content

Integration, Extension & APIs

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

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER NOW!
cancel
Showing results for 
Search instead for 
Did you mean: 
arunachalamggg
Contributor II
Contributor II

Rest Connection Error

Hi,

Im trying to get data from a rest api and I am passing the body paramet with it. I have tested the api in postman and it works.
Below is my script

LIB CONNECT TO 'xxx';

let vBase64String = 'xxxxxxx==';

let vRequestBody = '{"OBID":"1"}' ;


let vRequestBody = replace(vRequestBody,'"',chr(34));
//I have tried this option too
//let vRequestBody = replace(vRequestBody,'"',chr(34)&chr(34));

 

LET vAuthorization = 'Basic ' & '$(username)' & ':' & '$(password)';

RestConnectorMasterTable:
SQL SELECT
"W"

FROM JSON (wrap on) "root"
WITH CONNECTION (
URL "https://xxxxxk/xxx/v1/xx/xx",
HTTPHEADER "Autorization" "Basic $(vBase64String)",
BODY "$(vRequestBody)"
);

 

Im getting the following error

arunachalamggg_0-1631095117624.png

 

Labels (1)
2 Replies
NadiaB
Support
Support

Hi @arunachalamggg 

Have you seen this already?

https://community.qlik.com/t5/New-to-Qlik-Sense/Connector-reply-error-Unexpected-lexem-From-at-62-5-...

Hope it helps.

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
arunachalamggg
Contributor II
Contributor II
Author

yes, I have tired replacing with chr(34) and im still having the same issue