This repository has been archived by the owner on Feb 28, 2025. It is now read-only.
JSON RPC WebSocket API: subscribeGroupMessages
#26
Labels
subscribeGroupMessages
#26
JSON RPC WebSocket API Documentation:
subscribeGroupMessages
Overview
This document describes the JSON RPC WebSocket API for subscribing to a conversation. It provides a way for clients to receive real-time updates in a conversation thread.
WebSocket Endpoint
wss://protocol.xmtp.com/v1/conversation
JSON RPC Protocol
This API follows the JSON RPC 2.0 specification. All messages sent and received are expected to be in valid JSON format.
Authentication
To establish a secure WebSocket connection. This api may be public and does not require authentication.
Method
1.
subscribeGroupMessages
Subscribes the client to receive updates for a specific conversation.
Parameters:
conversationId
(string): Unique identifier for the conversation.startBlock
(optional, string): Timestamp to receive updates from. If not provided, defaults to the current time.Response:
{"jsonrpc": "2.0", "result": "Subscribed to conversation [conversationId]", "id": [requestId]}
2. see
unsubscribeGroupMessages
Notifications
When subscribed to a conversation, the client will receive notifications in the following format:
groupMessageUpdate
conversationId
(string): Identifier of the conversation.event
(string): Event triggering update:PayloadSent
messages
(array): Array of new message objects since the last update.Error Handling
The API uses standard JSON RPC error responses. Common error codes include:
-32601
: Method not found.-32602
: Invalid params.-32603
: Internal error.Examples
Request:
Notification:
Possible Implementation
Versioning and Updates
This document describes version 1.0 of the API. Future updates and changes will be communicated as necessary.
The text was updated successfully, but these errors were encountered: