Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:web_api:v3:streaming_api [2022/06/23 22:01] – Add documentation dstillmandev:web_api:v3:streaming_api [2023/04/11 17:46] (current) – [Create an empty WebSocket stream] dstillman
Line 1: Line 1:
 ====== Zotero Streaming API ====== ====== Zotero Streaming API ======
  
 +The Zotero streaming API provides push-based notifications via WebSockets for Zotero library changes, allowing for nearly instantaneous updates when data changes in a library or when a user joins or leaves a library.
 +
 +Note that this API provides library-level notifications of changes. It does not provide updated data directly. API consumers that receive notification of a library change should use their standard [[syncing|sync process]] to retrieve data, ensuring a single, consistent code path for both manual and automatic syncing.
 +
 +To avoid missed updates, clients should connect to the streaming API and then, once connected, trigger a standard sync operation to bring themselves up to date with the current version of a library.
 ===== Requests ===== ===== Requests =====
  
 ==== Create an empty WebSocket stream ==== ==== Create an empty WebSocket stream ====
  
-<code javascript>var ws = new WebSocket('https://stream.zotero.org');</code>+<code javascript>var ws = new WebSocket('wss://stream.zotero.org');</code>
  
 Server response: Server response:
Line 86: Line 91:
  
 Topic subscriptions cannot be removed via ''createSubscriptions''. If subscriptions for a given API key already exist, the provided topics will be merged with the existing ones. If an empty ''topics'' array is provided, no changes will be made. If no ''topics'' property is provided, the key will be upgraded to automatically track access as described above. Topic subscriptions cannot be removed via ''createSubscriptions''. If subscriptions for a given API key already exist, the provided topics will be merged with the existing ones. If an empty ''topics'' array is provided, no changes will be made. If no ''topics'' property is provided, the key will be upgraded to automatically track access as described above.
- 
-A maximum of [TBD] API keys can be added on a single event stream. 
  
 === Errors === === Errors ===
dev/web_api/v3/streaming_api.1656036108.txt.gz · Last modified: 2022/06/23 22:01 by dstillman