v1

latestOpenAPI 3.0.02026-07-14202153.0 KB
Search

Search 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.

get/api/dataentities/{acronym}/search

Path parameters

acronymstring required

Identifies the kind of data

Query parameters

_fieldsstring

Fields that will be returned by document

_wherestring

Specification of filters. As seen below

_schemastring

Enter with the name of the schema to filter documents by compatibility of the schema.

_keywordstring

String to search

_sortstring

Use ASC value to sort ascending or DESC value to sort descending.

Headers

Content-Typestring required

Type of the content being sent

Acceptstring required

HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand

REST-Rangestring required

Range of documents to show

Response

Use this endpoint to search Master Data v1 documents with highly customizable filters.

Headers

Name
Content-Typeapplication/json
Acceptapplication/vnd.vtex.ds.v10+json
x-vtex-api-appKeyApp Key
x-vtex-api-appTokenApp Token
REST-RangeDefines 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.

AttributeWhat it does
_fieldsFields that will be returned by document
_whereSpecification of filters
_keywordSearch in all fields marked as searchable
_sortSort order

How to fill the querystring attributes

  1. _fields: Use the field names separated by commas. Ex. _fields=email,firstName,document.
  2. _where: See the query examples below to learn how to use filters.
  3. _keyword: Enter the value you want to query. Use quotes for a partial query. Ex. _keyword=Maria or _keyword=*Maria*
  4. _sort: Use ASC value to sort ascending or DESC value to sort descending. Ex. _sort=firstName ASC.
  5. 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