Skip to main content
The Command Validation command (Command Type: 1) validates whether specific strings are present in or absent from the provided data. It throws an error when the configured condition is not met.

Overview

The Command Validation command provides functionality for:
  • Validating that required strings exist in the data (include mode)
  • Validating that specific strings are absent from the data (exclude mode)
  • Combining multiple values with OR logic (any match required) or AND logic (all matches required)

Command Type

Command Type ID: 1

Parameters

ParameterTypeDescriptionRequired
valuesArray of stringAn array of strings to check for in the dataYes
matchModestringWhether to validate that values are included in or excluded from the data. Possible values: "include", "exclude". Defaults to "include"Yes
combineLogicstringHow multiple values are combined: "or" requires any match, "and" requires all matches. Defaults to "or"Yes

matchMode Values

ValueDescription
"include"Throws an error if none of the values are found in the data
"exclude"Throws an error if any of the values are found in the data

combineLogic Values

ValueDescription
"or"Condition is met if any of the configured values match
"and"Condition is met only if all of the configured values match

Usage Examples

Validate String is Present (include / or)

{
  "command": "command-validation",
  "params": {
    "values": ["success"],
    "matchMode": "include",
    "combineLogic": "or"
  }
}

Validate All Required Strings Exist (include / and)

{
  "command": "command-validation",
  "params": {
    "values": ["eventId", "marketId", "odds"],
    "matchMode": "include",
    "combineLogic": "and"
  }
}

Validate No Error Strings are Present (exclude / or)

{
  "command": "command-validation",
  "params": {
    "values": ["error", "unauthorized", "forbidden"],
    "matchMode": "exclude",
    "combineLogic": "or"
  }
}

Validate None of Multiple Strings are Present (exclude / and)

{
  "command": "command-validation",
  "params": {
    "values": ["error", "timeout"],
    "matchMode": "exclude",
    "combineLogic": "and"
  }
}

Common Use Cases

  • Response Guard: Ensure a success indicator is present in an HTTP or WebSocket response before processing
  • Error Detection: Throw early if an error string is found in the data
  • Completeness Check: Verify all required field names are present in the raw data
  • Blocklist Check: Reject data that contains any forbidden string
  • JSON Parse - Parse data before validating
  • Http Request - Validate HTTP response content
  • Filter - Filter data by field values after validation