Skip to main content
Solved

Can't get data using API key and secret

  • September 15, 2021
  • 6 replies
  • 1400 views

Forum|alt.badge.img

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>

Best answer by MikkoKarvonen

DemonIa wrote:

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
View original
Did this topic help you find an answer to your question?

6 replies

MikkoKarvonen
Peer Moderator
Forum|alt.badge.img+3
  • Peer Moderator
  • 113 replies
  • Answer
  • September 15, 2021
DemonIa wrote:

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

MikkoKarvonen
Peer Moderator
Forum|alt.badge.img+3
  • Peer Moderator
  • 113 replies
  • September 15, 2021

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


Denis Holmes
Team Member
Forum|alt.badge.img+8
  • Team Member
  • 448 replies
  • September 16, 2021

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!


Forum|alt.badge.img
  • Author
  • New Member
  • 1 reply
  • September 16, 2021

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!


belinda.chiu
Team Member
Forum|alt.badge.img+8
  • Amplitude Support
  • 189 replies
  • February 16, 2023

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


belinda.chiu wrote:

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

Hi Belinda, is this still true? I can’t get the DSAR API to work with my project credentials (other paths work fine), and don’t understand how I can request org-level API keys on a Starter plan


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings