I wish to populate a custom module with data from an external API, which requires an api_key in the request header in order to authorize. I currently receive the response 401 on my request. I have followed the https://developers.hubspot.com/docs/cms/guides/getting-started-with-serverless-functions in order to create serveless functions, with bad luck. I have put my api-key as a secret with the HubSpot Cli. Code is below:
Do you know why I get 401 response - am I missing something? And is this the easiest way to populate a custom module with data from external API? Please let me know if there is any better way to do it - or let me know if HubSpot does not support external APIs to populate modules..