Server will emit this socket event when a message sent with MESSAGE_SEND was not successful. (The payload is the one that was sent).

Payload Parameters

NameDescriptionJSON type
categoryType of message to send, can be: 'chat'string
content
  • bodyText: message text to send
  • data: array of objects representing attached files
    • fileId: (string) fileKey from /files/getuploadurl
    • fileSize: (int) size of file in bytes
    • fileType: (string) 'image', 'video', 'audio', or (default) 'document'
    • name: (string) file name
    • provider: (string) 'native'
    • providerFileType: (string) MIME type
    • thumbnailFile: (string) fileKey of thumbnail from /files/getuploadurl
  • description: (string) message description. Not used
Object
createdTimestamp of when user initiated send.string
sender
  • type: what type of sender ('user' or 'anonymous')
  • _id: unique identifier of sender
Object
topicIdUnique identifier of topic to send message to. Note: Direct messages are sent to a topic with only 2 members. To retrieve the topicId for a direct message see /spaces/direct/{userType}/{userId}.string

Authorization

Sender of SEND_MESSAGE.

Example

socketConnection.on('SEND_MESSAGE_FAILED', callback(payload));

Payload

{
  "category": "chat",
  "content": {
      "bodyText": "this is the message.",
      "data": [
        {
            "fileId": "9ec91803-9a64-4294-aaa0-a171bd57e304",
            "fileSize": 32553,
            "fileType": "image",
            "name": "sample-1.jpg",
            "provider": "native",
            "providerFileType": "image/jpeg",
            "thumbnailFile": "44e4e7ef-bae7-4605-b9df-485b880dd1b2"
        }
      ]
  },
  "created": "2017-06-26T18:09:55.839Z",
  "sender": {
      "type": "user",
      "_id": "593989c06f0e166d93fab8ab"
  },
  "topicId": "594140a11d108619100a7360"
}