Back to Top

Salesforce Marketing Cloud: API Entry in Journey Builder

Updated 25 October 2024

If you’ve ever wondered how to trigger personalized, automated customer journeys in Salesforce Marketing Cloud based on real-time actions from external systems, it’s due to Journey Builder API Events.

These powerful tools allow businesses to create personalized marketing experiences, triggering customer journeys based on external data like purchases, signups, or app interactions.

In this blog, we’ll break down everything you need to know about Salesforce Marketing Cloud Journey Builder API Events in a simple and easy-to-understand way.

What Are API Events in Journey Builder?

In Salesforce Marketing Cloud (SFMC), Journey Builder helps you create multi-step, automated customer journeys.

API Events enable you to trigger these journeys based on data from external systems, such as a CRM, website, or e-commerce platform.

Searching for an experienced
Salesforce Company ?
Find out More

When a customer buys a product on your site, an API Event can instantly add them to a journey, triggering personalized emails, messages, or other communications based on their purchase.

Why Use API Events?

Real-time Engagement: They allow instant customer interaction, right when the customer takes an action (like buying a product).

Automation: You don’t need to manually add customers to journeys, making it a scalable solution.

Personalization: API Events allow you to pass customer-specific data, which can be used to tailor the journey to their specific needs or behavior.

Now, let’s dive into how to set up and use API Events in Journey Builder!

Step-by-Step Guide to Using API Events in Journey Builder:

Step 1: Define Your Journey and Audience

First, you need to have a journey ready in Journey Builder. Think about the experience you want to create for your customers:

  • Will the journey be triggered when a user makes a purchase?
  • Should it start when someone fills out a form on your website?
  • Or will it be triggered by some other external event (like subscribing to a newsletter)?

Have a clear goal for your journey and define the touchpoints (emails, SMS, etc.) that your customers will go through.

Step 2: Set Up the Journey with an API Entry Source

Once you know how you want to engage with your audience, follow these steps:

  1. Go to Journey Builder in Marketing Cloud.
  2. Click on Create New Journey.
  3. Select Multi-Step Journey.
  4. Under Entry Sources, select API Event. (An entry source is what triggers the journey. In this case, we’ll use an API Event.)
  5. Choose API Event as your event type.
  6. Choose what you want to do with the event like update the contact

Step 3: Obtain the API Endpoint and Key

  1. Go to the setup
  2. In the quick find box search Installed packages, click on Installed packages.
  3. Click on new
  4. Enter name and description
  5. Click on Add Component
  6. Choose Component Type API Integration
  7. Select Server to Server
  8. Select scope, for this example we will select
    • Journey: Read
    • List and Subscribers: Read
  9. Click on Save.

Once you’ve configured the package, Salesforce will generate

  • Client Id
  • Client Secret
  • Authentication Base URI
  • REST Base URI
  • SOAP Base URI

These will be used by external systems to trigger the event.

Step 4. Copy the Authentication Base URI to generate the access_token

Method : POST

Endpoint: https://your-marketing-cloud-AuthenticationBaseURI-endpoint-url

body :

{

"grant_type": "client_credentials",

"client_id": "*******************",

"client_secret": "****************"

}

Step 5: Set Up the API Call in External Systems

Now that you have your REST Base URI and access_token, you’ll need to integrate this with your external system.

Whether you’re using a website, an app, or another CRM system, you’ll need to set it up to call this endpoint whenever the event occurs.

For example, if you want the journey to trigger when someone makes a purchase:

1. When the purchase happens, your website or e-commerce platform sends an HTTP POST request to the API endpoint.

2. The API call will include all the required customer data, like name, email, and purchase details.

Here’s a sample API call format:

Method: POST

Endpoint: https://your-marketing-cloud-endpoint-url

Header: “Authorization: Bearer YOUR_AUTH_KEY”,”Content-Type: application/json”

Body:

 
'{

"contactKey": "[email protected]",

"eventDefinitionKey": "YOUR_EVENT_DEFINITION_KEY",

"data": {

"firstName": "John",

"lastName": "Doe",

"purchaseAmount": "100",

"productId": "12345"

}

}'

Step 6: Test the API Event

Before launching the journey, it’s a good idea to test the API event to make sure everything works as expected.

1. Use a tool like Postman to simulate an API call and ensure that the journey is triggered correctly.

2. Check Marketing Cloud to ensure the test contact has been injected into the journey.

Step 8: Launch the Journey

Once you’ve tested everything, go ahead and activate the journey. Now, any time your external system makes an API call, the journey will trigger, and your customers will be automatically added.

Best Practices for Using API Events in Journey Builder

1. Validate the Data: Ensure that the data coming in from your external system is clean and properly formatted. Incorrect data can cause the journey to fail.

2. Monitor and Optimize: Use Marketing Cloud’s tracking and reporting tools to see how well your journeys perform. Are customers engaging with your emails or messages? Make adjustments as needed.

3. Secure Your API Calls: Always ensure your API endpoints are secure and only authorized systems can trigger the journeys. Use tokens, keys, and proper authentication methods.

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home