Discussions

Ask a Question
Back to all

Trouble Integrating Optimove API with Python — Getting “401 Unauthorized” Error

Hey everyone,

I’m currently working on integrating the Optimove API into a Python-based customer analytics tool, but I keep running into a 401 Unauthorized error whenever I try to authenticate. I’ve double-checked my credentials (App ID, User Key, and Secret Key) and confirmed that the same credentials work fine when testing through Postman.

Here’s a quick look at my setup:

import requests
headers = { google doodle baseball
"Content-Type": "application/json",
"App-Id": "my_app_id",
"User-Key": "my_user_key",
"Secret-Key": "my_secret_key"
}

response = requests.get(url, headers=headers)
print(response.status_code, response.text)

No matter what I try, the API keeps responding with a 401. I’m wondering if I’m missing something in the authentication header or if Optimove requires a different token exchange process before making requests.

Has anyone successfully connected to the Optimove API using Python? If so, could you share an example of the correct header format or any required pre-auth steps?

Thanks in advance for any help!