I keep getting this Error : Error: 401 Client Error: Unauthorized for url: https://shipping-api.prd2.shiphero.com/graphql .
No idea how to fix it. Please help!
I keep getting this Error : Error: 401 Client Error: Unauthorized for url: https://shipping-api.prd2.shiphero.com/graphql .
No idea how to fix it. Please help!
Hi @aevans,
Before going further, can you tell us what you’re trying to do with shipping-api.prd2.shiphero.com/graphql? Are you calling it from a script/integration, from a browser, or something else? That will help us point you to the right endpoint and docs.
A 401 from the ShipHero GraphQL endpoint almost always means the request is missing a valid bearer token, rather than a problem with the query itself. Make sure you are sending an Authorization header in the form “Bearer <access_token>” and that the access token has not expired, since those are short-lived and need to be refreshed with your refresh token. If you are using the old token that was generated from a username and password, it is worth regenerating it and testing again. Also double check that the header is not being dropped by a redirect or a proxy in your HTTP client. A quick way to rule out your code is to run a simple query such as the account info query in a GraphQL client with the same token and see whether it succeeds.