Message
JavaScript Message APIs
Send text message
sendTextMessage(roomId,body,txnId,callback)
roomId
: room idbody
: message content stringtxnId
(optional):transaction idcallback
(optional):
N/A
Send image
sendImageMessage(roomId,url,info,txnId,callback)
roomId
: room idurl
: image urlinfo
(optional): image informationtxnId
(optional):transaction idcallback
(optional):
N/A
Send notice
sendNotice(roomId,body,txnId,callback)
roomId
: room idbody
: notice text stringtxnId
(optional):transaction idcallback
(optional):
N/A
Get history message
createMessagesRequest(roomId, fromToken, limit, dir)
roomId
: room idfromToken
: Pagination identifier, pass an empty string for the first time, and pass the 'end' field returned from the previous call for subsequent calls.limit
: number of events per page returned by the backend API.dir
: direction, value is "b" | "f", where b: back, f: forward.
end
: pagination identifier, if not returned, indicates completion of retrieval.
chunk
: retrieved event data, returned as an array.
Last updated