Braze
Table of Contents
Braze integrationStep 1Step 2Step 3Step 4Notes and external linksIdempotent requestsRate limitingBraze integration
Use the following as an addendum to the Braze integration documentation for using Lob with Braze.
Step 1
Add Custom Attributes for user mailing address information:
- address_line1
- address_line2
- address_city
- address_state
- address_zip
- address_country
Step 2
Update user profiles with mailing addresses.
Anything highlighted is a custom variable that will need to be updated for each customer or use case.
curl -X POST \ https://rest.iad-01.braze.com/users/track \ -H 'Content-Type: application/json' \ -d '{ "api_key": "Braze_API_Key", "attributes": [ { "external_id" : "10142019", "address_line1" : "185 BERRY ST STE 6100", "address_line2" : null, "address_city" : "SAN FRANCISCO", "address_state" : "CA", "address_zip" : "94107-1741", "address_country" : "UNITED STATES" } ] }'
Step 3
Create webhook template:
Example postcard
Compose tab:
Webhook URL: https://api.lob.com/v1/postcards
Request body: Raw Text
Note: Braze's default webhook template does not include the opening and closing {} brackets, so ensure those have been added before saving.
{ "description" : "{{campaign.${name}}}", "metadata" : { "campaign" : "{{campaign.${name}}}" }, "to" : { "name" : "{{${first_name}}} {{${last_name}}}", "address_line1" : "{{custom_attribute.${address_line1}}}", "address_line2" : "{{custom_attribute.${address_line2}}}", "address_city" : "{{custom_attribute.${address_city}}}", "address_state" : "{{custom_attribute.${address_state}}}", "address_zip" : "{{custom_attribute.${address_zip}}}" }, "from" : "adr_2066448bdef840f1", "front" : "tmpl_8b3b1249ede0406", "back" : "tmpl_d69077c7be7bd09", "merge_variables" : { "name" : "{{${first_name}}}" } }
Settings tab:
Be sure to leave the : after the Lob API key you paste in between the apostrophes.
REQUEST HEADERS:
- Authorization: Basic {{ 'YOUR_LOB_API_KEY:' | base64_encode }}
- Content-Type: application/json
- Idempotency-Key: {{${user_id}}}
HTTP METHOD: POST
Step 4
Test your new Webhook template and check your Lob dashboard to ensure desired results.
Notes and external links
Idempotent requests
Rate limiting
- By default, all accounts and their corresponding Test and Live API Keys have a rate limit of 150 requests per 5 seconds per endpoint
- https://docs.lob.com/#rate-limits
- https://www.braze.com/docs/user_guide/engagement_tools/campaigns/testing_and_more/rate-limiting/#delivery-speed-rate-limiting