Skip to content

Custom events in scenarios – API methods 

Thanks to the API, you can automate the addition of custom events data used in scenarios. The available method for these actions is POST. 

POST method – adding custom events to scenarios 

To send a query using this method, you need the following information: 

  1. Server address (endpoint): https://api.ecdp.app/scenariocustomevents 
  1. Parameters
Parameter Type Category Description 
x-api-key String header your API key, which you can find in Settings > API 
customEventId* integer($int32) body custom event ID number 

Other parameters you can add to your query: 

Parameter Type Category Description 
customerId string  customer ID number 
customerEmail string  customer email address; minimum number of characters: 0, maximum number of characters: 320 
customerEmailMd5 string  customer email address encrypted with the Md5 algorithm; minimum number of characters: 0, maximum number of characters: 32 
customerEmailSha256 string  customer email address encrypted with the Sha256 algorithm; minimum number of characters: 0, maximum number of characters: 64 
customerPhone string  customer telephone number; minimum number of characters: 0, maximum number of characters: 20 
customerCrmId string  customer CRM ID number; minimum number of characters: 0, maximum number of characters: 128 
dataFields   additional data describing the custom event; includes an additional set of parameters >>> see tables below 

The dataFields parameters have their own parameters that will allow you to add or obtain more detailed information. 

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

API query syntax for the POST method 

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"
    }
  ]
}

POST query response codes

201: Created

The request has been created.

400: Bad request

The request has not been processed, the reason is usually a missing or invalid parameter. 

Sample response syntax: 

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

401: Unauthorized

The request was missing an API key or you are requesting access to information that you do not have permission to access.

Sample response syntax: 

{
  "type": "string",
  "title": "string",
  "status": 0,
  "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,
  "detail": "string",
  "instance": "string"
}
On this page
To top