Skip to content
Last updated

Managing Activations Inside a Journey Using the REST API

Similar to the UI, you can set up activations in the REST API. In addition to creating, viewing, and updating activations inside a journey, you can use the API to verify objects and view customer journeys and profiles.

This article contains:

Create an activation inside a journey

You can create an activation in the specified journey. In the example below, the journey ID is 12345.

Request Sample

curl -i -X POST \  
 https://api-cdp.treasuredata.com/entities/journeys/12345/syndications \  
 -H 'AUTHORIZATION: TD1 1/1234567891234567891234560001234567891234'  
{  
 "type": "journeyActivationStep",  
 "attributes": {  
 "syndication_params": {  
 "scheduleType": "hourly",  
 "scheduleOption": "00:00,  
 "timezone": "UTC",  
 "connectorConfig": {  
 "useKey": false,  
 "spreadsheetTitle": "xxxx",  
 "sheetTitle": "From Activation",  
 "mode": "replace",  
 "range": "A1",  
 "rowsThreshold": 5000,  
 "valueInputOption": "RAW",  
 "setNilForDoubleNan": true  
 },  
 "connectionId": "135593",  
 "name": "My Activation",  
 "description": "",  
 "columns": [],  
 "allColumns": true,  
 "emailRecipients": [],  
 "notifyOn": []  
 }  
 },  
 "relationships": {  
 "journey": {  
 "data": {  
 "id": ...,  
 "type": "journey"  
 }  
 },  
 "createdBy": {  
 "data": {  
 "id": ...,  
 "type": "user"  
 }  
 }  
 "updatedBy": {  
 "data": {  
 "id": ...,  
 "type": "user"  
 }   
 }   
 }   
}  

Update a specified activation inside a journey

You can update a specific activation in the specified journey. Unlike other objects inside a journey, activations may be updated even after the specified journey is launched. In the example below, the journey ID is 12345 and the activation ID is 678.

Request Sample

curl -i -X PATCH \  
 https://api-cdp.treasuredata.com/entities/journeys/12345/syndications/678 \  
 -H 'AUTHORIZATION: TD1 1/1234567891234567891234560001234567891234'  
{  
 "type": "journeyActivationStep",  
 "attributes": {  
 "syndication_params": {  
 "scheduleType": "hourly",  
 "scheduleOption": "00:00,  
 "timezone": "UTC",  
 "connectorConfig": {  
 "useKey": false,  
 "spreadsheetTitle": "xxxx",  
 "sheetTitle": "From Activation",  
 "mode": "replace",  
 "range": "A1",  
 "rowsThreshold": 5000,  
 "valueInputOption": "RAW",  
 "setNilForDoubleNan": true  
 },  
 "connectionId": "135593",  
 "name": "My Activation",  
 "description": "",  
 "columns": [],  
 "allColumns": true,  
 "emailRecipients": [],  
 "notifyOn": []  
 }  
 }  
}  

View an activation inside a journey

You can view a specific activation in the specified journey. In the example below, the journey ID is 12345 and the activation ID is 678.

Request Sample

curl -i -X GET \  
https://api-cdp.treasuredata.com/entities/journeys/12345/syndications/678 \  
-H 'AUTHORIZATION: TD1 1/1234567891234567891234560001234567891234'  

Verifying objects in a folder

Similar to objects in the UI, you can view entities in the API. The following call will return all the entities inside the folder, including, segments predictive scoring models, and other folders inside a folder.

You can verify that your journey is created inside your desired folder. In the following example, the folder ID is 295432. You can also view any nested folders by designating the depth you want to view. The depth below is indicated as 30 describes how deeply you want to search inside the folder. Up to 32 levels of child folders are viewable.

Request Sample

curl -i -X GET \  
 https://api-cdp.treasuredata.com/entities/by-folder/295432?depth=30  
 -H 'AUTHORIZATION: TD1 1/1234567891234567891234560001234567891234'  

Viewing journey statistics

You can view the statistics of the journey by calling the statistics endpoint. The response will include how many profiles the whole met the goal of the journey (if set for the journey), how many profiles are in each stage, and how many profiles exited the stage by meeting exit criteria (if set for the stage and if the profiles exited). In the example below the journey ID is 12345. By default, statistics are displayed for the past 30 days (including the current date).

curl -i -X GET \  
 https://api-cdp.treasuredata.com/entities/journeys/12345/statistics \  
 -H 'AUTHORIZATION: TD1 1/1234567891234567891234560001234567891234'  

Viewing customer profiles

You can view a list of customer profiles inside a specified journey by calling the customers endpoint. In the example below the journey ID is 12345.

curl -i -X GET \  
 https://api-cdp.treasuredata.com/entities/journeys/12345/customers \  
 -H 'AUTHORIZATION: TD1 1/1234567891234567891234560001234567891234'