When I make this call from within Postman it works fine, but when I try to call it from my website I get the error at the bottom. Please advise why this would happen
Hi Guys, I solve it pretty quickly. The issue is Hubspot documentation for API_key is outdated, I assume because its a less secure method of authentification, especially if you send it through query parameters.
I can confirm, for api_key (not private app which uses auth2 auth), you need to use bearer authorisation, which does append it to the headers of the request.
Actually - the cookie doesn't do anything. I deleted it in Postman and it still ran. My code (outside of Postman) still gets a 401 Unauthorized response when I copy and paste from their code
Thanks Malcom -- Authoorization Type = No Auth. The only thing I see different in the Postman code is that it is sending thru a cookie in the request header - I'm not finding anything about that in the documentation or endpoints.
I’m the programmer for a customer who has a paid HubSPot account with you. They have the bulk of their data in an SQL database which connects to the website and their backend admin. They want me to keep their database and their HubSpot data in sync with your APIs – so I am trying to call your contacts API via a winhttp call from their website. It’s in ASP – and they have SSL on the site .. the key is not exposed. We do this with GHIN/USGA, MemberPlanet, GolfGenius, and many others. The main goal is to add/update/search and create contacts, as well as pulling changes and getting a full list of the contact IDs to match up to their SQL records. Nothing else at this time.
If it works in Postman then you have the right targets and the right data structures. Look at the way in which Postman is handling authentication and copy that into your winhttp call. By the way, do you know about Postman's "copy as..." command? It generates the same call that you are making via Postman in dozens of different languages.
off-topic: I sometimes which I could route the calls through my postman collection. It would be my secret power-tool.