Inconsistent error format for `oauth/token` route

The “Errors” section of the API docs reads:

Here you can find the exhaustive list of Stuart API error responses, the expected format can be found below:
    "error": "BAD_REQUEST",
    "message": "job[dropoffs][0][package_type] is invalid"

While most routes do seem to return error messages in this format, the oauth/token does not: instead of a message field, oath token error responses have an error_description field. For instance:

    "error": "invalid_client",
    "error_description": "Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method."

Since I’m guessing “fixing” the error format for the oauth route might break existing clients, the inconsistency should, at the very least, be documented in the “errors” section of the API docs.

On that note - are there any other routes besides oauth/token that don’t follow the “standard” error format (with a message)?

1 Like

Hi Mirek,

Thank you for informing us and helping us being more consistent in our documentation.

We’ve just updated our documentation in order to bring more clarity regarding the error response topic.

This is supposed to be the only route that has a different error format. We will double check it and let you know if this is not the case.

Thanks, and I appreciate the quick follow-up!

1 Like