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

Administration

ClosedCreate a Saved Search

Create a Saved SearchPOST method

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

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

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction


ClosedRequest Body Sample

{ "_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" } } ] } }


ClosedResponse Body Sample


ClosedDelete a Saved Search

Delete a Saved SearchDELETE method

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

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.


ClosedGet Saved Searches

Get Saved SearchesGET Method

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

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

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction


ClosedResponse Body Sample


ClosedGet a Saved Search

Get a Saved SearchGET Method

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

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

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/38678835


ClosedResponse Body Sample


ClosedUpdate a Saved Search

Update a Saved SearchPATCH method

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

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

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/3023270385


ClosedRequest Body Sample


ClosedUpdate Saved Search Access Permissions

Update Saved Search Access PermissionsPOST method

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

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

  • queryId - The unique id of the saved search

  • status - "true" indicates shared, "false" indicates unshared

hideSavedSearches

This object is used to hide / unhide access saved searches

  • queryId - The unique id of the saved search

  • status - "true" indicates hidden, "false" indicates unhidden

Response

  • 201 - The status change is successful.

  • 404 - Search or Resource not found

  • 405 - User has no access to modify the shared property of saved searches

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v17searchResources/commerceDocumentsOraclecpqoTransaction/accessSavedSearches


ClosedRequest Body Sample - Hide a Saved Search

{ "_entity": "Quote", "accessSavedSearches": [], "hideSavedSearches": [{ "queryId": 3023270385, "status": true } ] }


ClosedRequest Body Sample - Unhide a Saved Search

{ "_entity": "Quote", "accessSavedSearches": [], "hideSavedSearches": [{ "queryId": 3023270385, "status": false } ] }


ClosedRequest Body Sample - Share a Saved Search

{ "_entity": "Quote", "accessSavedSearches": [{ "queryId": 3023270385, "status": true } ], "hideSavedSearches": [] }


ClosedRequest Body Sample - Unshare a Saved Search


ClosedUpdate User Default Saved Search

Update User Default Saved SearchPOST method

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

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

  • 201 - The status change is successful

  • 404 - Search or Resource not found

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/entityPreferenceForUser


ClosedRequest Body Sample

{ "_entity": "Quote", "queryUuid": 18006983, "default": true }


ClosedUpdate Site Default Saved Search

Update Site Default Saved SearchPOST method

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

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

  • 201 - The status change is successful

  • 404 - Search or Resource not found

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v17/searchResources/commerceDocumentsOraclecpqoTransaction/entityPreferenceForSite


ClosedRequest Body Sample

{ "_entity": "Quote", "queryUuid": 15514399, "default": true }


 

Related Topics

Related Topics Link IconSee Also