Dashboard API error: HTTP 401: Unauthorized

  • 18 August 2022
  • 4 replies
  • 502 views

Hi, I’m trying to run a simple Dashboard REST API requests and getting `HTTP 401: Unauthorized` error in any response.

 

In particular, I’m calling `GET` https://amplitude.com/api/2/users with `Authorization` header set to `Basic [api_key]:[secret_key]`. API key and secret key are obtained from https://analytics.amplitude.com/[...]/settings/projects/[...]/general.

 

It works as if my API key pair is invalid.

 

What am I missing?


4 replies

Userlevel 5
Badge +5

Hi @jackqack,

Thanks for posting this question! 

Which tool are you using to make the API calls? Would it be possible to share a screenshot of your API call with API key blurred out? Please let me know. Thanks!

Hi @Yuanyuan Zhang, here’s an example of a call of getting active users taken from docs.

 

 

Userlevel 5
Badge +5

Hi @jackqack.

Thanks for sharing the screenshot and apologies for the delayed reply! I ran the same request using your API key and secret key just now in Postman and the request got 200 ok response (screenshot). Could you please try to set up the API key and Secret key in the AUTH tab, too? 

 

It works now. Thanks @Yuanyuan Zhang!

Reply