Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have this scenario where I need to connect to an API using the RestConnector.exe and the connection was successful but the problem is the authorization key expires in around 8 to 10 hours which means I cannot sue the auth key as one time password... I went through some posts and noticed that this works in Qliksense but not in Qlikview...
is it still the same ? Thanks a lot for your time
Best place I can point you is the Help to be sure you have reviewed all the available information there:
If you do not find what you need, the other thing would likely be to check the Ideas area of Community to see if there is anything there regarding this functionality request and if not, you can create a new request...
https://community.qlik.com/t5/Ideas/idb-p/qlik-ideas
Sorry I do not have anything better for you.
Consider splitting the request into two parts.
The first API request GETs the token and saves the token into a variable.
The second API call uses that variable in the data load request. Note: I'm using two different data connections in the below example. Something like this:
First part
LIB CONNECT TO 'API_TOKEN_REFRESH';
TokenRefresh:
SQL SELECT
"token",
"__KEY_root"
FROM JSON (wrap on) "root" PK "__KEY_root";
[root]:
LOAD [token],
[__KEY_root]
RESIDENT TokenRefresh
WHERE NOT IsNull([__KEY_root]);
// Variable placeholder for autogenerated token
LET vToken = peek('token', 0, 'root');
DROP TABLE root;
Second Part where the important thing is in the 'WITH CONNECTION' part. I think there is a in-depth documentation somewhere on the Qlik site.
LIB CONNECT TO 'API_GET_DATA_REQUEST';
ExampleDataTable:
SQL SELECT
"id",
"SomeField",
"AnotherField"
FROM "SomeTable" PK "__KEY_root" )
FROM JSON (wrap on) "root" PK "__KEY_root"
WITH CONNECTION (
URL "https://api.yourservice.com/your-end-point",
QUERY "dataType" "good",
HTTPHEADER "auth" "$(vToken)"
);
// The rest of the your JSON tables structure follows here...
Hope it works for you -
Cheers