Help with API Authentication Error

Hello :slightly_smiling_face:

I am new to using the ShipHero API and I am facing an issue . I am trying to authenticate my requests ; but I keep getting an “Invalid Credentials” error. :thinking: :thinking:
I have generated a new API key from the ShipHero dashboard.
I am using Python and the requests library to send my API requests.

import requests;

url = "https:// public -api.shiphero.com/auth/token "
headers = {
“Content-Type”: “application/json”,
“Authorization”: “Bearer MY_API_KEY”
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())

Despite this, the response I get is:
{
“error”: “invalid_credentials”,
“message”: “The provided credentials are invalid.”
}
I have rechecked the API key and even regenerated it a couple of times to ensure it’s correct. I have checked Getting Started – Developer Resources | ShipHero mulesoft documentation but still need help .

Has anyone else faced this issue? Any suggestions would be greatly appreciated!

Thanks in advance!

Thank you
gregbowers

Hi Greg,

It looks like you are hitting the token endpoint https://public-api.shiphero.com/auth/token using the authorization header. The authorization header and the bearer token acquired are to authenticate while querying to the graphql endpoint: https://public-api.shiphero.com/graphql.

Have a nice day!

1 Like