Message

JavaScript Message APIs

Send text message

NameParameters DescriptionResponse

sendTextMessage(roomId,body,txnId,callback)

  • roomId: room id

  • body: message content string

  • txnId (optional):transaction id

  • callback (optional):

N/A

Send image

NameParameters DescriptionResponse

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

NameParameters DescriptionResponse

sendNotice(roomId,body,txnId,callback)

  • roomId: room id

  • body: notice text string

  • txnId (optional):transaction id

  • callback (optional):

N/A

Get history message

NameParameters DescriptionResponse

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