Skip to content

String functions filter resources based on text values in supported fields.

Use them inside $filter expressions.

Supported functions

FunctionMeaningExample
containsMatches values that contain a substring.contains(prod_title,'EC')
startswithMatches values that start with a prefix.startswith(cat_ref,'C')
endswithMatches values that end with a suffix.endswith(prod_ref,'-EN')

Syntax

FUNCTION_NAME(PROPERTY_NAME,'VALUE')

Examples

GET https://api2.saleslayer.com/catalog/rest/Catalog/Products?$select=prod_ref,prod_title&$filter=contains(prod_title,'EC')
GET https://api2.saleslayer.com/catalog/rest/Catalog/Categories?$filter=startswith(cat_ref,'C')
GET https://api2.saleslayer.com/dam/image?$filter=contains(reference,'product')

Combining with logical operators

String functions can be combined with logical operators:

startswith(cat_ref,'C') and contains(cat_title,'Shoes')

Notes

  • Use string functions only with fields that support text filtering.
  • Use metadata endpoints to confirm field names and data types.
  • URL encode query values when necessary.