Validating Event Parameters

Events that are sent to Reteno must meet specific requirements. Otherwise, the workflows may not work, you may lose important data, etc.

The Reteno system allows you to validate events and provide immediate feedback if event parameters contain errors.

Also, the system checks that event includes the required parameters.

Setting Required Event Parameters

Set required event parameters so the system accepts an event only if it meets the specified structure.

Steps to set up event’s structure validation:

  1. Create a new event or edit an existing one (See Events to learn more about how to create events in Reteno).
  2. Enable the Validate parameters slide button.
  3. Click + Add parameter.
Edit event type
  1. Enter the parameter name in the corresponding field and select the Required parameter checkbox if the parameter is required.
  2. Add other parameters as necessary, then click Edit.
Validate parameters

Validating Event Parameters

Validate event parameters and structure using Generate event API method. Indicate parameters in the params array.

Validating Event Parameters

If parameters do not meet the specified structure, you will get the 400 bad request error and the required event structure in the response.

Response example:

The event should have the following params: [
    {
        "name": "EmailAddress",
        "required": true
    },
    {
        "name": "Phone Number",
        "required": false
    },
    {
        "name": "Name",
        "required": false
    }
]

Event types with enabled parameter validation are marked with a check icon.

Event types with enabled parameter validation

Event requirements

Body ParamsTypeRequired/OptionalDescriptionRequirements
eventTypeKeyStringRequiredEvent type ID key. If no such event type exists with such a key, a new one is created.1. All characters are allowed except < ; ’ \ / | " ` ' ^ ? ! , >
2. Max. length: 100 characters.
keyValueStringRequiredEvent key, which determines the event's uniqueness. If you don't pass a keyValue in the event, it is automatically taken from the request's Params object with such a priority:

- contactId;
- externalCustomerId;
- email;
- phone;
- pushToken (web or mobile).

An event without one of these parameters or a passed keyValue value is not accepted.
1. The key must contain a unique value for each contact (for example, email, phone number, external contact id, etc.).
2. All characters are allowed except < ; ’ \ / | " ` ' ^ ? ! , >
3. Max. length: 300 characters
paramsArray of objectsOptionalList of event parameters represented as an array of _key - value _pairs. The parameter keys are arbitrary.

Used in campaigns and for creating dynamic content in messages.
1. Params array may be empty: []
But if the array is not empty, both name and value fields must be in the array object.
2. The value of the name parameter must be unique.
3. Max. length of the name parameter’s value: 100 characters.

See API documentation for more information.