Saved Searches REST APIs
Overview
Oracle CPQ 24B provides the following endpoints to support Saved Searches on the new Quotes List page. The saved search endpoints support the aggregations object to grouping of items within a saved search.
For Quotes List Saved Searches the {resourceName}
variable uses the following syntax /commerceDocuments<ProcessVarName><MainDocVarName>
.
-
<ProcessVarName>
- The variable name of the commerce process, note that the first letter must be capitalized (e.g. Oraclecpqo). -
<MainDocVarName>
- The variable name of the main document, note the first letter must be capitalized (e.g. Transaction).
Administration
Description |
Use this endpoint to create a new saved search for the specified resource. |
|
---|---|---|
URI Endpoint |
/rest/v17/searchResources/{resourceVarName} |
|
Endpoint Parameters |
resourceVarName |
The unique variable name to identify the resource e.g. |
HTTP Method |
POST |
|
Request Body Parameters |
_entity |
Identifies the name of the entity this saved search is for (e.g. Quote) |
aggregations |
An object containing the attribute variable names to group by and the sorting order | |
description |
A description for the saved search |
|
fields |
An array of attributes in the saved search | |
mongoQuery |
The query specification for search results | |
name |
The name of the saved search | |
orderBy |
The sorting order for the saved search | |
Response Body Parameters |
JSON data containing the metadata for a specified array attribute |
|
_entity |
Identifies the name of the entity this saved search is for (e.g. Quote) |
|
aggregations |
The saved search grouping attribute and sort order |
|
description |
The description for the saved search |
|
fields |
An array of fields included in the saved search |
|
active |
Indicates if the saved search is active |
|
default |
Indicates if the saved search is the default search |
|
deletable |
Indicates if the saved search can be deleted |
|
hidden |
Indicates if the saved search is hidden |
|
shared |
Indicates if the saved search is shared |
|
updatable |
Indicates if the saved search can be updated |
|
mongoQuery |
The query specification for search results |
|
name |
The name of the saved search |
|
orderBy |
An array of the attribute and sort order for sorting results |
|
queryUuid |
The unique query Id |
|
savedSearchNumber |
The saved search number |
|
searchType |
The search type Allowed Values: "_user_defined_search", "_my_quotes_search", "_my_approval_search" |
|
siteLevelDefault |
Indicates if the saved search is the site level default search |
|
userId |
The user Id |
|
userKey |
The user key |
|
userLevelDefault |
Indicates if the saved search is the user's default search |
|
userName |
The user name |
https://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction
{ "_entity": "Quote", "name": "Vision Quotes In Process", "fields": ["transactionID_t", "version_t", "version_number_versionTransaction_t", "_customer_t_company_name", "transactionName_t", "status_t", "totalContractValue_t", "owner_t", "createdDate_t", "lastUpdatedDate_t", "totalAnnualValue_t"], "orderBy": ["lastUpdatedDate_t:desc"], "mongoQuery": { "$and": [{ "_customer_t_company_name": { "$regex": "Vision" } }, { "status_t": { "$eq": "OPEN" } } ] } }
{ "_entity": "Quote", "name": "Vision Quotes In Process", "updatable": true, "deletable": false, "queryUuid": 38712115, "savedSearchNumber": 38712115, "default": false, "shared": false, "active": true, "fields": ["transactionID_t", "version_t", "version_number_versionTransaction_t", "_customer_t_company_name", "transactionName_t", "status_t", "totalContractValue_t", "owner_t", "createdDate_t", "lastUpdatedDate_t", "totalAnnualValue_t"], "orderBy": ["lastUpdatedDate_t:desc"], "mongoQuery": { "$and": [{ "_customer_t_company_name": { "$regex": "Vision" } }, { "status_t": { "$eq": "OPEN" } } ] }, "searchType": "user_defined_search", "siteLevelDefault": false, "userLevelDefault": false, "hidden": false, "links": [{ "rel": "self", "href": "http://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/38712115", "name": "self" }, { "rel": "canonical", "href": "http://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/38712115", "name": "canonical" }, { "rel": "parent", "href": "http://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction", "name": "parent" } ] }
Description |
Use this endpoint to delete the specified saved search. |
|
---|---|---|
URI Endpoint |
/rest/v17/searchResources/{resourceVarName}/{searchId} |
|
Endpoint Parameters |
resourceVarName |
The unique variable name to identify the resource e.g. |
searchId |
The unique Id of the search |
|
HTTP Method |
DELETE |
|
Request Body Parameters |
None |
|
Success Response |
204 - Saved search deletion successful. 400 - If the saved search is a user / site level default or if it is a seeded search. 404 - Saved search could not be found. |
Description |
Use this endpoint to retrieve a list of saved searches for the specified resource. |
|
---|---|---|
URI Endpoint |
/rest/v17/searchResources/{resourceVarName} |
|
Endpoint Parameters |
resourceVarName |
The unique variable name to identify the resource e.g. |
HTTP Method |
GET |
|
Request Body Parameters |
None |
|
Response Body Parameters | A list of saved search items | |
_entity |
Identifies the name of the entity this saved search is for (e.g. Quote) |
|
aggregations |
The saved search grouping attribute and sort order |
|
description |
The description for the saved search |
|
fields |
An array of fields included in the saved search |
|
active |
Indicates if the saved search is active |
|
default |
Indicates if the saved search is the default search |
|
deletable |
Indicates if the saved search can be deleted |
|
hidden |
Indicates if the saved search is hidden |
|
shared |
Indicates if the saved search is shared |
|
updatable |
Indicates if the saved search can be updated |
|
mongoQuery |
The query specification for search results |
|
name |
The name of the saved search |
|
orderBy |
An array of the attribute and sort order for sorting results |
|
queryUuid |
The unique query Id |
|
savedSearchNumber |
The saved search number |
|
searchType |
The search type Allowed Values: "_user_defined_search", "_my_quotes_search", "_my_approval_search" |
|
siteLevelDefault |
Indicates if the saved search is the site level default search |
|
userId |
The user Id |
|
userKey |
The user key |
|
userLevelDefault |
Indicates if the saved search is the user's default search |
|
userName |
The user name |
https://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction
{ "items": [{ "_entity": "Quote", "name": "My Approval Search", "description": "Search will return list of transactions which requires approval of logged in user", "updatable": false, "deletable": false, "queryUuid": 36933891, "savedSearchNumber": 36933891, "default": false, "shared": true, "active": true, "userId": -1, "fields": [ "owner_t", "createdDate_t", "transactionID_t", "_customer_t_company_name", "lastUpdatedDate_t", "transactionName_t", "status_t", "totalContractValue_t", "totalAnnualValue_t", "totalOneTimeDiscount_t", "totalOneTimeNetAmount_t", "totalMonthlyListAmount_t", "lastPricedDate_t", "priceWithinPolicy_t", "version_number_versionTransaction_t", "version_t" ], "searchType": "_my_approval_search", "siteLevelDefault": false, "userLevelDefault": false, "hidden": false, "links": [{ "rel": "self", "href": "http://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/36933891", "name": "self" }, { "rel": "canonical", "href": "http://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/36933891", "name": "canonical" }, { "rel": "parent", "href": "http://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction", "name": "parent" } ] }, { "_entity": "Quote", "name": "Vision Quotes In Process", "description": "", "updatable": true, "deletable": true, "queryUuid": 38678835, "savedSearchNumber": 38678835, "default": false, "shared": false, "active": true, "userId": 4119220, "userName": "superuser", "userKey": "ecde4a3c-1924-488f-821c-d4defcfafce3", "fields": [ "transactionID_t", "version_t", "version_number_versionTransaction_t", "_customer_t_company_name", "transactionName_t", "status_t", "totalContractValue_t", "owner_t", "createdDate_t", "lastUpdatedDate_t", "totalAnnualValue_t" ], "orderBy": [ "lastUpdatedDate_t:desc" ], "mongoQuery": { "$and": [{ "_customer_t_company_name": { "$regex": "Vision" } }, { "status_t": { "$eq": "OPEN" } } ] }, "searchType": "user_defined_search", "siteLevelDefault": false, "userLevelDefault": false, "hidden": false, "links": [{ "rel": "self", "href": "http://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/38678835", "name": "self" }, { "rel": "canonical", "href": "http://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/38678835", "name": "canonical" }, { "rel": "parent", "href": "http://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction", "name": "parent" } ] }, { "_entity": "Quote", "name": "My Quotes", "description": "Search will return list of transactions that are modified in the last one year", "updatable": false, "deletable": false, "queryUuid": 38526573, "savedSearchNumber": 38526573, "default": true, "shared": true, "active": true, "userId": -1, "fields": [ "transactionID_t", "version_t", "version_number_versionTransaction_t", "_customer_t_company_name", "transactionName_t", "status_t", "totalContractValue_t", "owner_t", "createdDate_t", "lastUpdatedDate_t", "totalAnnualValue_t" ], "orderBy": [ "lastUpdatedDate_t:desc" ], "mongoQuery": { "$and": [{ "lastUpdatedDate_t": { "$gte": "2023-02-26T21:09:51Z" } } ] }, "aggregations": { "attribute": "status_t", "sort": "desc" }, "searchType": "_my_quotes_search", "siteLevelDefault": true, "userLevelDefault": false, "hidden": false, "links": [{ "rel": "self", "href": "http://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/38526573", "name": "self" }, { "rel": "canonical", "href": "http://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/38526573", "name": "canonical" }, { "rel": "parent", "href": "http://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction", "name": "parent" } ] } ], "count": 3, "hasMore": false, "limit": 10, "offset": 0, "totalResults": 3, "links": [{ "rel": "self", "href": "http://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction", "name": "self" }, { "rel": "canonical", "href": "http://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction", "name": "canonical" }, { "rel": "parent", "href": "http://sitename.oracle.com/rest/v17/searchResources", "name": "parent" } ] }
Description |
Use this endpoint to retrieve the specified saved search. |
|
---|---|---|
URI Endpoint |
/rest/v17/searchResources/{resourceVarName}/{searchId} |
|
Endpoint Parameters |
resourceVarName |
The unique variable name to identify the resource e.g. |
searchId |
The unique Id of the search |
|
HTTP Method |
GET |
|
Request Body Parameters |
None |
|
Response Body Parameters |
_entity |
Identifies the name of the entity this saved search is for (e.g. Quote) |
aggregations |
The saved search grouping attribute and sort order |
|
description |
The description for the saved search |
|
fields |
An array of fields included in the saved search |
|
active |
Indicates if the saved search is active |
|
default |
Indicates if the saved search is the default search |
|
deletable |
Indicates if the saved search can be deleted |
|
hidden |
Indicates if the saved search is hidden |
|
shared |
Indicates if the saved search is shared |
|
updatable |
Indicates if the saved search can be updated |
|
mongoQuery |
The query specification for search results |
|
name |
The name of the saved search |
|
orderBy |
An array of the attribute and sort order for sorting results |
|
queryUuid |
The unique query Id |
|
savedSearchNumber |
The saved search number |
|
searchType |
The search type Allowed Values: "_user_defined_search", "_my_quotes_search", "_my_approval_search" |
|
siteLevelDefault |
Indicates if the saved search is the site level default search |
|
userId |
The user Id |
|
userKey |
The user key |
|
userLevelDefault |
Indicates if the saved search is the user's default search |
|
userName |
The user name |
https://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/38678835
{ "_entity": "Quote", "name": "Vision Quotes In Process", "description": "", "updatable": true, "deletable": true, "queryUuid": 38678835, "savedSearchNumber": 38678835, "default": false, "shared": false, "active": true, "userId": 4119220, "userName": "superuser", "userKey": "ecde4a3c-1924-488f-821c-d4defcfafce3", "fields": [ "transactionID_t", "version_t", "version_number_versionTransaction_t", "_customer_t_company_name", "transactionName_t", "status_t", "totalContractValue_t", "owner_t", "createdDate_t", "lastUpdatedDate_t", "totalAnnualValue_t" ], "orderBy": [ "lastUpdatedDate_t:desc" ], "mongoQuery": { "$and": [{ "_customer_t_company_name": { "$regex": "Vision" } }, { "status_t": { "$eq": "OPEN" } } ] }, "searchType": "user_defined_search", "siteLevelDefault": false, "userLevelDefault": false, "hidden": false, "links": [{ "rel": "self", "href": "http://sitename.oracle.comrest/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/38678835", "name": "self" }, { "rel": "canonical", "href": "http://sitename.oracle.comrest/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/38678835", "name": "canonical" }, { "rel": "parent", "href": "http://sitename.oracle.comrest/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction", "name": "parent" } ] }
Description |
Use this endpoint to update the specified saved search. |
|
---|---|---|
URI Endpoint |
/rest/v17/searchResources/{resourceVarName}/}/{searchId} |
|
Endpoint Parameters |
resourceVarName |
The unique variable name to identify the resource e.g. |
searchId |
The unique id of the search |
|
HTTP Method |
PATCH |
|
Request Body Parameters |
None |
|
_entity |
Identifies the name of the entity this saved search is for (e.g. Quote) |
|
aggregations |
The saved search grouping attribute and sort order |
|
description |
The description for the saved search |
|
fields |
An array of fields included in the saved search |
|
mongoQuery |
The query specification for search results |
|
name |
The name of the saved search |
|
orderBy |
An array of the attribute and sort order for sorting results |
|
Success Response |
200 |
https://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/3023270385
{ "name": "Copy of Operators: Date: =", "_entity": "Quote", "fields": [ "_id" ], "mongoQuery": { "processManagerDate": { "$eq": "2020-01-01T13:45:00-08:00" } }, "keywords": [], "orderBy": [], "aggregations": {} }
Update Saved Search Access Permissions
Description |
Use this endpoint to update the hidden or shared status of a saved search. |
|
---|---|---|
URI Endpoint |
/rest/v17/searchResources/{resourceVarName}/accessSavedSearches |
|
Endpoint Parameters |
resourceVarName |
The unique variable name to identify the resource e.g. |
HTTP Method |
POST |
|
Request Body Parameters |
_entity |
Identifies the name of the entity this saved search is for (e.g. Quote) |
accessSavedSearches |
This object is used to share / unshare saved searches
|
|
hideSavedSearches |
This object is used to hide / unhide access saved searches
|
|
Response |
|
https://sitename.oracle.com/rest/v17searchResources/commerceDocumentsOraclecpqoTransaction/accessSavedSearches
Request Body Sample - Hide a Saved Search
{ "_entity": "Quote", "accessSavedSearches": [], "hideSavedSearches": [{ "queryId": 3023270385, "status": true } ] }
Request Body Sample - Unhide a Saved Search
{ "_entity": "Quote", "accessSavedSearches": [], "hideSavedSearches": [{ "queryId": 3023270385, "status": false } ] }
Request Body Sample - Share a Saved Search
{ "_entity": "Quote", "accessSavedSearches": [{ "queryId": 3023270385, "status": true } ], "hideSavedSearches": [] }
Request Body Sample - Unshare a Saved Search
{ "_entity": "Quote", "accessSavedSearches": [{ "queryId": 3023270385, "status": false } ], "hideSavedSearches": [] }
Update User Default Saved Search
Description |
Use this endpoint to update the default saved search for the user. |
|
---|---|---|
URI Endpoint |
/rest/v17/searchResources/{resourceVarName}/entityPreferenceForUser |
|
Endpoint Parameters |
resourceVarName |
The unique variable name to identify the resource e.g. |
HTTP Method |
POST |
|
Request Body Parameters |
_entity |
Identifies the name of the entity this saved search is for (e.g. Quote) |
default |
"true" indicates the specified saved search is the site default | |
queryUuid |
The unique id of the saved search |
|
Response |
|
https://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/entityPreferenceForUser
{ "_entity": "Quote", "queryUuid": 18006983, "default": true }
Update Site Default Saved Search
Description |
Use this endpoint to update the default saved search for the site. |
|
---|---|---|
URI Endpoint |
/rest/v17/searchResources/{resourceVarName}/entityPreferenceForSite |
|
Endpoint Parameters |
resourceVarName |
The unique variable name to identify the resource e.g. |
HTTP Method |
POST |
|
Request Body Parameters |
_entity |
Identifies the name of the entity this saved search is for (e.g. Quote) |
default |
"true" indicates the specified saved search is the site default | |
queryUuid |
The unique id of the saved search |
|
Response |
|
https://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/entityPreferenceForSite
{ "_entity": "Quote", "queryUuid": 15514399, "default": true }