When exporting data with the Export API through Python requests, I receive a 403 Forbidden error. The API key and secret are correct, and encoded correctly, since when they were incorrect, I received a 401 error that has since resolved.
I am also on the US data center, but I tried both the US and EU centers and received a 403 error for both.
I am using the following code, which is the same request as in the documentation:
def get_api():
headers = {
'Authorization': 'Basic {REDACTED API KEY}',
}
params = {
'start': '20220101T00',
'end': '20220127T00',
}
response = requests.get('https://amplitude.com/api/2/export', params=params, headers=headers)
print(response)
print("Done!")
I have reviewed the following posts with no success.