verified
Retrieve a JourneyRetrieve a single Journey from the Journey Builder in Salesforce Marketing Cloud.
REST API
var journeyId = "S0M3-1D-K3Y-G03SR1G4T-H3R3";
var endpoint = restInstanceUrl + "interaction/v1/interactions/" + journeyId;
var request = new Script.Util.HttpRequest(endpoint);
request.emptyContentHandling = 0;
request.retries = 2;
request.continueOnError = true;
request.setHeader("Authorization", "Bearer " + accessToken);
request.method = "GET";
request.contentType = "application/json";
request.encoding = "UTF-8";
var results = request.send();
var result = Platform.Function.ParseJSON(String(results.content));
Write(Stringify(result));
<script runat="server">
Platform.Load("core", "1");
var restInstanceUrl = "https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com/",
accessToken = "YOUR_REST_API_TOKEN";
try {
var journeyId = "S0M3-1D-K3Y-G03SR1G4T-H3R3";
var endpoint = restInstanceUrl + "interaction/v1/interactions/" + journeyId;
var request = new Script.Util.HttpRequest(endpoint);
request.emptyContentHandling = 0;
request.retries = 2;
request.continueOnError = true;
request.setHeader("Authorization", "Bearer " + accessToken);
request.method = "GET";
request.contentType = "application/json";
request.encoding = "UTF-8";
var results = request.send();
var result = Platform.Function.ParseJSON(String(results.content));
Write(Stringify(result));
} catch(error) {
Write(Stringify(error));
}
</script>
{
"id": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
"key": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
"name": "New Journey - May 14 2023 7.00 PM",
"lastPublishedDate": "0001-01-01T00:00:00",
"description": "",
"version": 1,
"workflowApiVersion": 1,
"createdDate": "2023-05-14T19:00:00.000",
"modifiedDate": "2023-05-14T19:00:00.000",
"activities": [
{
"id": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
"key": "MULTICRITERIADECISIONV2-1",
"name": "",
"description": "",
"type": "MULTICRITERIADECISION",
"outcomes": [
{
"key": "default_path_1",
"next": "CHOICE 1",
"arguments": {},
"metaData": {
"label": "ONE",
"skipI18n": true,
"isLabelFromConversion": false,
"criteriaDescription": "OPTION equal ONE",
"invalid": false
}
},
{
"key": "remainder_path",
"next": "CHOICE 2",
"arguments": {},
"metaData": {
"label": "OTHER",
"skipI18n": true,
"isLabelFromConversion": false,
"invalid": false
}
}
],
"arguments": {
"filterResult": "default_path_1={{Contact.FilterId.S0M3-GU1D-K3Y-G03SR1G4T-H3R3}},remainder_path=False"
},
"configurationArguments": {
"schemaVersionId": 252,
"criteria": {
"default_path_1": ""
}
},
"metaData": {
"isConfigured": true
},
"schema": {
"arguments": {
"actualChoice": {
"dataType": "Number",
"isNullable": false,
"direction": "Out",
"readOnly": false,
"access": "Hidden"
},
"filterResult": {
"dataType": "Text",
"isNullable": false,
"direction": "In",
"readOnly": true,
"access": "Hidden"
}
}
}
}
],
"triggers": [
{
"id": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
"key": "TRIGGER",
"name": "My DataExtension",
"description": "",
"type": "AutomationAudience",
"outcomes": [],
"arguments": {
"startActivityKey": "{{Context.StartActivityKey}}",
"dequeueReason": "{{Context.DequeueReason}}",
"lastExecutedActivityKey": "{{Context.LastExecutedActivityKey}}",
"filterResult": "true"
},
"configurationArguments": {
"schemaVersionId": 0,
"criteria": "",
"filterDefinitionId": "00000000-0000-0000-0000-000000000000"
},
"metaData": {
"scheduleState": "No Schedule",
"sourceInteractionId": "00000000-0000-0000-0000-000000000000",
"eventDefinitionId": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
"eventDefinitionKey": "DEAudience-S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
"chainType": "None",
"configurationRequired": false,
"iconUrl": "/images/icon-data-extension.svg",
"title": "Data Extension",
"category": "Audience",
"entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json"
}
}
],
"goals": [],
"exits": [],
"notifiers": [],
"stats": {
"currentPopulation": 0,
"cumulativePopulation": 0,
"metGoal": 0,
"metExitCriteria": 0,
"goalPerformance": 0
},
"entryMode": "MultipleEntries",
"definitionType": "Multistep",
"channel": "",
"defaults": {
"mobileNumber": [
"{{Event.DEAudience-S0M3-GU1D-K3Y-G03SR1G4T-H3R3.\"MobileNumber\"}}"
],
"properties": {
"analyticsTracking": {
"enabled": true,
"analyticsType": "google",
"urlDomainsToTrack": []
}
}
},
"metaData": {},
"executionMode": "Production",
"categoryId": 123456,
"status": "Published",
"definitionId": "S0M3-GU1D-K3Y-G03SR1G4T-H3R3",
"scheduledStatus": "Draft"
}
Parameters
REST API method accepts many filter parameters when performing the request.
GET /interaction/v1/interactions?$page=1&$pageSize=50&extras=activities
Name | Type | Example | Description |
---|---|---|---|
$page | Number | 1 | The number of pages to retrieve. The default value is 1. |
$pageSize | Number | 50 | The number of results to return on a page. The default and maximum is 50. |
$orderBy | String | "ModifiedDate DESC" | Specify how to order the journeys. Valid ordering columns are: ModifiedDate (default), Name, Performance. Valid values are: DESC, ASC. The default value is "ModifiedDate DESC". |
status | String | "Published" | A status description upon which to filter journeys. Can be one of: Draft, Published, ScheduledToPublish, Stopped, Unpublished, Deleted. The default value is blank, which returns all statuses. ScheduledToSend, Sent, and Stopped are unique to single-send journeys. A single send journey can be 'Cancelled' via the UI, but the API status for this is "Stopped." |
versionNumber | Number | 1 | Version number of the journey to retrieve. The default value is published version or latest available version number which meets other search criteria. |
specificApiVersionNumber | Number | 3 | Version number of the workflowApiVersion upon which to filter journeys. The default value is 1. |
mostRecentVersionOnly | Boolean | true | A flag to indicate whether to fetch only the most recent version of matching journeys. The default value is true. |
definitionType | Enum | "transactional" | Type of definition to retrieve. Valid values include: transactional (retrieves all transactional send definitions). |
nameOrDescription | String | "DE" | A search string inside the journey's name or description properties upon which to match for filtering. |
extras | String | "activities" | A list of additional data to fetch. Available values are: all, activities, outcome and stats. The default value is blank, which returns all extras. |
tag | String | "tbd" | Specify a single tag to filter results to only include journeys associated with that tag. |
Reference
Ressources and references related to the current methods.
Official documentation