Using Custom Object Tokens

How to add custom object tokens in WhatsApp API templates.

Understanding the Custom Object Token

For this demonstration, a custom object of Products, responsible for storing products or orders related to a lead, was created. This object includes the fields: Description, First name, Unit Value and Order ID.

A lead custom object token is formed by a pair of braces, starting with customobj= followed by the ID of the custom object you want to refer to. Then, use -> to point to the alias of the desired field within that object.

Example: {customobj=6->descricao}

Custom object Products.
circle-info

The values used by the tokens always correspond to the most recently saved custom object. In other words, if there are multiple objects, the last registered one will be considered.

Creating a Meta Template

For this token use case, a WhatsApp API Utility Template. In the body of the template, you can insert several dynamic tokens, such as the lead's name and any values stored in custom objects.

At send time, these tokens are automatically replaced with the corresponding data saved on the Lead.

Template creation.

Testing the Template Send

Below you can see two screenshots: the first shows how the message appears in the conversation, with the tokens already replaced by real values. The second displays all custom product objects linked to the lead, highlighting the most recent one — which is used when sending the message.

Conversation with template send.
Custom Product objects.

Last updated

Was this helpful?