Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have an API that i need to connect to, and i know i can use the REST connector.
but i need more flexibility for example:
i need to connect to the following api: https://api.game.com/usergroups?apikey='asdasdjlkascass2'
but need to change the apikey that is being sent dynamically
OR
change the header that is being sent,
how can i do that?
i thought that maybe i will have some kind of an option from the script editor to write something like this:
CUSTOM CONNECT "http://api.game.com/usergroup?apikey=$(KEY)"
This is very creative and i like it 🙂
unfortunately it is not working.
but i found a way to change the headers:
and it will be good enough for now.
thx for all your help!
Hi Gal,
Basically the question is if you need to authenticate or not. If not - you can connect to as if you are loading internet file.
That's straight-forward with QV and quite tricky but still naively possible in QS.
If you can drop the URL in the browser and that fetches the information you need (basically scraping it), you can write the code with a bit of help.
But if you need to parse headers with token for authentication you need to check the Qlik REST connector.
I hope that helps!
Kind regards,
S.T.
My problem is that i need to authenticate,
i have multipal URL (apis) each one of theme have different api key,
so i need some kind of a way to change the path when i use the "CONNECT"
Hi Gal,
We didn't clarify if this is Qlik View or Qlik Sense?
I think once you generate your "CONNECT" or LIB: statement, you can use variables to modify certain paths in it.
Still if you need to authenticate, I don't think you can bypass using REST connector. Do you have it installed?
Kind regards,
S.T.
Hi Gal,
Using the same connection and dynamically changing the header is not possible with native QS functionality to my knowledge.
I don't have a reliable test connection to play with so I can't be sure this success is legitimate (actually I'm quite sure it is not):
But for the sake of science, you can give it a shot and let's check what is happening.
The request field says:
$(=vTest)
Kind regards,
S.T.
This is very creative and i like it 🙂
unfortunately it is not working.
but i found a way to change the headers:
and it will be good enough for now.
thx for all your help!