Audit Trails
Audit trails provide information about who made changes to a particular record, and when.
See Advanced Audit Trails for information about read and write access of personal data in contact, vendor, and customer records.
Audit History
Get Audit History Object Definition
lookup
List all the fields and relationships for the audit history object:
Parameters
Name | Required | Type | Description |
---|---|---|---|
object | Required | string | Use AUDITHISTORY |
Query and List Audit History
Return information about multiple types of objects based on query parameters. This object is a combination of standard object record audit trail logs, custom object record audit trail logs, user access logs, and smart event log records. You can use this function to return the aggregated history for a given user, return all records of a specific object type, return all records across a defined period of time, and so forth.
query
List the object type, source ID, and user ID for each audit history log item where the user ID is
jjackson
:
Parameters
Name | Required | Type | Description |
---|---|---|---|
object | Required | string | Use AUDITHISTORY |
filter | Optional | object | Filter expression to limit the response to only objects that match the expression. Check the value of a single field using operators such as equalto/like, or multiple fields using and/or. Query fields on related objects using the dot operator (for example, VENDOR.CREDITLIMIT on APBILL). |
select | Required | sequence | The names of the fields that you want included in the response, and an optional aggregate function such as count or sum . Returning all fields is not supported. |
orderby | Optional | object | Provide an order element with a field name and choose an ascending or descending sort order, for example: <order> |
options | Optional | object | Query options:
|
pagesize | Optional | integer | Maximum number of matching objects to return in the response, between 1 and 2000 items (Default: 100 ) |
offset | Optional | integer | Point at which to start indexing into records (Default: 0 ) |
Query and List Audit History (Legacy)
Return information about multiple types of objects based on query parameters. This object is a combination of standard object record audit trail logs, custom object record audit trail logs, user access logs, and smart event log records. You can use this function to return the aggregated history for a given user, return all records of a specific object type, return all records across a defined period of time, and so forth.
readByQuery
Parameters
Name | Required | Type | Description |
---|---|---|---|
object | Required | string | Use AUDITHISTORY |
fields | Optional | string | Comma-separated list of fields on the object to list. For best performance and predictability, limit the number of fields. To return all fields, omit the element or provide * for the value. |
query | Required | string | SQL-like query based on fields on the object. The following operators are supported: < , > , >= , <= , = , like , not like , in , not in , IS NOT NULL , IS NULL , AND , OR . Illegal XML characters must be properly encoded, and single quotes must be escaped with backslashes ('Jane\'s Deli' ). Joins are not supported. |
pagesize | Optional | integer | Custom page size between 1 and 1000 items (Default: 100 ) |
query
Fields
Name | Required | Type | Description |
---|---|---|---|
USERID | Optional | string | User ID |
ACCESSTIME | Optional | string | Timestamp in the format MM/DD/YYYY HH:MM:SS |
ACCESSMODE | Optional | string |
|
SOURCE | Optional | string | General category of the operation. Use api , csv , system , or ui |
OBJECTTYPE | Optional | string | Object type, which can be a record type such as apbill or a type such as ddsjob , userinfo , and so forth. |
OBJECTKEY | Optional | string | Unique name field of the object, which differs based on the object type. For example, on APBILL it is the RECORDNO , and on USERINFO , it is the LOGINID . |
Audit Trail Logs
List Standard Object Record Audit Trail Logs
Return information about field level changes for a given record.
getAuditTrail
List all audit trail logs for the given record:
Parameters
Name | Required | Type | Description |
---|---|---|---|
object | Required | string | Any valid audited object type. |
recordNo | Optional | integer | RECORDNO for the record to get. Required if not using objectKey . |
objectKey | Optional | string | Unique name field of the object, which differs based on the object type. For example, on APBILL it is the RECORDNO , and on USERINFO , it is the LOGINID . |
Note: If no information is returned, it means the record was created (or last modified) before the audit trail feature was implemented.
Response
auditTrailDetail
The above function returns data structured like this:
Parameters
Name | Type | Description |
---|---|---|
userId | string | User ID that performed the action |
object | string | Name of the object |
objectKey | string | Unique name field of the object, which differs based on the object type. For example, on APBILL it is the RECORDNO , and on USERINFO , it is the LOGINID . |
accessTime | datetime | Timestamp of the access |
accessMode | string | Access mode (delete, modify, create, access, workflow, activity, user action) |
workflowAction | string | Workflow action (paid, voided, etc.) |
webServer | string | Webserver that performed the action |
trackingId | string | Internal tracking ID |
ipAddress | string | IP address of the end user |
source | string | Source of the action (ui, api, csv, or system) |
Get Custom Object Record Audit Trail Logs Object Definition
lookup
List all the fields and relationships for the custom object record audit trail logs object:
Parameters
Name | Required | Type | Description |
---|---|---|---|
object | Required | string | Use ACTIVITYLOG |
Query and List Custom Object Record Audit Trail Logs
query
List the record number, object ID, relevant user, and created-at time for custom objects (IDs greater than 10000):
Parameters
Name | Required | Type | Description |
---|---|---|---|
object | Required | string | Use ACTIVITYLOG |
filter | Optional | object | Filter expression to limit the response to only objects that match the expression. Check the value of a single field using operators such as equalto/like, or multiple fields using and/or. Query fields on related objects using the dot operator (for example, VENDOR.CREDITLIMIT on APBILL). |
select | Required | sequence | The names of the fields that you want included in the response, and an optional aggregate function such as count or sum . Returning all fields is not supported. |
orderby | Optional | object | Provide an order element with a field name and choose an ascending or descending sort order, for example: <order> |
options | Optional | object | Query options:
|
pagesize | Optional | integer | Maximum number of matching objects to return in the response, between 1 and 2000 items (Default: 100 ) |
offset | Optional | integer | Point at which to start indexing into records (Default: 0 ) |
filter
Fields
Name | Required | Type | Description |
---|---|---|---|
OBJ_ID | Required | integer | ID of the record. All record IDs begin above 10000 . Use the record’s id value or find it on the record view’s System Information tab in the UI. |
CREATED_BY | Optional | integer | Created by user record number |
CREATEDBYUSER | Optional | string | Created by user ID |
CREATED_AT | Optional | datetime | Created at timestamp in format mm/dd/yyyy hh:mm:ss |
Response
ACTIVITYLOG
The above function returns data structured like this:
Parameters
Name | Type | Description |
---|---|---|
RECORDNO | integer | RECORDNO for the activity log |
OBJ_ID | integer | ID of the record. All record IDs begin above 10000 . Use the record’s id value or find it on the record view’s System Information tab in the UI. |
TRAIL_TEXT | string | Information about the change |
EMAIL_TEXT | string | |
CREATED_BY | integer | Created by user record number |
CREATEDBYUSER | string | Created by user ID |
CREATED_AT | datetime | Created at timestamp in format mm/dd/yyyy hh:mm:ss |
Query and List Custom Object Record Audit Trail Logs (Legacy)
readByQuery
List audit trail logs for all records on April 19, 2012:
Parameters
Name | Required | Type | Description |
---|---|---|---|
object | Required | string | Use ACTIVITYLOG |
fields | Optional | string | Comma-separated list of fields on the object to list. For best performance and predictability, limit the number of fields. To return all fields, omit the element or provide * for the value. |
query | Required | string | SQL-like query based on fields on the object. The following operators are supported: < , > , >= , <= , = , like , not like , in , not in , IS NOT NULL , IS NULL , AND , OR . Illegal XML characters must be properly encoded, and single quotes must be escaped with backslashes ('Jane\'s Deli' ). Joins are not supported. |
pagesize | Optional | integer | Custom page size between 1 and 1000 items (Default: 100 ) |
query
Fields
Name | Required | Type | Description |
---|---|---|---|
OBJ_ID | Required | integer | ID of the record. All record IDs begin above 10000 . Use the record’s id value or find it on the record view’s System Information tab in the UI. |
CREATED_BY | Optional | integer | Created by user record number |
CREATEDBYUSER | Optional | string | Created by user ID |
CREATED_AT | Optional | datetime | Created at timestamp in format mm/dd/yyyy hh:mm:ss |
Response
activitylog
The above function returns data structured like this:
Parameters
Name | Type | Description |
---|---|---|
RECORDNO | integer | RECORDNO for the activity log |
OBJ_ID | integer | ID of the record. All record IDs begin above 10000 . Use the record’s id value or find it on the record view’s System Information tab in the UI. |
TRAIL_TEXT | string | Information about the change |
EMAIL_TEXT | string | |
CREATED_BY | integer | Created by user record number |
CREATEDBYUSER | string | Created by user ID |
CREATED_AT | datetime | Created at timestamp in format mm/dd/yyyy hh:mm:ss |
Get Custom Object Record Audit Trail Logs
Please note this only works on custom objects.
read
Parameters
Name | Required | Type | Description |
---|---|---|---|
object | Required | string | Use ACTIVITYLOG |
keys | Required | string | Comma-separated list of log RECORDNO to get |
fields | Optional | string | Comma-separated list of fields on the object to get. To return all fields, omit the element or provide * for the value.For best performance and predictability, limit the number of fields. |
returnFormat | Optional | string | Data format for the response body:
|