There are two types of messages when using WhatsApp for business communications. Depending on chat initiation and time frames, you will have to use these message types interchangeably.
- Templates - Pre-formatted and non-editable messages approved by WhatsApp
- Free-form - Standard free-flowing messages which support all media types
The message type you use depends on if you are messaging customers within the messaging window. Regulation dictates that you must stick to pre-approved message templates when messaging customers outside of this window.
These are standard messages which have been formatted to be reused when needing to stick to the same messaging, for example, a transactional notification.
You can do this by setting up standard message content, then replacing the would-be unique values with placeholders.
Templates then allow you to just send its identifier instead of the full message content. They are designed to reduce the likelihood of users perceiving them as spam on WhatsApp.
Templates can provide additional information over media included in the header, and can also be made interactive by registering buttons as part of the message content.
Templated messages sections include the following message types:
If you are going to use the WhatsApp Business API to send notifications, you must prepare and register your message templates to submit for approval. Message templates must comply with WhatsApp guidelines.
Make sure you are familiar with the template deliverability guidelines, as well as the limitations below.
Headers are optional and can include the following types of media:
- Text (up to 60 characters, can include 1 placeholder)
Body content is required and is a text field only. Bodies can contain up to 1024 characters and can be registered as plain text, or text with placeholders.
Footers are optional and are a text field only. Footers can contain up to 60 characters.
Buttons are optional and templates can only contain one or the other button type. Button text can be up to 20 characters. The following button types are available:
- Quick replies - You can have up to three quick reply buttons per message. Predefined replies and flexible payload.
- Call-to-action - You can have up to two call-to-action buttons per message one of each action. Supported actions are call a number and visit a website.
Use free-form messages to send various message types. Cut-off control prevents messages from being delivered to users out of certain conditions.
Regular text messages or media messages (i.e. any non-messages templates) can only be delivered within the first 24 hours since the customer last contacted your business. Message templates do not have this restriction and can be used if you need to contact customers outside of this window.
The following elements are available to send over WhatsApp, however, make sure to pay attention to element-specific limitations and supported options.
Send a message in the form of text to customers. You can send text in any of the following formats:
- Bold (*using asterisks*)
- Italic (_using underscores_)
- Strikethrough (~using tildes~)
- Code (```using three backticks```)
Messages can contain up to 4096 characters per free-form message. Text limitations vary on the relevant sections in templates. You can also include emojis in text messages
URL character counts are also included in message length limits. Make sure to keep text messages and URLs within the character limit. You also have the option to display URL previews in messages.
Send documents to customers. Documents should have names in the form of text, up to 240 characters. If no name is given, WhatsApp will assign one.
You can send the following document file types:
Document file sizes can be up to 100MB.
Send images to customers. You can also send messages in the form of an image and caption together. Image captions can be up to 3000 characters long.
The following image types are supported:
Image sizes can be up to 5MB.
Send audio messages to customers. The following audio types are supported:
Audio file sizes can be up to 16MB.
Send video messages to customers. You can also send messages in the form of a video and captions together. Video captions can be up to 3000 characters long.
The following video types are supported:
Video sizes can be up to 16MB.
Send stickers as messages to customers. There are a few formatting requirements to follow with stickers:
- WEBP files only
- Cannot exceed 100KB
- Must be 512x512px
- Must be 16px margin around sticker
- Must have transparent background
Animated stickers are not supported by WhatsApp.
Send a static location in the form of a message. Location messages are in the form of interactive maps.
Included in location messages are your:
- Longitude - Coordinates between -180 and 180
- Latitude - Coordinates between -90 and 90
- Location Name - Name of the location (optional)
- Address - Address of the location (optional)
Send a contact saved in your address book. This allows recipients to autosave contacts into their devices using a save button.
Contact messages consist of an array of contact-related objects. Each of those objects contains a further set of sub-objects.
High-level objects include:
See the API section of these docs for more information about contact objects.
Allow users to select from a list of up to 10 options to confirm a preference, e.g., a location for the service they are trying to find out more about.
Users will only be able to select one option at a time but can make more selections after sending the first.
List messages are made up of the following:
- Header - Text shown at the top of the list message (optional)
- Body - Message text content, up to 1024 characters
- Footer - Footer text content, up to 60 characters
- List title - List button text, up to 20 characters
- Section title - Not visible and used for reference (optional)
- Row titles - Single selection options accompanied by a radio button
- Row descriptions - Provide additional context to selectable options (optional)
Use interactive buttons to send end users up to three options to choose from as an automated response. This allows them quickly reply selecting from the options that you provide.
These work in the same way as quick replies in message templates, but are available for free-form messages. Users will only be able to select one option at a time per message but can change selection.
Quick reply messages are made up of the following:
- Header - Text up to 60 characters, or image, video, or document (optional)
- Body - Text up to 1024 characters
- Footer - Text only up to 20 characters (optional)
- Buttons - Up to 3 buttons, text only each containing up to 20 characters
Incoming messages are forwarded to you in real-time when you are using WhatsApp for two-way communication.
If you are forwarding messages to an API endpoint, you will need to grant permission to it for the Infobip platform. Connections can be secured with additional authorization headers.
Customers are able to send you the following WhatsApp components in messages:
- Interactive button reply
- Interactive list reply
- Other media
- Unsupported Files
Received media is accessible for up to 30 days. It can be deleted within this time via API.
Users can also quote messages to give context that they are directly replying to that message. When a message is swiped, it will be quoted and sent upon responding with its own quote ID.
Using WhatsApp over API you can also mark messages as read and delete media.