Search
The Search API is used to read by the specific search fields defined in the search tab of the resource definition. The developer can invoke the search API using:
http://<instanceurl>/oms/api/v1/{ResourceName}/search/{SearchName}
{SearchName} is the name of the search being invoked.
The devloper will need to provide filters in the JSONObject. They can also provide optional pageSize and pageNo.
Sample input JSON
{
"pageSize"
:
50
,
"page"
:
1
,
"filters"
: {
"TypeName"
:
"sampleValue"
,
"Name"
:
"sampleValue"
}
}
pageSize: Number of records per page. If not provided, a default pageSize of 50 will be used. pageSize is for the top-level record (not the children). For example, if you have 100 top-level records, and each has two child records, then a pageSize of 50 would fetch 50 top-level records in 1 page, and each top-level would include their 2 child records.
page: The page to be returned starting with 1 for the first page. If not provided, page 1 will be fetched by default.
filters: fields defined for a search in JSONObject format
Sample JSON response:
{
"records"
: [
{
"TypeName"
:
"Retailer"
,
"Description"
:
"Progressive Retailer Value Chain"
,
"Name"
:
"ProgressiveRetailer"
,
"Active"
:
true
,
"StartDayOfWeek"
:
"SUNDAY"
}
],
"hasMorePages"
:
false
,
"pageSize"
:
50
,
"page"
:
1
}
records: Array of models matching the search criteria.
hasMorePages: Indicates if there are more records to fetch beyond the pageSize provided.
pageSize: Number of records per page. If not provided on input, default pageSize of 50 will be used.
page: The page returned.
Along with filter fields, developer can optionally provide the level(s) and MDFs to fetch. If level and MDFs are not provided, all levels and MDF fields provided in the definition section will be retrieved.
For detailed sample requests and responses, please check the swagger documentation.