Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am hoping to create a REST API connection to JAMS Scheduler's REST API. The API uses bearer token authentication so I believe I will first need to send a Post Request to get a token and can then use that token in Get requests to pull data into Qlik Sense. They have pretty good documentation on how to do it using Python here
https://www.jamsscheduler.com/doc/JAMSHelp/JAMSRESTAPIwithPython.html
I think this is likely possible by utilizing a generic JSON server connection and then updating the WITH CONNECTION string as described in this and several other community posts but I have not been able to get a token back. One difference I noticed between this and other examples I have seen is that this requires username and pw to be sent via payload, is that possible within Qlik REST API?
Any thoughts are much appreciated!
Thanks,
Mark
Hi @mjperreault ,
Have you tried sending the payload in the body, using WITH CONNECTION (BODY "<your json body>") ?
Something along the following in the script:
let MsgBody='{"username": "#Your JAMS Username", "password": "#Your JAMS Password"}';
let MsgBody=replace(MsgBody,'"',chr(34) & chr(34));
SQL SELECT ...
FROM JSON (wrap on) "root" PK "__KEY_root"
WITH CONNECTION (
HTTPHEADER "content-type" "application/json"
BODY "$(MsgBody)"
);
Then you need the bearer token to be sent in a second GET request as outlined in the documentation you linked to. I think this would be possible.
Best,
Bjorn
Hi @mjperreault ,
Have you tried sending the payload in the body, using WITH CONNECTION (BODY "<your json body>") ?
Something along the following in the script:
let MsgBody='{"username": "#Your JAMS Username", "password": "#Your JAMS Password"}';
let MsgBody=replace(MsgBody,'"',chr(34) & chr(34));
SQL SELECT ...
FROM JSON (wrap on) "root" PK "__KEY_root"
WITH CONNECTION (
HTTPHEADER "content-type" "application/json"
BODY "$(MsgBody)"
);
Then you need the bearer token to be sent in a second GET request as outlined in the documentation you linked to. I think this would be possible.
Best,
Bjorn