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
Path Parameters
Body ()
Root Schema : Transaction-DisplayHistoryRequest
Type: object
Show Source
  • 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.
  • Query Definition
    Title: Query Definition
    Captures the query definition for the current resource request.
  • 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 of actions names, whose state is requested in the state object response.
  • childDefs
  • Parameter value should be true to execute hierarchy search and sort. Default value is false.
  • excludeFieldTypes
    Array of field names that you want to exclude in the response.
  • expand
    Array of child resource names that you want to expand so that the contents return with the parent in the same request.
  • 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 of field names, whose expanded domains are requested in the state object response.
  • 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 of field names that you wanted returned in a request.
  • groups
    Array of group names, whose state is requested in the state object response.
  • Positive integer value that specifies the maximum number of items returned by the server.
  • nodesExceptionList
    Array of document_number, recording the nodes that violate current expandNodes flag
  • 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 of field names, each optionally followed by asc or desc, that specifies the order of items returned in the response payload.
  • Filter (a ???where???clause) to restrict the items returned in the collection. By default, no filtering is applied.
  • Boolean value that specifies whether to calculate the state property. By default, this value is set to false indicating that state is not calculated.
  • 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: array
Show Source
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
Back to Top

Response

Supported Media Types

Default Response

Body ()
Root Schema : Transaction-DisplayHistoryResponse
Type: object
Show Source
  • 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.
  • Title: Revision Id
    The string parameter that contains the revision information.
  • warnings
    Title: warnings
    warning messages
Nested Schema : warnings
Type: object
Title: warnings
warning messages
Show Source
Nested Schema : Messages
Type: array
Title: Messages
Array of messages that have been generated for a specific object.
Show Source
Back to Top

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)"
                    }
                  ]
                }
              }
            ]
          }
        }
      ]
    }
  }
}
Back to Top