Docs‎ > ‎CA Live API Creator‎ > ‎Create‎ > ‎Resources‎ > ‎REST APIs‎ > ‎Data Integration‎ > ‎MongoDB Integration‎ > ‎

Audit User Transactions

API Properties/Settings Setup
Each Project can be enabled to track PUT, POST, DELETE, and Authentication logon transactions.  Use the API Properties/ Settings tab.  Select the Audit User  Transaction check box.

MongoDB Setup
All transactions will first be written to MongoDB - create a custom resource named _USER_TX_AUDIT_ that will point to the MongoDB server, database, and collection that hold the audit transaction summaries.

Hint: To filter out Read requests use the Filter box under details and set the filter to:
{actionType: { $ne: 'R'}}

How it works
All REST requests for a specific project that enables the audit feature will record the old and new value for change at nest level '0' (the starting point).  All additional transactions are stored in a summary that touch other tables (cascaded updates or inserts).  One transaction is recorded for each insert if a batch  insert is posted.  We use a background thread that is started as the system is started to write to the MongoDB table every few seconds.  After the transaction is written it will look for a MongoDB custom resource named _USER_TX_AUDIT_. If the server does not respond - it will not try to write to MongoDB again.  If a new resource is created, the server must be restarted to take effect of the new MongoDB resource.