502 Bad Gateway When Making Any Calls

Hey,

I started attempting to make requests to this API, but all I am returned with is 502 Bad Gateway.

If I don’t provide authentication in the request I get a 401 Unauthorized response, which is correct and logical. Anything else returns 502, which is never something you should see from an API unless there’s a problem with it.

When I first tried using the API yesterday, I was getting 502 Bad Gateway just on the website, trying to login and trying to make simple searches, so I assumed there was an issue. It’s still happening now on the API, so can anyone point me in the right direction?

I’ve resolved this. I thought I’d share in case others experience this.

My script variable holding the API Key was empty at the point of the script it was attempting to execute the CURL request, therefore the authorisation header was "Authorization: Basic ". This error on my part confused the matter when I completely removed this header altogether as that is when I received a 401 Unauthorized response. In case anyone else has the same, it’s worth double checking you are actually passing the key with the header, as a blank authorisation header won’t return 401 Unauthorized.

Thanks for taking the time to share your experience.