Came across this thread and it seems that many are in the same boat as me.
Using any of the rest sensors is a bit limited as most modern APIs require bearer-tokens that often are loaded in a separate call.
If the header: attribute of i.e. the the restful sensor supports templating, it would be possible to use one restful sensor to get the token and store it in a sensor attribute or state and then use another restful sensor to fetch data using the previously stored token in the second calls header template.
This feature request is about adding template support for the headers on all rest sensors.
No unfortunately not.
I decided to build my own component for this and other architectural reasons.
But feel free to pick up the idea and make a pull request.
I didn’t have time to make the change my selv and solved it by making a Node-RED flow instead.
But if you have the time feel free to pick it up and contribute.
is there already another workaround for this? or any solution? maybe storing the variable in a file? and then reading it with a curl command or something?