String functions filter resources based on text values in supported fields.
Use them inside $filter expressions.
| Function | Meaning | Example |
|---|---|---|
contains | Matches values that contain a substring. | contains(prod_title,'EC') |
startswith | Matches values that start with a prefix. | startswith(cat_ref,'C') |
endswith | Matches values that end with a suffix. | endswith(prod_ref,'-EN') |
FUNCTION_NAME(PROPERTY_NAME,'VALUE')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')String functions can be combined with logical operators:
startswith(cat_ref,'C') and contains(cat_title,'Shoes')- 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.