Direct Message APIs
1. Overview
Send direct messages from outbound service. This api used below parameters to send message to devices.
adapterId: Id of adapter added for provider & channel Eg. Gupshup-Whatsapp/Netcore-Whatsapp etc.
to.userID: Phone number of user
to.deviceType: device type of user Eg. PHONE
to.meta.fcmToken: FCM token of user for firebase notifications. It is required for firebase notifications.
payload.text: **** Text to be sent to user
payload.media.url: URL of image to be sent to user (In case of media messages)
payload.media.category: category of media Eg. IMAGE_URL. Available categories: IMAGE_URL, AUDIO_URL, VIDEO_URL, DOCUMENT_URL_
payload.media.caption: Caption to be sent with media file
This API will give you response in below format. If the api returns a succes response, it will include a message id in result.
Below are some curl requests for sending messages.
2. APIs
2.1 Netcore Whatsapp Message
Send text message to whatsapp number
Send media message to whatsapp number
2.2 Gupshup Whatsapp Message
Send text message to whatsapp number
Send media message to whatsapp number
2.3 Firebase Web Message
Send message to device
The data field of the payload contains all the data that the backend might want to send to the user along with the message.
Note: Param fcmClickActionUrl is being used to mention the url to open on click ot fcm notification. This url should have the same domain as the one on which the fcm tokens are registered, else the url will not work.
2.4 Gupshup SMS
Send message to phone
2.4 CDAC SMS
Send message to phone
For sending message to phone number via CDAC, a templateId which is approved by CDAC is required and the payload text should have content of this template body.
Last updated