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:
- Server address (endpoint): https://api.ecdp.app/scenariocustomevents
- 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 |
customerId* | string | body | numer ID klienta |
Other parameters you can add to your query:
Parameter | Type | Max character count | Description |
customerEmail | string | 320 | customer email address |
customerEmailMd5 | string | 32 | customer email address encrypted with the Md5 algorithm |
customerEmailSha256 | string | 64 | customer email address encrypted with the Sha256 algorithm |
customerPhone | string | 20 | customer telephone number |
customerCrmId | string | 128 | customer CRM ID number |
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"
}