Synthetic API endpoint error response

We have a custom api script where we are trying to access the private uri with api key. We are passing $http.get(options, (err, response, body), where options has url and key.

Issue here is we are unable to verify if we are successfully logging in to api with the Secret Key. We did use wrong key but our response status code is always giving back 200 code. Below is the error code we are using:
$http.get(options, (err, response, body) => {
if (err) {
console.log(err);
throw Error (err);
}
if (response.statusCode !== 302){
console.log(“Response Status Code:”, response.statusCode)
assert.equal(response.statusCode, 200, “Expected a 200 OK response”);
}
});

Hi, @veeresh.dandur1: That seems like an issue with your API endpoint. If it returns 200 for an incorrect API key, there is not much Synthetics can do about it.

1 Like

Thanks @philweber, let me check the end point and get back.

1 Like