Update to POST /wiki/rest/api/content/{id}/label

Previously, when a user called the Add labels to content (POST /wiki/rest/api/content/{id}/label) API endpoint and passed in at least one invalid label (e.g. a label with invalid characters, too many characters, etc.), the API would return an error response with status code 500 (internal server error), along with a dense error message. This endpoint has been updated, so that now a status code 400 error response is returned in this case, and the response body is now structured for easy consumption of error messages and corresponding labels. The 400 error response is also now listed in the documentation under Responses.

Currently, the endpoint by default returns the old 500 error response. In 3 months, the old 500 error response will no longer be used, and the endpoint will only return the 400 error response. We’ve added a new query parameter use-400-error-response, which if set to true will cause the API to use the new 400 error response during this 3-month period. All developers using this endpoint and expecting an error response must add this query parameter to their requests so that they transition to this change.

4 Likes