v1
latestOpenAPI 3.0.02026-07-14202153.0 KBSearch documents
Search documents by the query parameters described below.
Avoid sending too many requests with wildcards (*) in the search parameters or that use the keyword parameter. This may lead to this endpoint being temporarily blocked for your account. If this happens you will receive an error with status code 503.
Path parameters
Identifies the kind of data
Query parameters
Fields that will be returned by document
Specification of filters. As seen below
Enter with the name of the schema to filter documents by compatibility of the schema.
String to search
Use ASC value to sort ascending or DESC value to sort descending.
Headers
Type of the content being sent
HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand
Range of documents to show
Response
Use this endpoint to search Master Data v1 documents with highly customizable filters.
Headers
| Name | |
|---|---|
| Content-Type | application/json |
| Accept | application/vnd.vtex.ds.v10+json |
| x-vtex-api-appKey | App Key |
| x-vtex-api-appToken | App Token |
| REST-Range | Defines the collection of documents to be returned. A range within the collection limited by 100 documents per query. |
Querystring
Learn more about Master Data v1 search queries.
| Attribute | What it does |
|---|---|
| _fields | Fields that will be returned by document |
| _where | Specification of filters |
| _keyword | Search in all fields marked as searchable |
| _sort | Sort order |
How to fill the querystring attributes
- _fields: Use the field names separated by commas. Ex. _fields=email,firstName,document.
- _where: See the query examples below to learn how to use filters.
- _keyword: Enter the value you want to query. Use quotes for a partial query. Ex. _keyword=Maria or _keyword=*Maria*
- _sort: Use ASC value to sort ascending or DESC value to sort descending. Ex. _sort=firstName ASC.
- If you want to fetch all fields use the _all parameter in the list of response fields. Ex: _fields=_all
Query Examples:
Simple filter
/dataentities/CL/search?email=my@email.com
Complex filter
/dataentities/CL/search?_where=(firstName=Jon OR lastName=Smith) OR (createdIn between 2001-01-01 AND 2016-01-01)
Filter by range
Date Range
/dataentities/CL/search?_where=createdIn between 2001-01-01 AND 2016-01-01
Range numeric fields
/dataentities/CL/search?_where=age between 18 AND 25
Partial filter
/dataentities/CL/search?firstName=*Maria*
Filter for null values
/dataentities/CL/search?_where=firstName is null
Filter for non-null values
/dataentities/CL/search?_where=firstName is not null
Filter for difference
/dataentities/CL/search?_where=firstName<>maria
Filter greater than or less than
/dataentities/CL/search?_where=number>5
/dataentities/CL/search?_where=date<2001-01-01