WhatsAppSending messages Message Types To properly select your message type, you should first identify the format that best suits your needs. Subsequently, you can choose from different types of messages and fill in your body type params.
Before sending messages, you must select your message type from a large number of formats to take the most accurate option for your goal. It can be text, audio, an image, etc.
1. Text
A text message type
is a message that is sent as plain text.
Argument
Description
Required
This field will store the message to be sent to the client.
Sample API request
cURL Javascript
Copy # Send a text message to a specific user.
curl -X "POST" "https://api.jelou.ai/v1/whatsapp/messages" \
-H 'Content-Type: application/json' \
-u '<clientId>:<clientSecret>' \
-d $'{
"text": "<message>",
"userId": "<userId>",
"botId": "<botId>",
"type": "text"
}'
Copy axios({
"method": "POST",
"url": "https://api.jelou.ai/v1/whatsapp/messages",
"headers": {
"Content-Type": "application/json"
},
"auth": {
"username": "<clientId>",
"password": "<clientSecret>"
},
"data": {
"text": "<message>",
"userId": "<userId>",
"botId": "<botId>",
"type": "text"
}
})
2. Text with Options
A text message type with options
is a message that is sent as a plaint text with several options buttons to select.
Argument
Description
Required
This field store the message to be sent to the client.
This field stores buttons sections of the message
This field stores the Title to be send on top the the text message
This field stores the configuration of the Main Button for display
This field stores the type of the bubble display for options
Yes (if buttonText field included)
This field stores the text to display on Main Button.
Default Value: "Opciones"
Yes (if buttonText field included)
This field stores all the options to send.
This field stores the Title to send in option.
buttons.options.*.description
This field stores the description to be send for each option.
buttons.options.*.payload
This field stores the text to send back to the webhook when User press this option.
buttons.options -> Minimum of 1 and maximum of 10 options.
buttons.title -> Maximum of 60 characters.
options.title -> Maximum length: 24 characters.
options.description -> Optional . Maximum length: 72 characters.
options.payload -> Optional.
Sample API request
cURL Javascript
Copy # Send a text message to a specific user.
curl -X "POST" "https://api.jelou.ai/v1/whatsapp/messages" \
-H 'Content-Type: application/json' \
-u '<clientId>:<clientSecret>' \
-d $'{
"text": "<message>",
"userId": "<userId>",
"botId": "<botId>",
"type": "text",
"buttons": {
"title": "<Main Title>",
"buttonText": {
"type": "text",
"text": "<Main Button Text>"
},
"options": [
{
"title": "<BTN Title #1>",
"description": "<BTN Description #1>",
"payload": "<Post_Back_Text_1>"
},
{
"title": "<BTN Title #2>",
"description": "<BTN Description #1>",
"payload": "<Post_Back_Text_2>"
}
]
},
}'
Copy axios({
method: "POST",
url: "https://api.jelou.ai/v1/whatsapp/messages",
headers: {
"Content-Type": "application/json",
},
auth: {
username: "<clientId>",
password: "<clientSecret>",
},
data: {
text: "<message>",
userId: "<userId>",
botId: "<botId>",
type: "text",
buttons: {
title: "<Main Title>",
buttonText: {
type: "text",
text: "<Main Button Text>",
},
options: [
{
title: "<BTN Title #1>",
description: "<BTN Description #1>",
payload: "<Post_Back_Text_1>",
},
{
title: "<BTN Title #2>",
description: "<BTN Description #1>",
payload: "<Post_Back_Text_2>",
},
],
},
},
});
3. Image
A image message type
is a message that is sent with an image and text.
Argument
Description
Required
This field will store the image URL to be sent in the message.
This field will store the message that goes next to the image.
Sample API request
cURL Javascript
Copy ## Send Image
# Send an image to a specific user.
curl -X "POST" "https://api.jelou.ai/v1/whatsapp/messages" \
-H 'Content-Type: application/json' \
-u '<clientId>:<clientSecret>' \
-d $'{
"text": "<message>",
"mediaUrl": "<mediaUrl>",
"userId": "<userId>",
"botId": "<botId>",
"type": "image"
}'
Copy axios({
"method": "POST",
"url": "https://api.jelou.ai/v1/whatsapp/messages",
"headers": {
"Content-Type": "application/json"
},
"auth": {
"username": "<clientId>",
"password": "<clientSecret>"
},
"data": {
"text": "<message>",
"mediaUrl": "<mediaUrl>",
"userId": "<userId>",
"botId": "<botId>",
"type": "image"
}
})
4. Audio
A audio message type
is a message that is sent as an audio.
Argument
Description
Requires
This field will store the file URL to be sent in the message
Sample API request
cURL Javascript
Copy ## Send Audio
# send a text message to a specific user.
curl -X "POST" "https://api.jelou.ai/v1/whatsapp/messages" \
-H 'Content-Type: application/json' \
-u '<clientId>:<clientSecret>' \
-d $'{
"mediaUrl": "<mediaUrl>",
"userId": "<userId>",
"botId": "<botId>",
"type": "audio"
}'
Copy axios({
"method": "POST",
"url": "https://api.jelou.ai/v1/whatsapp/messages",
"headers": {
"Content-Type": "application/json"
},
"auth": {
"username": "<clientId>",
"password": "<clientSecret>"
},
"data": {
"mediaUrl": "<mediaUrl>",
"userId": "<userId>",
"botId": "<botId>",
"type": "audio"
}
})
5. Video
A video message type
is a message that is sent as an video.
Argument
Description
Required
This field will store the file URL to be sent in the message
This field will store the message that goes next to the video.
Sample API request
cURL
Copy ## Send Video
# Send a video to a specific user.
curl -X "POST" "https://api.jelou.ai/v1/whatsapp/messages" \
-H 'Content-Type: application/json' \
-u 'clientId:clientSecret' \
-d $'{
"mediaUrl": "<mediaUrl>",
"text": "<message>",
"userId": "<userId>",
"botId": "<botId>",
"type": "video"
}'
6. File
A file message type
is a message that is sent with a file and text.
Argument
Description
Required
This field will store the file URL to be sent in the message
This field will store the message that goes next to the image.
Sample API request
cURL javascript
Copy ## Send File
# Send a file to a specific user.
curl -X "POST" "https://api.jelou.ai/v1/whatsapp/messages" \
-H 'Content-Type: application/json' \
-u 'clientId:clientSecret' \
-d $'{
"mediaUrl": "<mediaUrl>",
"userId": "<userId>",
"botId": "<botId>",
"type": "file"
}'
Copy axios({
"method": "POST",
"url": "https://api.jelou.ai/v1/whatsapp/messages",
"headers": {
"Content-Type": "application/json"
},
"auth": {
"username": "<clientId>",
"password": "<clientSecret>"
},
"data": {
"text": "<message>",
"mediaUrl": "<mediaUrl>",
"userId": "<userId>",
"botId": "<botId>",
"type": "file"
}
})
7. Sticker
A sticker message type
is a message that is sent with a sticker.
Argument
Description
Required
This field will store the file URL to be sent in the message
cURL
Copy ## Send Sticker
curl -X "POST" "https://api.jelou.ai/v1/whatsapp/messages" \
-H 'Content-Type: application/json' \
-u 'clientId:clientSecret' \
-d $'{
"mediaUrl": "<mediaUrl>",
"userId": "<userId>",
"botId": "<botId>",
"type": "sticker"
}'
8. Location
A location type message
is a message that is sent with a specific location.
Argument
Description
Required
This field will store the object that will contain the location's latitude and longitude.
This field will store the latitude's location.(Double)
This field will store the longitude's location.(Double)
Sample API request
cURL Javascript
Copy ## Send Location
# Send a location to a specific user.
curl -X "POST" "https://api.jelou.ai/v1/whatsapp/messages" \
-H 'Content-Type: application/json' \
-u '<clientId>:<clientSecret>' \
-d $'{
"coordinates": {
"lat": <latitude>,
"long": <longitude>
},
"userId": "<userId>",
"botId": "<botId>",
"type": "location"
}'
Copy axios({
"method": "POST",
"url": "https://api.jelou.ai/v1/whatsapp/messages",
"headers": {
"Content-Type": "application/json"
},
"auth": {
"username": "<clientId>",
"password": "<clientSecret>"
},
"data": {
"coordinates": {
"lat": <latitude>,
"long": <longitude>
},
"userId": "<userId>",
"botId": "<botId>",
"type": "location"
}
})
9. Quick Replies
A quick_reply message type
to offer a quicker way for users to make a selection from a menu when interacting with a business
Argument
Description
Required
This field store the message to be sent to the client.
This field stores the text of the title of the message.
This field stores quick replies buttons.
This field stores the text of the quick reply button.
quick_replies -> Minimum of 1 and maximum of 3 buttons.
title -> Optional . Maximum length: 20 characters.
quick_replies.*.title -> It cannot be an empty string and it must be unique within the message. Maximum of 20 characters. Does not allow emojis or markdowns.
Sample API request
cURL Javascript
Copy ## Send Quick Reply
# Send a Quick reply message to a specific user.
curl -X "POST" "https://api.jelou.ai/v1/whatsapp/messages" \
-H 'Content-Type: application/json' \
-u '<clientId>:<clientSecret>' \
-d $'{
"text": "<message>",
"title": "<Title of message>",
"quick_replies": [
{
"title": "<BUTTON_TITLE_1>"
},
{
"title": "<BUTTON_TITLE_2>"
},
{
"title": "<BUTTON_TITLE_3>"
}
],
"userId": "<userId>",
"botId": "<botId>",
"type": "quick_reply"
}'
Copy axios({
method: "POST",
url: "https://api.jelou.ai/v1/whatsapp/messages",
headers: {
"Content-Type": "application/json",
},
auth: {
username: "<clientId>",
password: "<clientSecret>",
},
data: {
text: "<message>",
title: "<Title of message>",
quick_replies: [
{
title: "<BUTTON_TITLE_1>",
},
{
title: "<BUTTON_TITLE_2>",
},
{
title: "<BUTTON_TITLE_3>",
},
],
userId: "<userId>",
botId: "<botId>",
type: "quick_reply",
},
})
Supported Media Types
Media
Supported Types
Size Limit
audio/aac, audio/mp4, audio/mpeg, audio/amr, audio/ogg (only opus codecs, base audio/ogg is not supported)
text/plain, application/pdf, application/vnd.ms-powerpoint, application/msword, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Last updated 10 months ago