Skip to main content
Benzinga uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with Benzingaโ€™s servers. Some 4xx errors that could be handled programmatically include an error code that briefly explains the error reported.

Parameters

type
string
The type of error returned.One of invalid_request_error, not_found_error, creation_error, update_error, deletion_error, forbidden_error, or authentication_error.
message
string
A human-readable message providing more details about the error.
params
array
If the error is parameter-specific, this will contain a list of the parameters that were invalid.

Error Response

  • Unauthorized 401 - Invalid token, check the token provided.
โ— Could not connect to wss://api.benzinga.com/api/v1/analyst/insights/stream?token=bz.p***
Error: Unexpected server response: 401
Handshake Details
Request Method: โ€œGETโ€
Status Code: โ€œ401 Unauthorizedโ€
  • Bad Gateway 502 - Either invalid route or server error.
โ— Could not connect to wss://api.benzinga.com/api/v1/analyst/insights/stream?token=bz.p***
Error: Unexpected server response: 502
Handshake Details
Request Method: โ€œGETโ€
Status Code: โ€œ502 Bad Gatewayโ€