Skip to content

Custom events in scenarios – API methods 

You can use the API to automatically add custom event data to your scenarios. The available method for this is POST.

Adding customer to a scenario – POST method

Endpoint

The endpoint for POST requests is: https://api.ecdp.app/scenariocustomevents

Request parameters

Parameter RequiredType Category Min/max length (characters)Description 
x-api-key yesstring header your API key – find it in Settings > API.
customEventIdyesinteger($int32) body custom event ID number.
customerIdnostringbodycustomer ID number.
customerEmail nostringbodymin: 0
max: 320
customer email address.
customerEmail nostringbodymin: 0
max: 32
customer email address encrypted with the Md5 algorithm.
customerEmailSha256nostringbodymin: 0
max: 64
customer email address encrypted with the Sha256 algorithm.
customerPhonenostringbodymin: 0
max: 20
customer phone number.
customerCrmIdnostringbodymin: 0
max: 128
ustomer CRM ID number.
dataFields nostringbodyadditional data describing the custom event – see Data fields parameters.

Data fields parameters

Parameter RequiredType Description 
name nostring data name 
type nostring data type: String, Text, Number, Money, Date, DateTime, Boolean, URL 
value nostring data value 

Proper query format

Below, you’ll find sample syntax for adding custom events to your scenario: 

{
 "customEventId": 0,
  "customerId": 0,
  "customerEmail": "string",
  "customerEmailMd5": "string",
  "customerEmailSha256": "string",
  "customerPhone": "string",
  "customerCrmId": "string",
  "dataFields": [
    {
      "name": "string",
      "type": "String",
      "value": "string"
    }

  ]
}

Response codes

201: Created

The request was created successfully.

400: Bad request

The request wasn’t processed – usually due to a missing or invalid parameter Sample response:

{

  "type": "string",
  "title": "string",
  "status": 0,
  "substatus": "CustomerInvalidModelState",
  "detail": "string",
  "instance": "string",
  "errors": [
    "string"

  ]
}

401: Unauthorized

The request was missing an API key or you don’t have permission to access this information

Sample response:

{
 "type": "string",
  "title": "string",
  "status": 0,
  "substatus": "CustomerInvalidModelState",
  "detail": "string",
  "instance": "string"
}

404: Not found

The data you are looking for is not on the server.

Sample response syntax: 

{
   "type": "string",
  "title": "string",
  "status": 0,
  "substatus": "CustomerInvalidModelState",
  "detail": "string",
  "instance": "string"
}

Adding customers in segments to scenarios POST method

Endpoint

The endpoint for this POST requests is: https://api.ecdp.app/scenariocustomevents/withsegments

Request parameters

Parameter RequiredType Category Description 
x-api-key yesstring header your API key, which you can find in Settings > API.
customEventIdyesinteger($int32) body custom event ID number.
segmentsyesinteger($int32) bodysegment ID.
nameno
string 
bodydata name.
typeno
string 
bodydata type: String, Text, Number, Money, Date, DateTime, Boolean, URL 
valueno
string 
bodydata value.

Proper query format

Below you’ll find sample syntax for adding customers to an active scenario base on segments with ID numbers: 1, 5 and 15.

{
  "customEventId": 0,
  "segments": [
    0
  ],
  "dataFields": [
    {
      "name": "string",
      "type": "String",
      "value": "string"
    }
  ]
}

Response codes

201: Created

The request was created successfully.

400: Bad request

The request wasn’t processed, usually due to a missing or invalid parameter. Sample response:

{
"type": "string",
  "title": "string",
  "status": 0,
  "substatus": "CustomerInvalidModelState",
  "detail": "string",
  "instance": "string",
  "errors": [
    "string"
  ]

401: Unauthorized

The request was missing an API key, or you don’t have permission to access this information.

Sample response:

{
  "type": "string",
  "title": "string",
  "status": 0,
  "substatus": "CustomerInvalidModelState",
  "detail": "string",
  "instance": "string"
}

404: Not found

The data you’re looking for isn’t on the server.

Sample response:

{
"type": "string",
  "title": "string",
  "status": 0,
  "substatus": "CustomerInvalidModelState",
  "detail": "string",
  "instance": "string"
}