api-docs: Clarify error response keys and handling documentation.

Updates the main description of the API error handling article so
that the `code` key in the error reponse is more accurate.

Adds a bullet point to the API changelog for feature level 76 about
the `code` key being consistently in all error responses. This is
based on commit 8b9011dff8, which completed the migration to
JsonableError, at which point the API feature level was already
set to 75 and not yet set to 76.

Also, revises the other error related feature level 76 entries in
the API changelog.

Adds a header for  the common, shared error responses that are
documented on the error handling page, and updates those error
descriptions to include information about any extra fields and to
end with any changes notes.
This commit is contained in:
Lauryn Menard
2024-06-17 16:55:37 +02:00
committed by Tim Abbott
parent fec89ad70d
commit d0c25a9291
3 changed files with 79 additions and 37 deletions

View File

@@ -1699,11 +1699,17 @@ No changes; feature level used for Zulip 5.0 release.
**Feature level 76**
* [`POST /fetch_api_key`](/api/fetch-api-key), [`POST
/dev_fetch_api_key`](/api/dev-fetch-api-key): The HTTP status for
authentication errors is now 401. This was previously 403.
* All API endpoints now use the HTTP 401 error status for API requests
involving a deactivated user or realm. This was previously 403.
* [`POST /fetch_api_key`](/api/fetch-api-key),
[`POST /dev_fetch_api_key`](/api/dev-fetch-api-key): The HTTP status
for authentication errors is now 401. These previously used the HTTP
403 error status.
* [Error handling](/api/rest-error-handling#common-error-responses): API
requests that involve a deactivated user or organization now use the
HTTP 401 error status. These previously used the HTTP 403 error status.
* [Error handling](/api/rest-error-handling): All error responses
now include a `code` key with a machine-readable string value. The
default value for this key is `"BAD_REQUEST"` for general error
responses.
* Mobile push notifications now include the `mentioned_user_group_id`
and `mentioned_user_group_name` fields when a user group containing
the user is mentioned. Previously, these were indistinguishable