Messages Endpoints
Last updated
Last updated
POST
/api/v0/get-user-dm-threads-ordered-by-timestamp
Get User Direct Message Threads Ordered by Timestamp returns an array of NewMessageEntryResponse objects for the public key provided in the request body. Each NewMessageEntryResponse object represents the most recent message each in DM conversation a user has. This is useful for showing a list of DM conversations in a user's inbox. The first NewMessageEntryResponse object is the most recent conversation and the last one is the old.
Additionally, a map of public key to objects for convenience so you don't need to make an extra request to get profile entry responses for the public keys in the response.
Endpoint implementation in backend.
Name | Type | Description |
---|---|---|
POST
/api/v0/get-paginated-messages-for-dm-thread
Get Paginated Messages For DM Thread returns an array of NewMessageEntryResponse objects based on the conversation defined in the request body. Each NewMessageEntryResponse object represent a message in the a DM conversation. This is useful for showing all messages in a conversation. This first NewMessageEntryResponse object is the most recent message and the last one is the oldest. This endpoint supports pagination.
Endpoint implementation in backend.
POST
/api/v0/get-user-group-chat-threads-ordered-by-timestamp
Get User Group Chat Threads Ordered by Timestamp returns an array of NewMessageEntryResponse objects for the public key provided in the request body. Each NewMessageEntryResponse object represents the most recent message each in a group chat a user has. This is useful for showing a list of group chats in a user's inbox. The first NewMessageEntryResponse object is the most recent conversation and the last one is the oldest.
Endpoint implementation in backend.
POST
/api/v0/get-paginated-messages-for-group-chat-thread
Get Paginated Messages For Group Chat Thread returns an array of NewMessageEntryResponse objects based on the group chat defined in the request body. Each NewMessageEntryResponse object represent a message in the group chat. This is useful for showing all messages in a conversation. This first NewMessageEntryResponse object is the most recent message and the last one is the oldest. This endpoint supports pagination.
Endpoint implementation in backend.
POST
/api/v0/get-all-user-message-threads
Get All User Message Threads Group returns an array of NewMessageEntryResponse objects for the public key provided in the request body. Each NewMessageEntryResponse object represents the most recent message each in a conversation (DM or group chat) a user has. This is useful for showing a list of all conversations in a user's inbox. The first NewMessageEntryResponse object is the most recent conversation and the last one is the oldest.
Endpoint implementation in backend.
Additionally, a map of public key to objects for convenience so you don't need to make an extra request to get profile entry responses for the public keys in the response.
Name | Type | Description |
---|---|---|
Additionally, a map of public key to objects for convenience so you don't need to make an extra request to get profile entry responses for the public keys in the response.
Name | Type | Description |
---|---|---|
Additionally, a map of public key to objects for convenience so you don't need to make an extra request to get profile entry responses for the public keys in the response.
Name | Type | Description |
---|---|---|
Additionally, a map of public key to objects for convenience so you don't need to make an extra request to get profile entry responses for the public keys in the response.
Name | Type | Description |
---|---|---|
UserGroupOwnerPublicKeyBase58Check*
String
Public key of one of the users in a DM conversation
UserGroupKeyName*
String
Access group key name of UserGroupOwnerPublicKeyBase58Check in the DM conversation
PartyGroupOwnerPublicKeyBase58Check*
String
Public key of the other user in a DM conversation
PartyGroupKeyName*
String
Access group key name of PartyGroupOwnerPublicKeyBase58Check in the DM conversation
StartTimestampString
String
String version of a timestamp in nanos. This defines the start point of the page. Messages newer than this timestamp are excluded.
To get the most recent (but not in the future) messages, set TimestampNanosString to (Date.now()*1e6).toString()
To get the next page of messages, take TimestampNanosString from the last NewMessageEntryResponse object in the previous page's response.
StartTimestamp
uint64
Timestamp in nanos. This is less preferred than passing StartTimestamp string as JSON encoding and decoding can lose precision on these values.
MaxMessagesToFetch
int
Maximum number of messages to fetch. You will always receive this amount of messages or fewer.
UserPublicKeyBase58Check*
String
Public key of the user for whom we want to fetch all DM conversations
UserPublicKeyBase58Check*
String
Public key of the access group owner who owns this group chat.
AccessGroupKeyName*
String
Name of the access group for which we want to fetch messages.
StartTimestampString
String
String version of a timestamp in nanos. This defines the start point of the page. Messages newer than this timestamp are included. To get the most recent messages of the conversation, pass the current timestamp in nanoseconds converted to a string (not formatted as a timestamp).
To get the most recent (but not in the future) messages, set TimestampNanosString to (Date.now()*1e6).toString()
To get the next page of messages, take TimestampNanosString from the last NewMessageEntryResponse object in the previous page's response.
StartTimestamp
uint64
Timestamp in nanos. This is less preferred than passing StartTimestamp string as JSON encoding and decoding can lose precision on these values.
MaxMessagesToFetch*
int
Maximum number of messages to fetch. You will always receive this amount of messages or fewer.
UserPublicKeyBase58Check*
String
Public key of the user for whom we want to fetch all conversations
UserPublicKeyBase58Check*
String
Public key of the user for whom we want to fetch all DM conversations