APIs & Integrations

Pna7
Participant

Private app access token not works

Hi,

I'm trying to use private app access token to call search companies api,

but I keep get 401 errors. I also try on postman, and it works!(like this photo).截圖 2022-09-07 下午4.54.06.png

I've double-checked that if I input wrong access token, but I see nothing wrong.

Here is my code:
截圖 2022-09-08 上午10.38.51.png截圖 2022-09-08 上午10.37.18.png

0 Upvotes
8 Replies 8
LeeBartelme
HubSpot Employee
HubSpot Employee

Private app access token not works

Have you ensured that you have granted your private app the appropriate scopes for the specific API request?

Pna7
Participant

Private app access token not works

Yes, I'm sure that I've granted my app the scopes. (I almost opened every scopes🤣)

0 Upvotes
LeeBartelme
HubSpot Employee
HubSpot Employee

Private app access token not works

You are doing a GET in your code and a POST in postman. 

0 Upvotes
Pna7
Participant

Private app access token not works

Sorry, I forget to update my new code. Here is the final code:
截圖 2022-09-08 上午10.38.51.png截圖 2022-09-08 上午10.37.18.png

This code is almost as same as postman's code, but still not work and got 401 error.😢

0 Upvotes
LeeBartelme
HubSpot Employee
HubSpot Employee

Private app access token not works

I don't know man.  That code your provided looks pretty much like it came straight out of postman. It seems like you can't be using the the correct API key if you are getting a 401 Error. I'd maybe reach out to support.

0 Upvotes
Pna7
Participant

Private app access token not works

Thank you for your help.😥

0 Upvotes
danmoyle
Most Valuable Member | Diamond Partner
Most Valuable Member | Diamond Partner

Private app access token not works

Hi @Pna7. Have you posted this in the Developers area? I'm not a dev, so I'm not sure how I'd fix this, and I'm not sure many in the CRM/Sales forum would also have the dev knowledge. Code makes me itchy. 😂

 

Did my answer help? Please "mark as a solution" to help others find answers. Plus I really appreciate it!


linkedininstagram

Dan Moyle

Solutions Consultant

Digital Reach Online Solutions
emailAddress
daniel@digitalreachopm.com
website
https://www.digitalreachos.com/
Pna7
Participant

Private app access token not works

Sorry, I'm new here😂 But I've checked, I think this post is in the developers area?

0 Upvotes