Get History
post
/rest/v19/commerce{Stage}{ProcessVarName}{MainDocVarName}/{id}/actions/{displayHistoryActionVarName}
Use this endpoint to retrieve historical changes for a transaction using using the specified XSL views.
Request
Supported Media Types
- application/json
Path Parameters
-
MainDocVarName(required): string
The variable name of the main document, note the first letter must be capitalized.
-
ProcessVarName(required): string
The variable name of the commerce process, note the first letter must be capitalized.
-
Stage(required): string
The stage variable identifies where a transaction is within the Commerce process flow. (Documents, Quotes, Agreements, or Orders)
-
displayHistoryActionVarName(required): string
The variable name of the Display History type action.
-
id(required): integer
Current unique user-side ID. This is the internal identifier for a transaction within a CPQ site.
Root Schema : Transaction-DisplayHistoryRequest
Type:
Show Source
object
-
cacheInstanceId:
string
Title:
Cache Instance Id
The unique identifier for the entry of transaction data stored in the cache. This typically is obtained from first createTransaction or OpenTransaction action and passed along in subsequent Modify/Interact action to avoid reload transaction data from db. -
criteria:
object Query Definition
Title:
Query Definition
Captures the query definition for the current resource request. -
revisionId:
string
Title:
Revision Id
The string parameter that contains the revision information.
Nested Schema : Query Definition
Type:
object
Title:
Query Definition
Captures the query definition for the current resource request.
Show Source
-
actions:
array actions
Array of actions names, whose state is requested in the state object response.
-
childDefs:
array childDefs
-
enableHierarchy:
boolean
Parameter value should be true to execute hierarchy search and sort. Default value is false.
-
excludeFieldTypes:
array excludeFieldTypes
Array of field names that you want to exclude in the response.
-
expand:
array expand
Array of child resource names that you want to expand so that the contents return with the parent in the same request.
-
expandedDomainCriteria:
array expandedDomainCriteria
Map of dynamic menu field names, whose expanded domains are requested in the state object response, to a map of criteria, which are meant for filtering dynamic menu options. The criteria map should contain the node(s) information when dynamic menus on LIG are expanded. The criteria map also contains the search string. The search strings support contains, and are case-insensitive.
-
expandedDomains:
array expandedDomains
Array of field names, whose expanded domains are requested in the state object response.
-
expandNodes:
boolean
Boolean value that only be available when enableHierarchy is true. True = all nodes will be expanded; False = All nodes will be collapsed.Default value is true.
-
fields:
array fields
Array of field names that you wanted returned in a request.
-
groups:
array groups
Array of group names, whose state is requested in the state object response.
-
limit:
integer
Positive integer value that specifies the maximum number of items returned by the server.
-
nodesExceptionList:
array nodesExceptionList
Array of document_number, recording the nodes that violate current expandNodes flag
-
offset:
integer
Non-negative integer values that specifies the index of the first item to be returned. The offset index begins at 0. By default, the offset is 0, which returns all items starting from the first item in the collection.
-
orderBy:
array orderBy
Array of field names, each optionally followed by asc or desc, that specifies the order of items returned in the response payload.
-
q:
string
Filter (a ???where???clause) to restrict the items returned in the collection. By default, no filtering is applied.
-
state:
boolean
Boolean value that specifies whether to calculate the state property. By default, this value is set to false indicating that state is not calculated.
-
totalResults:
boolean
Boolean value that specifies whether to calculate the totalResults property. By default, this value is set to false indicating that totalResults is not calculated.
Nested Schema : actions
Type:
array
Array of actions names, whose state is requested in the state object response.
Show Source
Nested Schema : childDefs
Type:
Show Source
array
-
Array of:
object Child query criteria.
Title:
Child query criteria.
Captures the query criteria for the child resource.
Nested Schema : excludeFieldTypes
Type:
array
Array of field names that you want to exclude in the response.
Show Source
Nested Schema : expand
Type:
array
Array of child resource names that you want to expand so that the contents return with the parent in the same request.
Show Source
Nested Schema : expandedDomainCriteria
Type:
array
Map of dynamic menu field names, whose expanded domains are requested in the state object response, to a map of criteria, which are meant for filtering dynamic menu options. The criteria map should contain the node(s) information when dynamic menus on LIG are expanded. The criteria map also contains the search string. The search strings support contains, and are case-insensitive.
Show Source
Nested Schema : expandedDomains
Type:
array
Array of field names, whose expanded domains are requested in the state object response.
Show Source
Nested Schema : fields
Type:
array
Array of field names that you wanted returned in a request.
Show Source
Nested Schema : groups
Type:
array
Array of group names, whose state is requested in the state object response.
Show Source
Nested Schema : nodesExceptionList
Type:
array
Array of document_number, recording the nodes that violate current expandNodes flag
Show Source
Nested Schema : orderBy
Type:
array
Array of field names, each optionally followed by asc or desc, that specifies the order of items returned in the response payload.
Show Source
Nested Schema : Child query criteria.
Type:
object
Title:
Child query criteria.
Captures the query criteria for the child resource.
Show Source
-
name:
string
Rest alias name of the child resource this query belongs to.
-
queryDef:
object Query Definition
Title:
Query Definition
Captures the query definition for the current resource request. -
recursive:
boolean
Boolean value that specifies whether this query is a recursive expand on the current child resource query.
Response
Supported Media Types
- application/json
Default Response
Root Schema : Transaction-DisplayHistoryResponse
Type:
Show Source
object
-
cacheInstanceId:
string
Title:
Cache Instance Id
The unique identifier for the entry of transaction data stored in the cache. This typically is obtained from first createTransaction or OpenTransaction action and passed along in subsequent Modify/Interact action to avoid reload transaction data from db. -
revisionId:
string
Title:
Revision Id
The string parameter that contains the revision information. -
warnings:
object warnings
Title:
warnings
warning messages
Nested Schema : warnings
Type:
object
Title:
warnings
warning messages
Show Source
-
messages:
array Messages
Title:
Messages
Array of messages that have been generated for a specific object.
Nested Schema : Messages
Type:
array
Title:
Messages
Array of messages that have been generated for a specific object.
Show Source
-
Array of:
string
warning message.
Examples
The following example shows how to retrieve historical changes for a transaction by submitting a POST request to the REST resource using cURL. For more information about cURL, see Use cURL.
curl -X POST -H "Authorization: Bearer <token>" -H "Accept: application/json" https://sitename.oracle.com/rest/v17/commerceDocumentsOraclecpqoTransaction/18097326/actions/getHistory
Request Body Resources
- historyHeader - used to specify fields for the history header in the response. Available fields: dateFormat and _history_header_key
- history - used to specify criteria for the history response. Available fields: actionName, actionVarName, changeDate, userLogin, userFirstName, userLastName, userCompany, stepVarName, saved, resetReason, performComment, reasonVarName
- historyItem - used to specify attributes for history items included in the history response. Available fields: attrName, attrVarName, docNumber, oldValue, newValue
Request Body Sample
{ "cacheInstanceId": "-1", "criteria": { "childDefs": [{ "name": "historyHeader", "queryDef": { "fields": [ "dateFormat", "_history_header_key" ], "childDefs": [{ "name": "history", "queryDef": { "limit": 1000, "offset": 0, "fields": [ "_history_key", "actionName", "actionVarName", "changeDate", "userLogin", "userFirstName", "userLastName", "userCompany", "stepVarName", "saved", "resetReason", "performComment", "reasonVarName"], "childDefs": [{ "name": "historyItem", "queryDef": { "limit": 1000, "offset": 0, "fields": ["attrName", "attrVarName", "docNumber", "oldValue", "newValue", "_history_item_key"] } } ] } } ] } } ] } }
Response Body Sample
{ "revisionId": "6,1", "documents": { "_id": 3023033799, "historyHeader": { "hasMore": false, "items": [{ "dateFormat": "MM/dd/yyyy h:mm a", "_history_header_key": 1, "history": { "offset": 0, "limit": 2, "count": 1, "hasMore": false, "items": [{ "_history_key": 3023040162, "actionName": "Save", "actionVarName": "saveWithAdvancedValidation", "changeDate": "06/13/2023 6:30 p", "userLogin": "superuser", "userFirstName": "Super", "userLastName": "User", "userCompany": "cpqqa212", "stepVarName": "start_step", "saved": null, "resetReason": null, "performComment": "-N/A-", "reasonVarName": null, "historyItem": { "offset": 0, "limit": 2, "count": 2, "hasMore": true, "items": [{ "attrVarName": "_price_net_price", "newValue": "3", "_history_item_key": "_price_net_price2", "docNumber": 2, "oldValue": "1", "attrName": "Net Price" }, { "attrVarName": "_transaction_total", "newValue": "2269", "_history_item_key": "_transaction_total1", "docNumber": 1, "oldValue": "2267", "attrName": "Transaction Total (Net)" } ] } } ] } } ] } } }