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 | Required | Type | Category | Min/max length (characters) | Description |
x-api-key | yes | string | header | – | your API key – find it in Settings > API. |
customEventId | yes | integer($int32) | body | – | custom event ID number. |
customerId | no | string | body | customer ID number. | |
customerEmail | no | string | body | min: 0 max: 320 | customer email address. |
customerEmail | no | string | body | min: 0 max: 32 | customer email address encrypted with the Md5 algorithm. |
customerEmailSha256 | no | string | body | min: 0 max: 64 | customer email address encrypted with the Sha256 algorithm. |
customerPhone | no | string | body | min: 0 max: 20 | customer phone number. |
customerCrmId | no | string | body | min: 0 max: 128 | ustomer CRM ID number. |
dataFields | no | string | body | additional data describing the custom event – see Data fields parameters. |
Data fields parameters
Parameter | Required | Type | Description |
name | no | string | data name |
type | no | string | data type: String, Text, Number, Money, Date, DateTime, Boolean, URL |
value | no | string | 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 | Required | Type | Category | Description |
x-api-key | yes | string | header | your API key, which you can find in Settings > API. |
customEventId | yes | integer($int32) | body | custom event ID number. |
segments | yes | integer($int32) | body | segment ID. |
name | no | string | body | data name. |
type | no | string | body | data type: String, Text, Number, Money, Date, DateTime, Boolean, URL |
value | no | string | body | data 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"
}