diff --git a/templates/zerver/api/add-linkifiers.md b/templates/zerver/api/add-linkifier.md similarity index 100% rename from templates/zerver/api/add-linkifiers.md rename to templates/zerver/api/add-linkifier.md diff --git a/templates/zerver/api/add-emoji-reaction.md b/templates/zerver/api/add-reaction.md similarity index 100% rename from templates/zerver/api/add-emoji-reaction.md rename to templates/zerver/api/add-reaction.md diff --git a/templates/zerver/api/changelog.md b/templates/zerver/api/changelog.md index c0f22b8285..8dc8b8d7c8 100644 --- a/templates/zerver/api/changelog.md +++ b/templates/zerver/api/changelog.md @@ -66,21 +66,21 @@ below features are supported. value means no limit. * [`POST /register`](/api/register-queue): The response now contains a `is_owner`, similar to the existing `is_admin` and `is_guest` fields. -* [`POST /typing`](/api/typing): Removed legacy support for sending email +* [`POST /set-typing-status`](/api/set-typing-status): Removed legacy support for sending email addresses, rather than user IDs, to encode private message recipients. **Feature level 10** -* [`GET users/me`](/api/get-profile): Added `avatar_version`, `is_guest`, +* [`GET users/me`](/api/get-own-user): Added `avatar_version`, `is_guest`, `is_active`, `timezone`, and `date_joined` fields to the User objects. -* [`GET users/me`](/api/get-profile): Removed `client_id` and `short_name` +* [`GET users/me`](/api/get-own-user): Removed `client_id` and `short_name` from the reponse to this endpoint. These fields had no purpose and were inconsistent with other API responses describing users. **Feature level 9** -* [`POST users/me/subscriptions`](/api/add-subscriptions), [`DELETE - /users/me/subscriptions`](/api/remove-subscriptions): Other users to +* [`POST users/me/subscriptions`](/api/subscribe), [`DELETE + /users/me/subscriptions`](/api/unsubscribe): Other users to subscribe/unsubscribe, declared in the `principals` parameter, can now be referenced by user_id, rather than Zulip display email address. @@ -90,15 +90,15 @@ below features are supported. **Feature level 8** -* [`GET /users`](/api/get-all-users), [`GET /users/{user_id}`](/api/get-user) - and [`GET /users/me`](/api/get-profile): User objects now contain the +* [`GET /users`](/api/get-users), [`GET /users/{user_id}`](/api/get-user) + and [`GET /users/me`](/api/get-own-user): User objects now contain the `is_owner` field as well. * Added [time mentions](/help/format-your-message-using-markdown#mention-a-time) to supported markdown features. **Feature level 7** -* [`GET /events`](/api/get-events-from-queue): `realm_user` and +* [`GET /events`](/api/get-events): `realm_user` and `realm_bot` events no longer contain an `email` field to identify the user; use the `user_id` field instead. Previously, some (but not all) events of these types contained an `email` key in addition to @@ -106,7 +106,7 @@ below features are supported. * [`PATCH /users/{user_id}`](/api/update-user): The `is_admin` and `is_guest` parameters were removed in favor of the more general `role` parameter for specifying a change in user role. -* [`GET /events`](/api/get-events-from-queue): `realm_user` events +* [`GET /events`](/api/get-events): `realm_user` events sent when a user's role changes now include `role` property, instead of the previous `is_guest` or `is_admin` booleans. * `GET /realm/emoji`: The user who uploaded a given custom emoji is @@ -115,16 +115,16 @@ below features are supported. **Feature level 6** -* [`GET /events`](/api/get-events-from-queue): `realm_user` events to +* [`GET /events`](/api/get-events): `realm_user` events to update a user's avatar now include the `avatar_version` field, which is important for correctly refetching medium-size avatar images when the user's avatar changes. -* [`GET /users`](/api/get-all-users) and [`GET +* [`GET /users`](/api/get-users) and [`GET /users/{user_id}`](/api/get-user): User objects now contain the `avatar_version` field as well. **Feature level 5** -* [`GET /events`](/api/get-events-from-queue): `realm_bot` events, +* [`GET /events`](/api/get-events): `realm_bot` events, sent when changes are made to bot users, now contain an integer-format `owner_id` field, replacing the `owner` field (which was an email address). @@ -149,7 +149,7 @@ below features are supported. **Feature level 2**: -* [`POST /messages/{message_id}/reactions`](/api/add-emoji-reaction): +* [`POST /messages/{message_id}/reactions`](/api/add-reaction): The `reaction_type` parameter is optional; the server will guess the `reaction_type` if it is not specified (checking custom emoji, then unicode emoji for any with the provided name). @@ -160,13 +160,13 @@ below features are supported. **Feature level 1**: -* [`GET /server_settings`](/api/server-settings): Added +* [`GET /server_settings`](/api/get-server-settings): Added `zulip_feature_level`, which can be used by clients to detect which of the features described in this changelog are supported. * [`POST /register`](/api/register-queue): Added `zulip_feature_level` to the response if `zulip_version` is among the requested `event_types`. -* [`GET /users`](/api/get-all-users): User objects for bots now +* [`GET /users`](/api/get-users): User objects for bots now contain a `bot_owner_id`, replacing the previous `bot_owner` field (which had the email address of the bot owner). * [`GET /users/{user_id}`](/api/get-user): Endpoint added. @@ -174,16 +174,16 @@ below features are supported. values for the `anchor` parameter, deprecating and replacing the `use_first_unread_anchor` parameter. * [`GET /messages`](/api/get-messages) and [`GET - /events`](/api/get-events-from-queue): Message objects now use + /events`](/api/get-events): Message objects now use `topic_links` rather than `subject_links` to indicate links either present in the topic or generated by Linkifiers applied to the topic. -* [`POST /users/me/subscriptions`](/api/add-subscriptions): Replaced +* [`POST /users/me/subscriptions`](/api/subscribe): Replaced `is_announcement_only` boolean with `stream_post_policy` enum for specifying who can post to a stream. * [`PATCH /streams/{stream_id}`](/api/update-stream): Replaced `is_announcement_only` boolean with `stream_post_policy` enum for specifying who can post to a stream. -* [`GET /streams`](/api/get-all-streams): Replaced +* [`GET /streams`](/api/get-streams): Replaced `is_announcement_only` boolean with `stream_post_policy` enum for specifying who can post to a stream. * `GET /api/v1/user_uploads`: Added new endpoint for requesting a @@ -200,24 +200,24 @@ below features are supported. ## Changes in Zulip 2.1 -* [`GET /users`](/api/get-all-users): Added `include_custom_profile_fields` +* [`GET /users`](/api/get-users): Added `include_custom_profile_fields` to request custom profile field data. -* [`GET /users/me`](/api/get-profile): Added `avatar_url` field, +* [`GET /users/me`](/api/get-own-user): Added `avatar_url` field, containing the user's avatar URL, to the response. -* [`GET /users/me/subscriptions`](/api/get-subscribed-streams): Added +* [`GET /users/me/subscriptions`](/api/get-subscriptions): Added `include_subscribers` parameter controlling whether data on the other subscribers is included. Previous behavior was to always send subscriber data. -* [`GET /users/me/subscriptions`](/api/get-subscribed-streams): +* [`GET /users/me/subscriptions`](/api/get-subscriptions): Stream-level notification settings like `push_notifications` were changed to be nullable boolean fields (true/false/null), with `null` meaning that the stream inherits the organization-level default. Previously, the only values were true/false. A client communicates support for this feature using `client_capabilities`. -* [`GET /users/me/subscriptions`](/api/get-subscribed-streams): Added +* [`GET /users/me/subscriptions`](/api/get-subscriptions): Added `wildcard_mentions_notify` notification setting, with the same global-plus-stream-level-override model as other notification settings. -* [`GET /server_settings`](/api/server-settings): Added +* [`GET /server_settings`](/api/get-server-settings): Added `external_authentication_methods` structure, used to display login buttons nicely in the mobile apps. * Added `first_message_id` field to Stream objects. This is helpful @@ -241,7 +241,7 @@ below features are supported. * [`POST /messages`](/api/send-message): Added support for using user IDs and stream IDs for specifying the recipients of a message. -* [`POST /typing`](/api/typing): Added support for specifying the +* [`POST /set-typing-status`](/api/set-typing-status): Added support for specifying the recipients with user IDs, deprecating the original API of specifying them using email addresses. diff --git a/templates/zerver/api/create-stream.md b/templates/zerver/api/create-stream.md index 9d12f5edcc..9b1bbd9261 100644 --- a/templates/zerver/api/create-stream.md +++ b/templates/zerver/api/create-stream.md @@ -1,7 +1,7 @@ # Create a stream You can create a stream using Zulip's REST API by submitting a -[subscribe](/api/add-subscriptions) request with a stream name that +[subscribe](/api/subscribe) request with a stream name that doesn't yet exist. You can specify the initial configuration of the stream using the `invite_only` and `announce` parameters to that request. diff --git a/templates/zerver/api/get-org-emoji.md b/templates/zerver/api/get-custom-emoji.md similarity index 100% rename from templates/zerver/api/get-org-emoji.md rename to templates/zerver/api/get-custom-emoji.md diff --git a/templates/zerver/api/get-events-from-queue.md b/templates/zerver/api/get-events.md similarity index 100% rename from templates/zerver/api/get-events-from-queue.md rename to templates/zerver/api/get-events.md diff --git a/templates/zerver/api/list-linkifiers.md b/templates/zerver/api/get-linkifiers.md similarity index 100% rename from templates/zerver/api/list-linkifiers.md rename to templates/zerver/api/get-linkifiers.md diff --git a/templates/zerver/api/get-profile.md b/templates/zerver/api/get-own-user.md similarity index 100% rename from templates/zerver/api/get-profile.md rename to templates/zerver/api/get-own-user.md diff --git a/templates/zerver/api/server-settings.md b/templates/zerver/api/get-server-settings.md similarity index 100% rename from templates/zerver/api/server-settings.md rename to templates/zerver/api/get-server-settings.md diff --git a/templates/zerver/api/get-all-streams.md b/templates/zerver/api/get-streams.md similarity index 100% rename from templates/zerver/api/get-all-streams.md rename to templates/zerver/api/get-streams.md diff --git a/templates/zerver/api/get-subscribed-streams.md b/templates/zerver/api/get-subscriptions.md similarity index 100% rename from templates/zerver/api/get-subscribed-streams.md rename to templates/zerver/api/get-subscriptions.md diff --git a/templates/zerver/api/get-presence.md b/templates/zerver/api/get-user-presence.md similarity index 100% rename from templates/zerver/api/get-presence.md rename to templates/zerver/api/get-user-presence.md diff --git a/templates/zerver/api/get-all-users.md b/templates/zerver/api/get-users.md similarity index 100% rename from templates/zerver/api/get-all-users.md rename to templates/zerver/api/get-users.md diff --git a/templates/zerver/api/index.md b/templates/zerver/api/index.md index 2713cc3a62..c4a12f76a9 100644 --- a/templates/zerver/api/index.md +++ b/templates/zerver/api/index.md @@ -16,7 +16,7 @@ guide should help you find the API you need: * If you're building an interactive bot that reacts to activity inside Zulip, you'll want to look at Zulip's [Python framework for interactive bots](/api/running-bots) or - [Zulip's real-time events API](/api/get-events-from-queue). + [Zulip's real-time events API](/api/get-events). And if you still need to build your own integration with Zulip, check out the full [REST API](/api/rest), generally starting with diff --git a/templates/zerver/api/integrations-overview.md b/templates/zerver/api/integrations-overview.md index ecf1e653d0..435da800ad 100644 --- a/templates/zerver/api/integrations-overview.md +++ b/templates/zerver/api/integrations-overview.md @@ -62,7 +62,7 @@ integration and don't have an engineer on staff, * To react to activity inside Zulip, look at Zulip's [Python framework for interactive bots](/api/running-bots) or - [Zulip's real-time events API](/api/get-events-from-queue). + [Zulip's real-time events API](/api/get-events). * If what you want isn't covered by the above, check out the full [REST API](/api/rest). The web, mobile, desktop, and terminal apps are diff --git a/templates/zerver/api/mark-as-read-bulk.md b/templates/zerver/api/mark-all-as-read.md similarity index 100% rename from templates/zerver/api/mark-as-read-bulk.md rename to templates/zerver/api/mark-all-as-read.md diff --git a/templates/zerver/api/mute-topics.md b/templates/zerver/api/mute-topic.md similarity index 100% rename from templates/zerver/api/mute-topics.md rename to templates/zerver/api/mute-topic.md diff --git a/templates/zerver/api/real-time-events.md b/templates/zerver/api/real-time-events.md index 6e8b3f62ea..b20d6680ed 100644 --- a/templates/zerver/api/real-time-events.md +++ b/templates/zerver/api/real-time-events.md @@ -23,7 +23,7 @@ interface for processing Zulip messages. More complex applications (like a Zulip terminal client) may need to instead use the raw [register](/api/register-queue) and -[events](/api/get-events-from-queue) endpoints. +[events](/api/get-events) endpoints. ## Usage examples @@ -56,5 +56,5 @@ You may also pass in the following keyword arguments to `call_on_each_event`: {generate_api_arguments_table|zulip.yaml|/real-time:post} -See the [GET /events](/api/get-events-from-queue) documentation for +See the [GET /events](/api/get-events) documentation for more details on the format of individual events. diff --git a/templates/zerver/api/register-queue.md b/templates/zerver/api/register-queue.md index 02d95d66bb..25b64148f1 100644 --- a/templates/zerver/api/register-queue.md +++ b/templates/zerver/api/register-queue.md @@ -13,7 +13,7 @@ intended primarily for complex applications for which the more convenient This endpoint returns a `queue_id` and a `last_event_id`; these can be used in subsequent calls to the -["events" endpoint](/api/get-events-from-queue) to request events from +["events" endpoint](/api/get-events) to request events from the Zulip server using long-polling. The server will queue events for up to 10 minutes of inactivity. @@ -24,7 +24,7 @@ client loses network connectivity with the Zulip server for 10 minutes or longer. Once the server garbage-collects your event queue, the server will -[return an error](/api/get-events-from-queue#bad_event_queue_id-errors) +[return an error](/api/get-events#bad_event_queue_id-errors) with a code of `BAD_EVENT_QUEUE_ID` if you try to fetch events from the event queue. Your software will need to handle that error condition by re-initializing itself (e.g. this is what triggers your diff --git a/templates/zerver/api/remove-linkifiers.md b/templates/zerver/api/remove-linkifier.md similarity index 100% rename from templates/zerver/api/remove-linkifiers.md rename to templates/zerver/api/remove-linkifier.md diff --git a/templates/zerver/api/remove-emoji-reaction.md b/templates/zerver/api/remove-reaction.md similarity index 100% rename from templates/zerver/api/remove-emoji-reaction.md rename to templates/zerver/api/remove-reaction.md diff --git a/templates/zerver/api/delete-user-group.md b/templates/zerver/api/remove-user-group.md similarity index 100% rename from templates/zerver/api/delete-user-group.md rename to templates/zerver/api/remove-user-group.md diff --git a/templates/zerver/api/typing.md b/templates/zerver/api/set-typing-status.md similarity index 100% rename from templates/zerver/api/typing.md rename to templates/zerver/api/set-typing-status.md diff --git a/templates/zerver/api/add-subscriptions.md b/templates/zerver/api/subscribe.md similarity index 100% rename from templates/zerver/api/add-subscriptions.md rename to templates/zerver/api/subscribe.md diff --git a/templates/zerver/api/remove-subscriptions.md b/templates/zerver/api/unsubscribe.md similarity index 100% rename from templates/zerver/api/remove-subscriptions.md rename to templates/zerver/api/unsubscribe.md diff --git a/templates/zerver/api/update-subscription-properties.md b/templates/zerver/api/update-subscription-settings.md similarity index 100% rename from templates/zerver/api/update-subscription-properties.md rename to templates/zerver/api/update-subscription-settings.md diff --git a/templates/zerver/help/include/rest-endpoints.md b/templates/zerver/help/include/rest-endpoints.md index 801e4c8368..b011a75c17 100644 --- a/templates/zerver/help/include/rest-endpoints.md +++ b/templates/zerver/help/include/rest-endpoints.md @@ -4,26 +4,26 @@ * [Get a raw message](/api/get-raw-message) * [Send a message](/api/send-message) * [Update a message](/api/update-message) -* [Add an emoji reaction](/api/add-emoji-reaction) -* [Remove an emoji reaction](/api/remove-emoji-reaction) +* [Add an emoji reaction](/api/add-reaction) +* [Remove an emoji reaction](/api/remove-reaction) * [Render a message](/api/render-message) * [Upload a file](/api/upload-file) * [Delete a message](/api/delete-message) * [Construct a narrow](/api/construct-narrow) * [Get a message's edit history](/api/get-message-history) * [Update a message's flags](/api/update-message-flags) -* [Mark messages as read in bulk](/api/mark-as-read-bulk) +* [Mark messages as read in bulk](/api/mark-all-as-read) #### Streams -* [Get all streams](/api/get-all-streams) -* [Get subscribed streams](/api/get-subscribed-streams) -* [Add subscriptions](/api/add-subscriptions) -* [Update subscription settings](/api/update-subscription-properties) -* [Remove subscriptions](/api/remove-subscriptions) +* [Get all streams](/api/get-streams) +* [Get subscribed streams](/api/get-subscriptions) +* [Add subscriptions](/api/subscribe) +* [Update subscription settings](/api/update-subscription-settings) +* [Remove subscriptions](/api/unsubscribe) * [Get subscription status](/api/get-subscription-status) * [Get topics in a stream](/api/get-stream-topics) -* [Topic muting](/api/mute-topics) +* [Topic muting](/api/mute-topic) * [Create a stream](/api/create-stream) * [Get stream ID](/api/get-stream-id) * [Delete a stream](/api/delete-stream) @@ -31,36 +31,36 @@ #### Users -* [Get all users](/api/get-all-users) +* [Get all users](/api/get-users) * [Get a user](/api/get-user) * [Deactivate a user](/api/deactivate-user) * [Reactivate a user](/api/reactivate-user) * [Update a user](/api/update-user) -* [Get profile](/api/get-profile) +* [Get profile](/api/get-own-user) * [Create a user](/api/create-user) -* [Set "typing" status](/api/typing) -* [Get user presence](/api/get-presence) +* [Set "typing" status](/api/set-typing-status) +* [Get user presence](/api/get-user-presence) * [Get all user groups](/api/get-user-groups) * [Update notification settings](/api/update-notification-settings) * [Create a user group](/api/create-user-group) * [Update a user group](/api/update-user-group) -* [Delete a user group](/api/delete-user-group) +* [Delete a user group](/api/remove-user-group) * [Get attachments](/api/get-attachments) #### Server & organizations -* [Get server settings](/api/server-settings) -* [List linkifiers](/api/list-linkifiers) -* [Create linkifiers](/api/add-linkifiers) -* [Remove linkifiers](/api/remove-linkifiers) -* [Get all custom emoji](/api/get-org-emoji) +* [Get server settings](/api/get-server-settings) +* [List linkifiers](/api/get-linkifiers) +* [Create linkifiers](/api/add-linkifier) +* [Remove linkifiers](/api/remove-linkifier) +* [Get all custom emoji](/api/get-custom-emoji) * [Upload custom emoji](/api/upload-custom-emoji) #### Real-time events * [Real time events API](/api/real-time-events) * [Register an event queue](/api/register-queue) -* [Get events from an event queue](/api/get-events-from-queue) +* [Get events from an event queue](/api/get-events) * [Delete an event queue](/api/delete-queue) #### Specialty endpoints diff --git a/zerver/openapi/python_examples.py b/zerver/openapi/python_examples.py index 41ae25b60b..2b41fc2594 100644 --- a/zerver/openapi/python_examples.py +++ b/zerver/openapi/python_examples.py @@ -1175,7 +1175,7 @@ def test_streams(client: Client, nonadmin_client: Client) -> None: def test_queues(client: Client) -> None: - # Note that the example for api/get-events-from-queue is not tested. + # Note that the example for api/get-events is not tested. # Since, methods such as client.get_events() or client.call_on_each_message # are blocking calls and since the event queue backend is already # thoroughly tested in zerver/tests/test_event_queue.py, it is not worth diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml index b163ae8f21..237dabee91 100644 --- a/zerver/openapi/zulip.yaml +++ b/zerver/openapi/zulip.yaml @@ -703,7 +703,7 @@ paths: description: | Dictionary with data on the user who added the reaction, including the user ID as the `id` field. **Note**: In the [events - API](/api/get-events-from-queue), this `user` dictionary + API](/api/get-events), this `user` dictionary confusing had the user ID in a field called `user_id` instead. We recommend ignoring fields other than the user ID. **Deprecated** and to be removed in a future release @@ -1197,7 +1197,7 @@ paths: For updating the `read` flag on common collections of messages, see also the - [special endpoints for marking message as read in bulk](/api/mark-as-read-bulk). + [special endpoints for marking message as read in bulk](/api/mark-all-as-read). parameters: - name: messages in: query @@ -1607,7 +1607,7 @@ paths: `GET {{ api_url }}/v1/users/{user_id}` - You can also fetch details on [all users in the organization](/api/get-all-users). + You can also fetch details on [all users in the organization](/api/get-users). *This endpoint is new in Zulip Server 2.2.* parameters: @@ -3052,7 +3052,7 @@ paths: organization. Each of these tuples contain the pattern, the formatted URL and the filter's ID, in that order. See the [Create - linkifiers](/api/add-linkifiers) article for + linkifiers](/api/add-linkifier) article for details on what each field means. - example: { @@ -3512,7 +3512,7 @@ paths: tags: ["users"] description: | This endpoint is used to edit the user's global notification settings. - See [this endpoint](/api/update-subscription-properties) for + See [this endpoint](/api/update-subscription-settings) for per-stream notification settings. `PATCH {{ api_url }}/v1/settings/notifications` diff --git a/zerver/tests/test_docs.py b/zerver/tests/test_docs.py index 6c2a53a025..c588033545 100644 --- a/zerver/tests/test_docs.py +++ b/zerver/tests/test_docs.py @@ -112,18 +112,18 @@ class DocPageTest(ZulipTestCase): self._test('/api/installation-instructions', 'No download required!') self._test('/api/send-message', 'steal away your hearts') self._test('/api/render-message', '**foo**') - self._test('/api/get-all-streams', 'include_public') + self._test('/api/get-streams', 'include_public') self._test('/api/get-stream-id', 'The name of the stream to access.') - self._test('/api/get-subscribed-streams', 'Get all streams that the user is subscribed to.') - self._test('/api/get-all-users', 'client_gravatar') + self._test('/api/get-subscriptions', 'Get all streams that the user is subscribed to.') + self._test('/api/get-users', 'client_gravatar') self._test('/api/register-queue', 'apply_markdown') - self._test('/api/get-events-from-queue', 'dont_block') + self._test('/api/get-events', 'dont_block') self._test('/api/delete-queue', 'Delete a previously registered queue') self._test('/api/update-message', 'propagate_mode') - self._test('/api/get-profile', 'takes no parameters') - self._test('/api/add-subscriptions', 'authorization_errors_fatal') + self._test('/api/get-own-user', 'takes no parameters') + self._test('/api/subscribe', 'authorization_errors_fatal') self._test('/api/create-user', 'zuliprc-admin') - self._test('/api/remove-subscriptions', 'not_removed') + self._test('/api/unsubscribe', 'not_removed') self._test('/team/', 'industry veterans') self._test('/history/', 'Cambridge, Massachusetts') # Test the i18n version of one of these pages.