1

Trying to create interactions for Salesforce Marketing Cloud Journey Builder via the REST API which can later be triggered using a REST API /interactions/v1/events call.

My current attempt is as follows:

{
    "key": "TestInteractionSansKey",
    "name": "New interaction without trigger event",
    "version": 1,
    "workflowApiVersion": 1.0,

    "triggers": [ {
        "eventDefinitionKey": "MyTestEventKey",
        "data": [{
            "key": "MyDataKey",
            "name": "Data key",
            "items": [{
                "values": [{
                    "name": "contactKey",
                    "value": "test"
                }]
            }]
        }]
    }]
}

If I pull out the 'triggers' field, everything works as intended, but I need the interaction to have a trigger that I can invoke later. So what should this 'triggers' field look like? What fields do the objects need? The error messages have not been much help.

1 Answer 1

2

OK, here's what's working for me:

POST https://www.exacttargetapis.com/interaction/v1/eventDefinitions
{
  "type": "ContactEvent",
  "name": "APICreatedTrigger",
  "description": "Created in API!",
  "mode": "Production",
  "eventDefinitionKey": "APICreatedTrigger-ff6b8011-28b1-469d-bda6-9ea78477401a",
  "dataExtensionId": "2ecfeaa9-9868-437e-b36c-fb22fc485067",
  "iconUrl": "/events/images/icon_journeyBuilder-event-document-blue.svg",
  "arguments": {
    "serializedObjectType": 2,
    "criteria": "<FilterDefinition><ConditionSet Operator=\"AND\" ConditionSetName=\"Individual Filter Grouping\"></ConditionSet></FilterDefinition>",
    "eventDefinitionId": "d7341325-bac7-49de-beb2-7f7e66e7806d",
    "eventDefinitionKey": "APICreatedTrigger-ff6b8011-28b1-469d-bda6-9ea78477401a",
    "dataExtensionId": "2ecfeaa9-9868-437e-b36c-fb22fc485067"
  },
  "metaData": {
    "criteriaDescription": "",
    "scheduleState": "No Schedule"
  },
  "interactionCount": 2,
  "isVisibleInPicker": false,
  "category": "Event"
}

POST https://www.exacttargetapis.com/interaction/v1/interactions
{
    "key": "abc5-fsdichu23r",
    "version": 1,
    "name": "ABC5",
    "description": "ABC5",
    "workflowApiVersion": 1.0,
    "triggers": [
        {
            "key": "abc5-trigger",
            "name": "Starting point for the interaction",
            "type": "Event",
            "eventDefinitionKey": "APICreatedTrigger-ff6b8011-28b1-469d-bda6-9ea78477401a",
            "arguments": {"filterResult": "{{Contact.FilterId.8a82a8dd-ea86-4d1a-968a-201ed2113172}}"},
            "configurationArguments": {
            "schemaVersionId": 4,
        "criteria": "<FilterDefinition><ConditionSet Operator=\"AND\" ConditionSetName=\"Individual Filter Grouping\"></ConditionSet></FilterDefinition>",
        "filterDefinitionId": "8a82a8dd-ea86-4d1a-968a-201ed2113172"
        },
            "metaData": {
                "eventDefinitionId": "d7341325-bac7-49de-beb2-7f7e66e7806d",
                "eventDefinitionKey": "APICreatedTrigger-ff6b8011-28b1-469d-bda6-9ea78477401a",
                "chainType": "None"
            }
        }
    ]
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .