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.
#
Text MessageParam | Description | Type | Required |
---|---|---|---|
toJid | JID of the To User | JID String | true |
messageText | Text Message Body | String | true |
mentionedUsersIds | Array of Group Mentioned UsersIds | Array of Strings | false |
#
Response Format:#
Image Messagecaution
If Image attachment feature is unavailable for your plan, then it will throw 403 exception
Param | Description | Type | Required |
---|---|---|---|
toJid | JID of the To User | JID String | true |
fileMessageParams | File Message Params | Object | true |
fileMessageParams.file | Image File - Should be of type png , jpg , jpeg , svg & gif | File | true |
fileMessageParams.thumbImage | Image File Thumb Image. When the value not given, SDK will generate thumb image for the given FILE. When using the fileUrl SDK won't generate the thumb image. | String | false |
fileMessageParams.fileSize | Image File Size. When the value not given, SDK will detect the size of the given FILE. When using the fileUrl SDK won't detect the size. | String | false |
fileMessageParams.fileName | Image File Name. When the value not given, SDK will detect the name of the given FILE. When using the fileUrl SDK won't detect the name. | String | false |
fileMessageParams.caption | Image Caption | String | false |
replyMessageId | Message ID of Original Message | String | false |
mentionedUsersIds | Array of Group Mentioned UsersIds | Array of Strings | false |
#
Response Format:#
Audio Messagecaution
If Audio attachment feature is unavailable for your plan, then it will throw 403 exception
Param | Description | Type | Required |
---|---|---|---|
toJid | JID of the To User | JID String | true |
fileMessageParams | File Message Params | Object | true |
fileMessageParams.file | Audio File - Should be of type mp3 , mpeg & wav | File | true |
fileMessageParams.fileSize | Audio File Size. When the value not given, SDK will detect the size of the given FILE. When using the fileUrl SDK won't detect the size. | String | false |
fileMessageParams.fileName | Audio File Name. When the value not given, SDK will detect the name of the given FILE. When using the fileUrl SDK won't detect the name. | String | false |
fileMessageParams.duration | Audio File Duration. When the value not given, SDK will detect the duration of the given FILE. When using the fileUrl SDK won't detect the duration. | String | false |
fileMessageParams.caption | Audio Caption | String | false |
replyMessageId | Message ID of Original Message | String | false |
mentionedUsersIds | Array of Group Mentioned UsersIds | Array of Strings | false |
#
Response Format:#
Video Messagecaution
If Video attachment feature is unavailable for your plan, then it will throw 403 exception
Param | Description | Type | Required |
---|---|---|---|
toJid | JID of the To User | JID String | true |
fileMessageParams | File Message Params | Object | true |
fileMessageParams.file | Video File - Should be of type mp4 | File | true |
fileMessageParams.fileSize | Video File Size. When the value not given, SDK will detect the size of the given FILE. When using the fileUrl SDK won't detect the size. | String | false |
fileMessageParams.fileName | Video File Name. When the value not given, SDK will detect the name of the given FILE. When using the fileUrl SDK won't detect the name. | String | false |
fileMessageParams.duration | Video File Duration. When the value not given, SDK will detect the duration of the given FILE. When using the fileUrl SDK won't detect the duration. | String | false |
fileMessageParams.thumbImage | Video File Thumb Image. When the value not given, SDK will generate thumb image for the given FILE. When using the fileUrl SDK won't generate the thumb image. | String | false |
fileMessageParams.caption | Video Caption | String | false |
replyMessageId | Message ID of Original Message | String | false |
mentionedUsersIds | Array of Group Mentioned UsersIds | Array of Strings | false |
#
Response Format:#
Document Messagecaution
If Document attachment feature is unavailable for your plan, then it will throw 403 exception
Param | Description | Type | Required |
---|---|---|---|
toJid | JID of the To User | JID String | true |
fileMessageParams | File Message Params | Object | true |
fileMessageParams.file | Document File - Accepted files are pdf , doc , xls , csv , ppt & txt | File | true |
fileMessageParams.fileSize | Document File Size. When the value not given, SDK will detect the size of the given FILE. When using the fileUrl SDK won't detect the size. | String | false |
fileMessageParams.fileName | Document File Name. When the value not given, SDK will detect the name of the given FILE. When using the fileUrl SDK won't detect the name. | String | false |
fileMessageParams.caption | Document Caption | String | false |
replyMessageId | Message ID of Original Message | String | false |
mentionedUsersIds | Array of Group Mentioned UsersIds | Array of Strings | 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 |
filekey | File key is optional param, which we get from the selected Media message Body | String | false |
#
Example Requests#
Response Format#
Send Reply MessageTo send a reply to the original message, we are using sendTextMessage by passing in the additional parameter original message-id.
#
Request ParamParam | Description | Type | Required |
---|---|---|---|
toJid | JID of the To User/Group | JID String | true |
messageText | Text Message Body | String | true |
replyMessageId | Message ID of Original Message | String | true |
mentionedUsersIds | Array of Group Mentioned UsersIds | Array | false |