Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
mjperreault
Creator
Creator

Create a REST API connection to JAMS Scheduler API (bearer authentication)

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?


https://community.qlik.com/t5/Connectivity-Data-Prep/REST-CONNECTOR-locate-the-Authorization-token/t...

 

Any thoughts are much appreciated!

@Bjorn_Wedbratt 


Thanks,
Mark

 

 

Labels (2)
1 Solution

Accepted Solutions
Bjorn_Wedbratt
Former Employee
Former Employee

Hi @mjperreault ,

Have you tried sending the payload in the body, using WITH CONNECTION (BODY "<your json body>") ?

https://help.qlik.com/en-US/connectors/Subsystems/REST_connector_help/Content/Connectors_REST/Load-R...

 

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

 

 

 

View solution in original post

1 Reply
Bjorn_Wedbratt
Former Employee
Former Employee

Hi @mjperreault ,

Have you tried sending the payload in the body, using WITH CONNECTION (BODY "<your json body>") ?

https://help.qlik.com/en-US/connectors/Subsystems/REST_connector_help/Content/Connectors_REST/Load-R...

 

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