Authorization headers

Hi All,

If I have a few API calls to my Xano backend. Do I need to do authorization header individually or I can run a global workflow to run it once. Is it possible?

Also, is it safe or ok to do so. Will it even help with performance?
Just curious.

If the API key is private, yes you need to do for each of them. It is for security reason. What do you mean by running it once, means fetching all your collections at once? Adding an authorization header won’t affect performance.

@khairul I was probably more like thinking aloud. ON a single page if there 2 or 3 API calls, then I am doing authorization for each call. Probably being a no code, it appears explicit and seems inefficient. The more I think about it, my question does seem strange :slight_smile:

You better do for each, it is repetitious but it is required for security reasons.

1 Like

@hsatl you indeed have to do it for each API call.

What I would recommend, though, is to set all your API calls in an API folder as “global workflows”, like so:

Then, you know that you’ll have to edit them here if you change your API/credentials. And from your elements, call these workflows with the “execute workflow” action.

3 Likes

Thanks, this is a good approach.