Hello everyone,
I fetching data from an API that requires a token that expires after a few minutes. It has a header that says X-Authorization and then the token I get from another API. Since I am not en API expert, I have checked a tutorial on how to make this dynamically instead of opening the connector every time the token expires. However, I keep getting errors.
This is what my script looks like:
Here I fetch the token I need.
![Rolando_Montero_0-1666361961029.png Rolando_Montero_0-1666361961029.png](https://community.qlik.com/t5/image/serverpage/image-id/91896i592E0D31D1B11AE1/image-size/medium?v=v2&px=400)
The REST connection looks as follows
![Rolando_Montero_3-1666362305157.png Rolando_Montero_3-1666362305157.png](https://community.qlik.com/t5/image/serverpage/image-id/91902i9E42C9E3DFA084E7/image-size/medium?v=v2&px=400)
![Rolando_Montero_4-1666362333991.png Rolando_Montero_4-1666362333991.png](https://community.qlik.com/t5/image/serverpage/image-id/91903iC1BDE127DF0263D5/image-size/medium?v=v2&px=400)
Finally, this is the loading script
This is the second connection where I fetch the data that requires the token I mentioned. I have read that when you use the statement WITH CONNECTION overrides the data you have set up on the REST connection.
![Rolando_Montero_2-1666362168846.png Rolando_Montero_2-1666362168846.png](https://community.qlik.com/t5/image/serverpage/image-id/91901iF09AFDB992796837/image-dimensions/539x237?v=v2)
After running the script, I get the following error
![Rolando_Montero_5-1666362490196.png Rolando_Montero_5-1666362490196.png](https://community.qlik.com/t5/image/serverpage/image-id/91905i34C2842C1C49A479/image-size/medium?v=v2&px=400)
I do not know if I have to add the X-Authorization statement in the script or if I am missing some parameters.
I hope you can help me!
Thanks!