How to Add an Authorization Header to Custom Workflow Actions?
Hey all — I have a question about custom workflow actions. How can I add a header to them? I’m sure it’s possible, but I haven’t been able to figure it out. I think I might need to use a PRE_ACTION_EXECUTION function but I’m not sure. My action is currently working, but I want to secure the endpoint and ask the user to provide a token via UI, using one of the action inputs (open to other methods if you have better suggestions!). The idea is to then add an Authorization: Bearer token header to the action.
How to Add an Authorization Header to Custom Workflow Actions?
@pablo-synthflow - I thinkk what you are asking is how to add a header to API calls executed in the custom workflow logic? Apologies if I have this incorrect.
The classical approach of hiding an access token for any kind of API call (HubSpot or 3rd party) is to use a SECRET passed as an environment variable to the code at startup. Taking this approach, you can manage/update that SECRET value periodically without making individual changes to all the code sequences that use it. The SECRET is stored independently of any record properties of course.
When you format the header for a request (in Python that is) you construct the appropriate header using the retrieved value of the SECRET.
How to Add an Authorization Header to Custom Workflow Actions?
Hey Steve! Thanks for responding 🙂 I think I'm asking something a bit different. I'm following these docs to let my Hubspot app users execute a particular action.
The action works, but I want them to be able to input an API key (that they get from my website) in order to use it.
I am using the PRE_ACTION_EXECUTION parameter for that, but it doesn't seem to work for me.
This is my current payload (simplified and sanitized)