Trigger workflow custom event

WorkflowCustomEvents collection allows triggering workflow custom events. Custom events are a ways to insert subscribers into workflows. Multiple custom events can be defined in any workflow.

If a single custom event is used in multiple workflows, triggering it may cause inserting a subscriber into multiple workflows.

A business example could be a custom event called "Completing a sale". We may want such event cause starting several workflows for a subscriber, e.g. workflow called "Post-purchase communication" or "Special offers for customers".


Request data format

Data part of request for triggering workflow custom events


Data element children:

*Either SubscriberId, CustomSubscriberId, SubscriberEmail, SubscriberEmailMd5, SubscriberEmailSha256 or SubscriberPhone has to be specified to identify subscriber. If more than one field is specified, precedence is established by the same order as in table above.


DataFields element children:

Response format

On success, this request will return HTTP code "201 Created". No additional information is returned.

Examples

Request (simple request without data fields):

POST https://api.esv2.com/v2/Api/WorkflowCustomEvents HTTP/1.1

Accept-Encoding: gzip,deflate

Content-Type: application/xml;charset=UTF-8

Content-Length: 258

Host: api.esv2.com

Connection: Keep-Alive

User-Agent: Apache-HttpClient/4.1.1 (java 1.5)


<ApiRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">

<ApiKey>test_api_key1</ApiKey>

<Data>

<CustomEventId>1</CustomEventId>

<SubscriberId>1</SubscriberId>

</Data>

</ApiRequest>


Request (request with data fields):

POST https://api.esv2.com/v2/Api/WorkflowCustomEvents HTTP/1.1

Accept-Encoding: gzip,deflate

Content-Type: application/xml;charset=UTF-8

Content-Length: 1002

Host: api.esv2.com

Connection: Keep-Alive

User-Agent: Apache-HttpClient/4.1.1 (java 1.5)


<ApiRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">

<ApiKey>test_api_key1</ApiKey>

<Data>

<CustomEventId>1</CustomEventId>

<SubscriberId>1</SubscriberId>

<DataFields>

<DataField>

<Name>test_text</Name>

<Type>Text</Type>

<Value>foobar</Value>

</DataField>

<DataField>

<Name>test_number</Name>

<Type>Number</Type>

<Value>123</Value>

</DataField>

<DataField>

<Name>test_date</Name>

<Type>Date</Type>

<Value>2015-01-23</Value>

</DataField>

<DataField>

<Name>test_datetime</Name>

<Type>Datetime</Type>

<Value>2015-01-23 12:34:56</Value>

</DataField>

<DataField>

<Name>test_boolean</Name>

<Type>Boolean</Type>

<Value>false</Value>

</DataField>

</DataFields>

</Data>

</ApiRequest>