Solved

Can't get data using API key and secret

  • 15 September 2021
  • 5 replies
  • 1044 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>

icon

Best answer by MikkoKarvonen 15 September 2021, 12:20

View original

5 replies

Userlevel 5
Badge +3

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 5
Badge +3

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

Userlevel 6
Badge +8

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!

Userlevel 6
Badge +8

Hi @DemonIa ! I found this post through another post and just wanted to share a note. 

Thank you for sharing that you were trying to export data from the DSAR API. The DSAR API uses an org-level API key and secret key instead of a project-level API key. To request an org-level API key, you would have needed to submit a ticket to the support team at support.amplitude.com. https://www.docs.developers.amplitude.com/analytics/apis/ccpa-dsar-api/#authorization

Reply