Get History
post
/rest/v16/commerceDocuments{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.
-
displayHistoryActionVarName(required): integer
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
-
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.
-
expandedDomains:
array expandedDomains
Array of field names, whose expanded domains are requested in the state object response.
-
fields:
array fields
Array of field names that you wanted returned in a request.
-
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.
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 : 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 : 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 : 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 -i -H "Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQg" -H "Accept: application/json" https://sitename.oracle.com/rest/v16/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": { "q": "{\"userLogin\":{\"$eq\" : \"superuser\"}}", "limit": 2, "offset": 0, "fields": ["_history_key", "actionName"], "childDefs": [{ "name": "historyItem", "queryDef": { "limit": 2, "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)" } ] } } ] } } ] } } }