Send a Message
To send the message to the user, use the below methods. Different messages such as text, image, audio, video & document type messages can be sent using the below methods.
Note: When you call the methods listed below, the messageListener callback will trigger based on the method you are calling.
#
Text Message#
Request ParamStatus | Description | Type | Required |
---|---|---|---|
TO_USER_JID | JID of the To User. username + "@" + xmppSocketHost | JID String | true |
MESSAGE_BODY | Text Message Body | String | true |
MESSAGE_ID | Text Message Id | String | true |
REPLY_TO | Specifies the Message ID of replied message (Optional) | String | false |
#
Response Format:#
Location Message#
Request ParamStatus | Description | Type | Required |
---|---|---|---|
TO_USER_JID | JID of the To User. username + "@" + xmppSocketHost | JID String | true |
LATITUDE | location latitude which needs to be sent | Number | true |
LONGITUDE | location longitude which needs to be sent | Number | true |
MESSAGE_ID | Location Message Id | String | false |
REPLY_TO | Specifies the Message ID of replied message (Optional) | String | false |
#
Response Format:#
Contact Message#
Request ParamStatus | Description | Type | Required |
---|---|---|---|
TO_USER_JID | JID of the To User. username + "@" + xmppSocketHost | JID String | true |
CONTACTS | list of numbers in that contact | Array of Object | true |
REPLY_TO | Specifies the Message ID of replied message (Optional) | String | false |
#
Response Format:#
Image Message#
Request Param toJid,Status | Description | Type | Required |
---|---|---|---|
TO_USER_JID | JID of the To User. username + "@" + xmppSocketHost | JID String | true |
IMAGE_FILE | Image File - Should be of type png, jpg, jpeg, svg & gif | Object | true |
FILE_OPTIONS | Image File Object | Object | true |
REPLY_TO | Specifies the Message ID of replied message (Optional) | String | true |
#
Response Format:#
Audio MessageMedia Message
Param | Description | Type | Required |
---|---|---|---|
TO_USER_JID | JID of the To User | JID String | true |
FILE_OPTIONS | File Message Params | Object | true |
AUDIO_FILE | Audio File - Should be of type mp3 , mpeg & wav | object | true |
REPLY_TO | Message ID of Original Message | String | false |
#
Response Format:#
Video MessageParam | Description | Type | Required |
---|---|---|---|
TO_USER_JID | JID of the To User | JID String | true |
FILE_OPTIONS | File Message Params | Object | true |
VIDEO_FILE | Video File - Should be of type mp4 | object | true |
REPLY_TO | Message ID of Original Message | String | false |
#
Response Format:#
Document MessageParam | Description | Type | Required |
---|---|---|---|
TO_USER_JID | JID of the To User | JID String | true |
FILE_OPTIONS | File Message Params | Object | true |
DOCUMENT_FILE | DOCUMENT_FILE - Accepted files are pdf , doc , xls , csv , ppt & txt | Object | true |
REPLY_TO | Message ID of Original Message | String | false |
#
Response Format:#
Download MediaThis method is used to get the media file url when we download the media.
#
Request ParamStatus | Description | Type | Required |
---|---|---|---|
fileToken | File Url | String | true |
#
Example Requests#
Response Format#
Send Reply Message#
Request ParamStatus | Description | Type | Required |
---|---|---|---|
TO_USER_JID | JID of the To User. username + "@" + xmppSocketHost | JID String | true |
MESSAGE_BODY | Text Message Body | String | true |
MESSAGE_ID | Text Message Id | String | true |
REPLY_TO | Message ID of Original Message | String | true |