Journey Builder REST API Documentation

Journey Builder REST API Documentation
Home Page

Journey Builder REST API Documentation

Introduction

The Journey Builder REST API allows you to programmatically interact with the Journey Builder feature of Salesforce Marketing Cloud. With this API, you can create, update, and manage customer journeys, as well as perform various operations related to contacts and interactions within those journeys. This document provides detailed information on how to use the Journey Builder REST API to integrate and automate your marketing workflows.

Base URL

The base URL for accessing the Journey Builder REST API is:

https://your_subdomain.rest.marketingcloudapis.com/interaction/v1/

Replace your_subdomain with the specific subdomain for your Salesforce Marketing Cloud account.

Authentication

To authenticate your API requests, you need to include an access token in the request headers. The access token can be obtained using the OAuth 2.0 authentication flow supported by Salesforce Marketing Cloud.

Once you have obtained an access token, include it in the Authorization header of your requests using the Bearer scheme. Here's an example:

Authorization: Bearer <access_token>

API Endpoints

1. Journeys

1.1 List Journeys

GET /interactions

This endpoint retrieves a list of all journeys available in your Marketing Cloud account. It returns an array of journey objects with details such as journey ID, name, description, and status.

1.2 Get Journey by ID

GET /interactions/{journeyId}

This endpoint retrieves the details of a specific journey based on its ID. Provide the journeyId as a path parameter.

1.3 Create Journey

POST /interactions
                
{
"key": "created-via-the-api",
"name": "API-Created journey",
"workflowApiVersion": 1,
"triggers": [],
"goals": [],
"activities": []
}

This endpoint allows you to create a new journey in your Marketing Cloud account. Provide the journey details in the request body, including name, description, and configuration.

1.5 Delete Journey

DELETE /interactions/{journeyId}

This endpoint deletes a journey from your Marketing Cloud account based on its ID. Provide the journeyId as a path parameter.

1.6 Stop Journey

POST /interactions/stop/{{journeyId}}?versionNumber={{versionNumber}}

This endpoint stops a journey from your Marketing Cloud account based on its ID and versionNumber. Provide the journeyId and versionNumber as a path parameter.

1.7 Get Interaction Summary

GET /interactions/{journeyId}/summary

This endpoint gets the journey summary from your Marketing Cloud account based on its ID. Provide the journeyId as a path parameter.

                
{
"Status":0,
"Content":
          {
           "id":"3300a277-18a0-498b-9ecc-5cb5e82e19ba",
           "activities":[
                         {
                          "type":"EmailAudience",
                          "count":1
                          },
                          {
                            "type":"EMAILV2",
                            "count":2
                          },
                          {
                            "type":"MULTICRITERIADECISION",
                            "count":1
                          },
                          {
                            "type":"StartActivity",
                            "count":1
                           },
                           {
                            "type":"WAIT",
                            "count":5
                           }
                        ]
             }
}
                
            

2. Events

2.1 Inject Contact into Journey

POST /events

{
"ContactKey": "b2shashi",
"EventDefinitionKey": "APIEvent-0dbe46de-74f9-a309-7778-298c0a565f93",
"Data": {
"SubscriberKey": "b2shashi",
"Email": "b2.shashi@gmail.com",
"First_Name": "Shashi",
"Last_Name": "Prasad"
}
}

This endpoint injects a contact into a specific journey. Provide the contact details in the request body, including contact key and journey entry event details.

2.2 Remove Contact From Journey

POST /interactions/contactexit

[
	{
     "ContactKey": "b2shashi",
     "DefinitionKey": "APIEvent-0dbe46de-74f9-a309-7778-298c0a565f93",
     "Versions": [
      2
                 ]
    }
]

This endpoint removes a contact into a specific journey. Provide the contact details in the request body, including contact key and journey event details.

2.3 Get List Of Journeys Contact Is In

POST /interactions/contactMembership

                {
                    "ContactKeyList": [
                        "11111",
                        "52496"
                    ]
                }

This endpoint defines the list of contacts exists in a journey and contacts don't exists.


{
    "StatusCode":200,
    "Response":[
                {
                    "results":
                            {
                                "contactMemberships":[],
                                "contactsNotFound":
                                                    ["11111","52496"]
                            }
                }
            ]}


Comments

Most Viewed

CLOUD PAGE ENABLEMENT - PART 1

EMAIL NOT SENT IN JOURNEY BUILDER

CONSIDERATIONS FOR JOURNEY BUILDER

Understanding Transactional Messaging

Preference Center Demystified


Knowledge Article

Popular Posts

CLOUD PAGE ENABLEMENT - PART 1

EMAIL NOT SENT IN JOURNEY BUILDER

CONSIDERATIONS FOR JOURNEY BUILDER

Understanding Transactional Messaging

Preference Center Demystified

Share with Friends

Disclaimer:

The information provided on this technical blog is for general informational purposes only. As a SFMC (Salesforce Marketing Cloud) Technical Architect, I strive to offer accurate and up-to-date content related to SFMC and its associated technologies. However, please note that technology is constantly evolving, and the information provided may become outdated or inaccurate over time.

The content published on this blog represents my personal views and experiences as a SFMC Technical Architect and does not necessarily reflect the official views or opinions of any organization or employer I may be affiliated with.

While I make every effort to ensure the accuracy and reliability of the information presented, I cannot guarantee its completeness, suitability, or applicability to your specific circumstances. Therefore, it is essential to verify any information provided and make your own independent assessments or seek professional advice if needed.

Furthermore, any actions taken based on the information provided on this blog are at your own risk. I shall not be held liable for any damages, losses, or inconveniences arising from the use of the information presented here.

Please keep in mind that SFMC and its associated technologies are complex and require technical expertise for proper implementation and management. It is recommended to consult with qualified professionals or official SFMC documentation for comprehensive guidance.

Finally, please note that any product or company names mentioned on this blog are trademarks or registered trademarks of their respective owners. The mention of these trademarks or registered trademarks does not imply any endorsement or affiliation with the blog.

By accessing and using this blog, you agree to the terms of this disclaimer. If you do not agree with any part of this disclaimer, please refrain from using this blog.