Sequential Event Trigger

Overview

The Sequential Event Trigger endpoint allows you to send a single request message containing data to be loaded into one or more tables. For example, you could send a single message that contains one record to be loaded into a ‘Recipient’ table, two records to be loaded to an ‘Order’ table, and five records to be loaded to an ‘Order Item’ table. The system will load or update data, one table at a time. Each of these tables must be ordered in the exact sequence in which they should be loaded or updated. Please note that if you're loading data into multiple tables, you can send only ONE record at the parent level (you can optionally write multiple records into the joined tables).

This endpoint requires authentication using OAuth 2.0, and supports XML only (not JSON).

The Sequential Event Trigger endpoint requires the use of an API Post for each table being loaded. Continuing the above example, if you're loading data into the 'Recipient,' 'Order,' and 'Order Item' tables, you'd need three API Posts -- one for each table. The API Post includes a Data Map, which provides data handling instructions, such as where to store the inbound data contained within the API request, and whether this data should be used to update existing records and / or create new records.

When defining an Event-triggered Campaign, the platform allows you to use an API Post as the triggering mechanism. The platform will load or update the database prior to deploying the Campaign, which allows you to use data from your database when building your message content.

For more details on how to set up an Sequential Event Trigger API request, please see the Sequential Data Load API Technical Guide.

The following diagram depicts the processing flow for deploying a Campaign via the Sequential Event Trigger endpoint:

Pre-requisites

The Sequential Event Trigger endpoint requires the following:

POST Method

The Sequential Event Trigger endpoint supports a POST method. This method is intended to load the data provided in the API payload into your database. A request message must include the following:

Click hereClick here to see a sample request message in XML format.

In the below example, this request message is being used to trigger the deployment of an Order Confirmation email. A single request message is being used to load data into three different tables -- 'Order Item,' 'Order,' and 'Recipient.' Each table has its own API Post, referenced in the message as the "FormID."

Based on the "SubmissionSequence" parameter, the request will update the 'Order Item' table first since it has the lowest "SubmissionSequence" value of "1." Next, the system will load the 'Order' table ("SubmissionSequence = 2"), and then lastly the 'Recipient' table ("SubmissionSequence = 3").

When setting up the Event-triggered Campaign, you typically want to use the final API Post in the sequence as the trigger mechanism ("39" in the below example). In this manner, you can be certain that all of the necessary order data and item data has been loaded into the database, prior to building and sending the email message.

 

<ApiSubmission CustId="123">

<Records TableName="order_item" FormId="35" SubmissionSequence="1">

<Record>

<Field FieldName="order_itemID">1000</Field>

<Field FieldName="orderid">55446</Field>

<Field FieldName="description">head phones</Field>

<Field FieldName="sku">656565</Field>

<Field FieldName="price">25.99</Field>

</Record>

<Record>

<Field FieldName="order_itemID">1001</Field>

<Field FieldName="orderid">55446</Field>

<Field FieldName="description">tape</Field>

<Field FieldName="sku">656566</Field>

<Field FieldName="price">2.50</Field>

</Record>

</Records>

<Records TableName="order" FormId="37" SubmissionSequence="2">

<Record>

<Field FieldName="orderid">55446</Field>

<Field FieldName="customer_id">12345</Field>

<Field FieldName="order_date">04/16/18 15:01:00</Field>

<Field FieldName="order_amount">29.56</Field>

</Record>

</Records>

<Records TableName="recipient" FormId="39" SubmissionSequence="3">

<Record>

<Field FieldName="customer_id">12345</Field>

<Field FieldName="email">johndoe@cheetahmail.com</Field>

<Field FieldName="fname">John</Field>

<Field FieldName="lname">Doe</Field>

</Record>

</Records>

</ApiSubmission>

 

 

Back to API Category - Campaign Deployment