ChatMessagesByToken: Nextcloud itgen_ncl_chatmessagesbytoken_plural
read only REST
- Catalog:
Spreed - Schema:
Spreed - Label: itgen_ncl_chatmessagesbytoken_plural
Receives chat messages from the given room
- Receiving the history ($lookIntoFuture=0): The next $limit messages after $lastKnownMessageId will be returned. The new $lastKnownMessageId for the follow up query is available as
X-Chat-Last-Givenheader. - Looking into the future ($lookIntoFuture=1): If there are currently no messages the response will not be sent immediately. Instead, HTTP connection will be kept open waiting for new messages to arrive and, when they do, then the response will be sent. The connection will not be kept open indefinitely, though; the number of seconds to wait for new messages to arrive can be set using the timeout parameter; the default timeout is 30 seconds, maximum timeout is 60 seconds. If the timeout ends a successful but empty response will be sent. If messages have been returned (status=200) the new $lastKnownMessageId for the follow up query is available as
X-Chat-Last-Givenheader. The limit specifies the maximum number of messages that will be returned, although the actual number of returned messages could be lower if some messages are not visible to the participant. Note that if none of the messages are visible to the participant the returned number of messages will be 0, yet the status will still be 200. Also note thatX-Chat-Last-Givenmay reference a message not visible and thus not returned, but it should be used nevertheless as the $lastKnownMessageId for the follow-up query.
Can only retrieve data.
Summary
- Receiving the history ($lookIntoFuture=0): The next $limit messages after $lastKnownMessageId will be returned. The new $lastKnownMessageId for the follow up query is available as
X-Chat-Last-Givenheader. - Looking into the future ($lookIntoFuture=1): If there are currently no messages the response will not be sent immediately. Instead, HTTP connection will be kept open waiting for new messages to arrive and, when they do, then the response will be sent. The connection will not be kept open indefinitely, though; the number of seconds to wait for new messages to arrive can be set using the timeout parameter; the default timeout is 30 seconds, maximum timeout is 60 seconds. If the timeout ends a successful but empty response will be sent. If messages have been returned (status=200) the new $lastKnownMessageId for the follow up query is available as
X-Chat-Last-Givenheader. The limit specifies the maximum number of messages that will be returned, although the actual number of returned messages could be lower if some messages are not visible to the participant. Note that if none of the messages are visible to the participant the returned number of messages will be 0, yet the status will still be 200. Also note thatX-Chat-Last-Givenmay reference a message not visible and thus not returned, but it should be used nevertheless as the $lastKnownMessageId for the follow-up query.
API Source
- Endpoint:
/ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token} - Operation:
get /ocs/v2.php/apps/spreed/api/{apiVersion}/chat/{token}
Performance Characteristics
| Characteristic | Value |
|---|---|
| Average access latency (ms) | 319 |
| Full scan rows per minute | 1,380 |
The result can be cached on the client.
Parameters
| Name | Data Type | Required | Default | Documentation |
|---|---|---|---|---|
api |
`` | v1 | Values: v1. | |
include |
`` | Include the $lastKnownMessageId in the messages when 1 (default 0) (Values: 0, 1) | ||
last |
`` | The last known common read message (so the response is 200 instead of 304 when it changes even when there are no messages) | ||
last |
`` | The last known message (serves as offset) | ||
limit |
`` | Number of chat messages to receive (100 by default, 200 at most) | ||
look |
`` | Polling for new messages (1) or getting the history of the chat (0) (Values: 0, 1) | ||
mark |
`` | Set to 0 when notifications should not be marked as read (default 1) (Values: 0, 1) | ||
no |
`` | When the user status should not be automatically set to online set to 1 (default 0) (Values: 0, 1) | ||
set |
`` | Automatically set the last read marker when 1, if your client does this itself via chat//read set to 0 (Values: 0, 1) | ||
thread |
`` | Limit the chat message list to a given thread | ||
timeout |
`` | Number of seconds to wait for new messages (30 by default, 30 at most) | ||
token |
`` | |||
x- |
`` | Set to 1 when the request is performed by another Nextcloud Server to indicate a federation request |
Table Columns
The columns of the table ChatMessagesByToken are shown below. Each column has an SQL data type. A new non-null value must be provided for every required column at all times during insert and update.
| Name | Data Type | Label | Required | Marks | Documentation |
|---|---|---|---|---|---|
actor |
varchar2 |
itgen_ncl_actordisplayname | filters on the platform, writable, actor |
||
actor |
varchar2 |
itgen_ncl_actorid | filters on the platform, writable, actor |
||
actor |
varchar2 |
itgen_ncl_actortype | filters on the platform, writable, actor |
||
deleted |
char |
itgen_ncl_deleted | filters on the platform, writable, deleted |
||
expiration |
int64 |
itgen_ncl_expirationtimestamp | filters on the platform, writable, expiration |
||
id |
int64 |
itgen_ncl_id | filters on the platform, writable, id |
||
is |
char |
itgen_ncl_isreplyable | filters on the platform, writable, is |
||
is |
char |
itgen_ncl_isthread | filters on the platform, writable, is |
||
last |
varchar2 |
itgen_ncl_lasteditactordisplayname | filters on the platform, writable, last |
||
last |
varchar2 |
itgen_ncl_lasteditactorid | filters on the platform, writable, last |
||
last |
varchar2 |
itgen_ncl_lasteditactortype | filters on the platform, writable, last |
||
last |
int64 |
itgen_ncl_lastedittimestamp | filters on the platform, writable, last |
||
markdown |
char |
itgen_ncl_markdown | filters on the platform, writable, markdown |
||
message |
varchar2 |
itgen_ncl_message | filters on the platform, writable, message |
||
message |
varchar2 |
itgen_ncl_messageparameters | writable | The JSON text of the nested object. | |
message |
varchar2 |
itgen_ncl_messagetype | filters on the platform, writable, message |
||
meta |
varchar2 |
itgen_ncl_metadata_pinnedactordisplayname | filters on the platform, writable, meta |
Display name of the attendee that pinned the message - Required capability: pinned- |
|
meta |
varchar2 |
itgen_ncl_metadata_pinnedactorid | filters on the platform, writable, meta |
Actor ID of the attendee that pinned the message - Required capability: pinned- |
|
meta |
varchar2 |
itgen_ncl_metadata_pinnedactortype | filters on the platform, writable, meta |
Actor type of the attendee that pinned the message - Required capability: pinned- |
|
meta |
int64 |
itgen_ncl_metadata_pinnedat | filters on the platform, writable, meta |
Timestamp when the message was pinned - Required capability: pinned- |
|
meta |
int64 |
itgen_ncl_metadata_pinneduntil | filters on the platform, writable, meta |
Timestamp until when the message is pinned. If missing the message is pinned infinitely - Required capability: pinned- |
|
meta |
int64 |
itgen_ncl_metadata_threadid | filters on the platform, writable, meta |
Set when a thread is created with this message. If missing, no thread creation is associated with this message | |
meta |
varchar2 |
itgen_ncl_metadata_threadtitle | filters on the platform, writable, meta |
Set when a thread is created with this message. If missing, no thread creation is associated with this message | |
reactions |
varchar2 |
itgen_ncl_reactions | writable | The JSON text of the nested object. | |
reference |
varchar2 |
itgen_ncl_referenceid | filters on the platform, writable, reference |
||
silent |
char |
itgen_ncl_silent | filters on the platform, writable, silent |
||
system |
varchar2 |
itgen_ncl_systemmessage | filters on the platform, writable, system |
||
thread |
int64 |
itgen_ncl_threadid | filters on the platform, writable, thread |
||
thread |
int64 |
itgen_ncl_threadreplies | filters on the platform, writable, thread |
||
thread |
varchar2 |
itgen_ncl_threadtitle | filters on the platform, writable, thread |
||
timestamp |
int64 |
itgen_ncl_timestamp | filters on the platform, writable, timestamp |
||
token |
varchar2 |
itgen_ncl_token | filters on the platform, writable, token |