KBPublisher uses conventional HTTP response codes to indicate 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 resulted from the provided information (e.g. a required parameter was missing, etc.), and codes in the 5xx range indicate an error on server, db error or API settings error.
HTTP Status Code Summary
200 OK - Everything worked as expected.
400 Bad Request - Often missing a required parameter, bad request.
401 Unauthorized - No valid API key provided,bad signature.
402 Request Failed - Parameters were valid but request failed.
404 Not Found - The requested item doesn't exist.
500, 502, 503, 504 Server errors - something went wrong on server.
In addition to descriptive error text, error messages contain machine-parseable codes. While the text for an error message may change, the codes will stay the same. The following table describes the codes which may appear when working with the API:
Could not authenticate user.
Bad signature, api request could not be authorized.
API is available via SSL only
Use https to send a request.
You cannot access this resource using (%s) request
HTTP request methods (POST, PUT or DELETE) is not allowed.
Sorry, that page does not exist
The specified resource was not found.
Sorry, that method does not exist
The specified method was not found.
Missing or invalid argument(s)
Missing a required parameter or invalid parameter.
API is not available
API is disabled.
API is temporarily unavailable
API does not respond.
The requested item doesn't exist.
If you see an error response which is not listed in the above table, then fall back to the HTTP status code in order to determine the best way to address the error.
When the KBPublisher API returns error messages, it does so in your requested format. For example, an error from a JSON method might look like this: