REST API Error Response

Could see an error resource available https://developer.companieshouse.gov.uk/api/docs/officers/officer_id/appointments/error-resource.html

Documentation mentions that in case of “401” the response body will provide an error response.

However, in case of authorisation failure, the status code is “401” but the response body is empty.

Can we expect the error response to be provided in future ?

The error is an error!

There should not be an error document returned when you get a 401 Unauthorised response. There’s no further qualification that can be made.

Actually, with regards the documentation of the 401 response: you won’t find this documented on every endpoint. We did intend to remove the individual 401s (same for 200, 404 etc) and document them in one place, since they are common and consistent across all the endpoints. However, a few appear to have remained.

That said, we are in the process of re-structuring the documentation, and will also be publishing the Swagger specifications. In Swagger 2.0 it is mandatory to define the status codes for every endpoint, so our documentation will therefore have to reproduce this…