Objective
Sending messages using advanced templates with the Messages API custom object.
Applies To
- Messages API
- Custom Object
Procedure
To send using more advanced WhatsApp Templates, like WhatsApp Media Message Templates or templates using a link style button, you will need to use the Messages API custom object. The custom object takes a partial section of the original WhatsApp API request and sends it directly through to WhatsApp. In our developer documentation, we provide examples of how you can do this. Something to be aware of is that WhatsApp has slightly different parameter validation than the native Vonage API. Therefore, your parameter variables may have to be different. This can cause message failures. To prevent this, we're keeping a list of the differences which may be missed below.
When stating the language code for a template in a request body in our native API you would use a hyphen to link the language and country ("en-GB" for example). However, when using the custom object, an underscore should be used instead of a hyphen to link the language and country. Therefore, in your request "en-GB" would instead be "en_GB".
"whatsapp": { "policy": "deterministic", "locale": "en-GB" }
So the above example would become the following when using the custom object.
"language": { "policy": "deterministic", "code": "en_GB" }
Also, URL is changed to link.
"image": { "url": "'$IMAGE_URL'", "caption": "'$IMAGE_CAPTION'" }
So the above example would become the following when using the custom object.
"image": { "link": "'$HEADER_IMAGE_URL'" }
Additional Information
For more information, see our developer documentation on sending a WhatsApp Media Message Template.
Articles in this section
- WhatsApp Per User Marketing Template Messaging Limits
- Why did I receive rejected status delivery receipts although my WhatsApp messages were delivered to enduser?
- WhatsApp Quality Rating and Messaging Limits
- WhatsApp Platform: Phone Number Limits
- WhatsApp Business Platform Policy Enforcement: Review and Appeal Process for WhatsApp Disabled Account
- WhatsApp Local Data Storage
- Why am I receiving an error "We could not set up your number for the selected API key. Please try a different API key"
- WhatsApp One WABA Policy Enforcement Jan 2024
- WhatsApp Authentication Template Compliance May 2024
- Error code 1022 Template name does not exist in the translation