Message

JavaScript Message APIs

Send text message

Name
Parameters Description
Response

sendTextMessage(roomId,body,txnId,callback)

  • roomId: room id

  • body: message content string

  • txnId (optional):transaction id

  • callback (optional):

N/A

Send image

Name
Parameters Description
Response

sendImageMessage(roomId,url,info,txnId,callback)

  • roomId: room id

  • url: image url

  • info (optional): image information

  • txnId (optional):transaction id

  • callback (optional):

N/A

Send notice

Name
Parameters Description
Response

sendNotice(roomId,body,txnId,callback)

  • roomId: room id

  • body: notice text string

  • txnId (optional):transaction id

  • callback (optional):

N/A

Get history message

Name
Parameters Description
Response

createMessagesRequest(roomId, fromToken, limit, dir)

  • roomId: room id

  • fromToken: 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