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).

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

Here is my code:

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. :joy:

Sorry, I’m new here​:joy: But I’ve checked, I think this post is in the developers area?

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

Yes, I’m sure that I’ve granted my app the scopes. (I almost opened every scopes​:rofl:)

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

Sorry, I forget to update my new code. Here is the final code:

This code is almost as same as postman’s code, but still not work and got 401 error.:cry:

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.

Thank you for your help.:sad_but_relieved_face: