Making an API Call

Messages sent by Braze can retrieve content from a web server to be included in a message by using the {% connected_content %} tag. For example, the following message body will access the url and include a fun trivia fact in your message:

Hi there, here is fun some trivia for you!: {% connected_content %}

You can also include user profile attributes as variables in the URL string when making Connected Content requests. As an example, you may have a web service that returns content based on a user’s email address and ID. If you’re passing attributes containing special characters, such as @, make sure to use the Liquid filter url_param_escape to replace any characters not allowed in URLs with their URL-friendly escaped versions, as shown in the e-mail address attribute below.

Hi, here are some articles that you might find interesting:

{% connected_content{{${email_address} | url_param_escape}}&user_id={{${user_id}}} %}

If the URL is unavailable, Braze will render an empty string in its place. Because Braze delivers messages at a very fast rate, be sure that your server can handle thousands of concurrent connections so we do not overload your server when pulling down content. When using public APIs, ensure your usage will not violate any rate-limiting that the API provider may employ. Braze requires that server response time is less than 2 seconds for performance reasons; if the server takes longer than 2 seconds to respond, the content will not be inserted.

If the endpoint returns JSON, you can detect that by checking if the connected value is null, and then conditionally abort the message. Braze only allows URLs that communicate over port 80 (HTTP) and 443 (HTTPS).

Attribute values must be surrounded by ${} in order to operate properly within Braze’s version of Liquid Syntax.

Connected Content calls do not follow redirects.

Braze’s systems may make the same Connected Content API call more than once per recipient. That is because Braze may need to make a Connected Content API call to render a message payload, and message payloads can be rendered multiple times per recipient for the purposes of validation, retry logic, or other internal purposes. Your systems should be able to tolerate the same Connected Content call being made more than one time per recipient.

Using Basic Authentication

If the URL requires basic authentication, Braze can generate a basic authentication credential for you to use in your API call. In the Connected Content tab in Manage App Group, you can manage existing basic authentication credentials and add new ones.

Basic Authentication Credential Management

To add a new credential, click Add Credential. You can then name your credential and put in the username and password.

Basic Authentication Credential Creation

You can then use this basic authentication credential in your API calls by referencing the token’s name:

Hi there, here is fun some trivia for you!: {% connected_content :basic_auth credential_name %}

If you delete a credential, keep in mind that any Connected Content calls trying to use it will be aborted.

Connected Content IP Whitelisting

When a message using Connected Content is sent from Braze, the Braze servers automatically make network requests to our customers’ or third parties’ servers to pull back data.

With IP whitelisting, you can verify that Connected Content requests are actually coming from Braze, adding an additional layer of security.

Braze will send Connected Content requests from the IP ranges below.

For Instances US-01, US-02, US-03, US-04, US-06 and US-08:
For Instance EU-01:
New Stuff!