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

text

This field will store the message to be sent to the client.

Yes

Sample API request

# 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"
}'

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

text

This field store the message to be sent to the client.

Yes

buttons

This field stores buttons sections of the message

Yes

buttons.title

This field stores the Title to be send on top the the text message

No

buttons.buttonText

This field stores the configuration of the Main Button for display

No

buttons.buttonText.type

This field stores the type of the bubble display for options

Yes (if buttonText field included)

buttons.buttonText.text

This field stores the text to display on Main Button. Default Value: "Opciones"

Yes (if buttonText field included)

buttons.options

This field stores all the options to send.

Yes

buttons.options.*.title

This field stores the Title to send in option.

Yes

buttons.options.*.description

This field stores the description to be send for each option.

No

buttons.options.*.payload

This field stores the text to send back to the webhook when User press this option.

No

  • 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

# 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>"
			}
		]
	},
}' 

3. Image

A image message type is a message that is sent with an image and text.

Argument
Description
Required

mediaUrl

This field will store the image URL to be sent in the message.

Yes

text

This field will store the message that goes next to the image.

No

Sample API request

## 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"
}'

4. Audio

A audio message type is a message that is sent as an audio.

Argument
Description
Requires

mediaUrl

This field will store the file URL to be sent in the message

Yes

Sample API request

## 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"
}'

5. Video

A video message type is a message that is sent as an video.

Argument
Description
Required

mediaUrl

This field will store the file URL to be sent in the message

Yes

text

This field will store the message that goes next to the video.

No

Sample API request

## 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

mediaUrl

This field will store the file URL to be sent in the message

Yes

text

This field will store the message that goes next to the image.

No

Sample API request

## 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"
}'

7. Sticker

A sticker message type is a message that is sent with a sticker.

Argument
Description
Required

mediaUrl

This field will store the file URL to be sent in the message

Yes

## 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

coordinates

This field will store the object that will contain the location's latitude and longitude.

Yes

coordinates.lat

This field will store the latitude's location.(Double)

Yes

coordinates.long

This field will store the longitude's location.(Double)

Yes

Sample API request

## 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"
}'

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

text

This field store the message to be sent to the client.

Yes

title

This field stores the text of the title of the message.

No

quick_replies

This field stores quick replies buttons.

Yes

quick_replies.*.title

This field stores the text of the quick reply button.

Yes

  • 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

## 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"
}'

Supported Media Types

Media
Supported Types
Size Limit

audio

audio/aac, audio/mp4, audio/mpeg, audio/amr, audio/ogg (only opus codecs, base audio/ogg is not supported)

16MB

file

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

100MB

image

image/jpeg, image/png

5MB

video

video/mp4, video/3gp

16MB

sticker

image/webp

100KB

Last updated