Question

Can't get data using API key and secret

  • 15 September 2021
  • 4 replies
  • 39 views

Badge

Hi.

Help me please,  understand why I can't make request using Amplitude API with my key and secret?

I've tried use Postman and examples on Python from official docs, but all times I've got a 403 Forbidden or 401 Unanthorized.

Why? The key and secret is 100% correct. Maybe it's due some scopes \ permissions ?

Screenshot: https://prnt.sc/1s9npb7

Result: <html><title>403: Forbidden</title><body>403: Forbidden</body></html>


4 replies

Userlevel 4
Badge +2

Hi.

Help me please,  understand why I can't make request using Amplitude API with my key and secret?

I've tried use Postman and examples on Python from official docs, but all times I've got a 403 Forbidden or 401 Unanthorized.

Why? The key and secret is 100% correct. Maybe it's due some scopes \ permissions ?

Screenshot: https://prnt.sc/1s9npb7

Result: <html><title>403: Forbidden</title><body>403: Forbidden</body></html>


Documentation indicates that hours should also use two numbers. Would using T00 instead of T0 help?

If not, what kind of request you get for the sample CURL request?

curl -u API_Key:Secret_Key 'https://amplitude.com/api/2/export?start=20210914T5&end=20210914T20' >> yourfilename.zip
Userlevel 4
Badge +2

Another thought: do you know if you should be using the standard or EU endpoint? https://developers.amplitude.com/docs/export-api

Userlevel 3
Badge +2

Hi @DemonIa , Would you be able to send me the details of the api and what you are trying to target in postman exactly? I can then look into it myself and see what the issue is. Thank you!

Badge

Hey @MikkoKarvonen and @Denis Holmes 
Thank you so much for your feedback.

I’ve not find out what’s the reason of the troubles with my credentials on this route: https://amplitude.com/api/2/dsar/requests

But I’ve found a workaround: just use the NodeJs module and activity() method to get data about the user’s activity. And it’s working with the same api key and secret.

Thanks again for your support!

Reply