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
Post a Comment