Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Qlik experts,
I've been struggling to get Qlik Sense to communicate with a database (Exact Online) that uses OAuth2. I've managed to get the token aspect to work, however now I'm stuck on how to retrieve the data from the database.
What I've done:
1. Set up an authorization process and a POST call in Qlik to get my access and refresh tokens.
2. Automatically get new access token if needed.
I'm now able to connect to the database, but I'm failing to retrieve any data.
An example end point is as follows:
https://start.exactonline.nl/api/v1/current/Me?$select=CurrentDivision
Which in postman gives me this result (changed the division):
set vAccept = 'application/json';
set vRequestBody = '';
set vURL = 'https://start.exactonline.nl/api/v1/current/Me?$select=CurrentDivision';
its quite hard to write the SQL SELECT from a rest source so what i usually do when working with API and even more with OAuth2 is that i first setup one connection to the token/auth endpoint to retrieve the token, copy the token and create a new connection where I add the token to the header parameter and url as the endpoint i would like to get data from. Then i use the add data for this connection to build up the SQL SELECT statement. Once that one is working ill switch to using the token connection and WITH CONNECTION statement.
Then i do this for all endpoints, first modify an existing one where the token is added as header parameter and then switch to WITH CONNECTION. You might need to retrieve a fresh token once in a while, depends on the token lifetime.
its quite hard to write the SQL SELECT from a rest source so what i usually do when working with API and even more with OAuth2 is that i first setup one connection to the token/auth endpoint to retrieve the token, copy the token and create a new connection where I add the token to the header parameter and url as the endpoint i would like to get data from. Then i use the add data for this connection to build up the SQL SELECT statement. Once that one is working ill switch to using the token connection and WITH CONNECTION statement.
Then i do this for all endpoints, first modify an existing one where the token is added as header parameter and then switch to WITH CONNECTION. You might need to retrieve a fresh token once in a while, depends on the token lifetime.
Could you explain what you mean with " Then i use the add data for this connection to build up the SQL SELECT statement." ? I have Oauth2 working, so I have an access token that I pass to the connection as vAccessToken in the header.
The data I retrieve in Postman looks like the following:
Actually got it to work using the built in SQL statement builder using the select data feature. Thanks a lot!