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