APIs & Integrations

DStandfast
Mitglied

Receiving 401 Error after switching to Private App

Hello, my team is working on migrating our system's Hubspot access from the API to Private Apps(we were given an extension for the migration). We use the hubspot-php composer package along with the rossjcooper/laravel-hubspot package to interface with our Laravel based application. These had to be updated to the latest versions and the old key changed to the token in order to switch to the Private App. With just those changes I was able to get the new Private App connection working seamlessly in the development environment on my local machine, as well as in a Postman request. However when the changes were pushed to our Staging server with the same settings and token, the request comes back with a 401 error.

 

This is the error message I was able to get:

 

POST https://api.hubapi.com/contacts/v1/contact/createOrUpdate/email/*******@ex.com` resulted in a `401 Unauthorized` response:
{"status":"error","message":"Any of the listed authentication credentials are missing","correlationId":"ceae92cc-f8b9-4f (truncated...)

 

I'm really not finding anything that should be different on our server that would cause this error. Does anyone have recommendations on directions to troubleshoot in?

0 Upvotes
2 Antworten
DStandfast
Mitglied

Receiving 401 Error after switching to Private App

The problem is solved!

 

Well, mostly...

Strangely enough we were able to get the Private Apps service working fine on our production server when we implemented it, which was the real goal. So it seems like the staging server simply had a bad authorization key somewhere. It was definitely not the token, so it must have been something else. If anyone else has the same issue the best advice I can give is probably just to check into any other authorization keys used by the HTTPS request.

Jaycee_Lewis
Community-Manager/-in
Community-Manager/-in

Receiving 401 Error after switching to Private App

Hi, @DStandfast 👋 Thanks for reaching out. Let's see if the community has any experience here — hey @miljkovicmisa @albertsg @stefen, do you have any insight or tips you can share with @DStandfast?

 

Thank you very much! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes