Filters in Definition
You can utilize filters within the body
of your operation's definition, which corresponds to your request payload. It Filters automatically exclude empty or undefined values during request processing.
info
By default, all filters are set to true
, meaning all values, including empty ones, are included unless explicitly configured otherwise.
Available Filters
- Allow empty object: Determines if empty objects (
{}
) should be included. When set tofalse
, objects without keys (i.e.,{}
) are excluded.
"filters": {
"body": {
"allowEmptyObject": false,
}
}
- Allow empty array: Determines if empty arrays (
[]
) should be included. When set tofalse
, arrays of length zero (i.e.[]
) are filtered out.
"filters": {
"body": {
"allowEmptyArray": false,
}
}
- Allow empty value: Filters out scalar values if empty or undefined. When set to
false
, the following values will be excluded:undefined
null
- Empty strings (
""
) - String values:
"undefined"
,"null"
"filters": {
"body": {
"allowEmptyValue": false
}
}
Example
Setup
Your integration definition includes:
"filters": {
"body": {
"allowEmptyObject": false,
"allowEmptyArray": false,
"allowEmptyValue": false
}
}
Input Parameters
{
"to": "+14155552671",
"from": "+14155551234",
"body": "", // Empty string — triggers allowEmptyValue
"mediaUrl": null, // null — triggers allowEmptyValue
"callback": {}, // Empty object — triggers allowEmptyObject
"tags": [] // Empty array — triggers allowEmptyArray
}
Intended Request Body (Before Filter)
{
"To": "+14155552671",
"From": "+14155551234",
"Body": "",
"MediaUrl": null,
"Callback": {},
"Tags": []
}
Values Filtered Out
"Body": ""
: Removed due toallowEmptyValue: false
"MediaUrl": null
: Removed due toallowEmptyValue: false
"Callback": {}
: Removed due toallowEmptyObject: false
"Tags": []
: Removed due toallowEmptyArray: false
Final Request Body Sent
To=+14155552671&
From=+14155551234
The filters ensures the request payload contains only meaningful data, avoiding unnecessary or empty values in requests.