Prerequisites
- A Voucherify campaign with codes to publish
- A Braze campaign or Canvas
- Voucherify API credentials (App ID and App Token)
The script example below includes optimization parameters like caching and retry. This tutorial focuses on the essential Voucherify-specific parts.Read Optimize your Connected Content scripts for details on each optimization parameter.
Display fetched data in Braze messages
Use the following steps to display the data fetched from Voucherify in Braze messages.Add connected content script to message template
Copy and paste the Connected Content script under the
<body> tag in a message HTML template.Connected content publication script
Set up necessary Voucherify API details
Add from Voucherify:
campaign_idcopied from the campaign details view in the Voucherify dashboard (line 4).- Your API endpoint. You can check it in Project settings > General > API endpoint (line 8).
- Add publications address
/v1/publicationsand the API method (lines 8-9). Don’t remove?cache_id={{cache_id}}, as it reduces the number of API calls. - Add your API credentials for authentication (lines 11-12).
Connected content publication script
Create snippet to display fetched data
Responses from the Voucherify API are stored by connected content under the value of This enables you to retrieve and display data from a Voucherify response in Braze messages.
:save parameter. For example, :save publication in line 18.Connected content publication script
Display fetched data in messages
To display the published code in a message template, create a snippet that fetches a unique code from the voucher object:Each customer will get a message with a unique code automatically assigned to their profile. Each time the user receives a code, it is published to their profile in Voucherify.
Set up rate limiter
When setting up a campaign target, use advanced settings to limit the number of messages sent per minute.Rate limits protect your API quota during testing and live traffic. Uncontrolled sending can exhaust code pools or exceed API limits.Read more about rate limiting and frequency capping in Braze documentation.
retry attribute.
In Voucherify, go to Audit logs to check if Braze called the API successfully.
Next steps
Visit the following pages to achieve more with Voucherify and Braze Connected Content:- Optimize your Connected Content scripts — Configure caching and retry mechanisms
- Connected Content script reference — View all script templates

