1

I'm looking for a way to retrieve journey contact history - basically the same information that is on Journey Builder - History tab (Contact key, Journey Name, Activity name, Status, Timestamp) via SFMC API. I browsed the REST API documentation but couldn't find anything regarding getting that data. Has anyone ever done something like this and can push me in the right direction?

2

You can retrieve Journey History by POSTing to this endpoint /interaction/v1/interactions/traceevents/search

It is the same endpoint used in the History tab in Journey Builder.

Example of the request payload without any filter (apart from time)

{"from":0,"size":100,"filter":{"fquery":{"query":{"query_string":{"query":"(transactionTime:[2017-08-29T13:20:45.101Z TO *])"}}}}}

Example of the request paypload with a filter on a journey

{"from":0,"size":100,"filter":{"fquery":{"query":{"query_string":{"query":"(definitionId:74d00b19-f28f-4533-abb2-xxxxxxxxxxxx) AND (transactionTime:[2017-08-29T13:20:45.101Z TO *])"}}}}}

I suggest you use google developer tools (in Network tab) or any other monitoring tool to monitor the network traffic within the History tab of Journey Builder and learn more about this endpoint especially how to perform complex queries.

Please note that this is not officially available for use as it is not documented in the official documentation

[EDIT - 11/10/2017] You can now also use Journey Builder Data Views to retrieve Journey activity.

  • I don't think the JB data views gets to the same granularity as the history tab. For instance, I don't see a date/time field for when a contact hit a particular activity. – Daniel Nov 28 '18 at 18:35
  • @zeljazouli is it possible to get the values from the interaction? For example: _source: activityId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" activityName: "Update Contact Activity" activityType: "SALESCLOUDACTIVITY" contactKey: "003E000001xxxxxxxx" definitionId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" definitionName: "Marketing Cloud Retirees" eventId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" eventName: "Marketing Cloud Retirees" id: "60261146" message: "" mid: 1234567 status: "Complete" transactionTime: 1543234694677 – Yosef Sahler Nov 30 '18 at 1:49
1

Unfortunately, this isn't possible at this time. The only workaround would be to add Update Contact Activities preceding each Activity, which update Data Extension fields so you can to determine what step the Contact is at within a running Journey. For example, create a Data Extension with the following fields:

  • Contact Key (string)
  • Email Activity 1 (boolean)
  • Email Activity 2 (boolean)
  • Decision Split (boolean)
  • etc...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.