Using Custom Object Tokens
How to add custom object tokens to WhatsApp API templates.
Understanding the Custom Object Token
For this demonstration, a custom object was created for Products, responsible for storing the products or orders related to a lead. This object includes the fields: Description, First name, Unit Value and Order ID.
A lead custom object token is made up of a pair of braces, starting with customobj= followed by the custom object ID to which you want to refer. Then, use -> to point to the desired field alias within that object.
Example: {customobj=6->description}

Creating a Meta Template
For this token use case, a WhatsApp API Utility Template. In the template body, it is possible to insert various dynamic tokens, such as the lead's name and any values stored in custom objects.
At the time of sending, these tokens are automatically replaced with the corresponding data saved in the Lead.

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


Last updated
Was this helpful?