Newer Version Available
Query Batches of Archived Field History Data
You can query Field Audit Trail entries stored on the FieldHistoryArchive object.
| Available in: Salesforce Classic (not available in all orgs), Lightning Experience, and the Salesforce mobile app |
| Available in: Enterprise, Performance, and Unlimited Editions |
To return a large number of results, use a URI
query.
Here’s an
example Post request.
For more information about Bulk API queries, read Get Results for a Query Job in the Bulk API 2.0 and
Bulk API Developer Guide.
1/services/data/vXX.X/jobs/query1{
2 "operation": "query",
3 "query": "SELECT ParentId, FieldHistoryType, Field, Id, NewValue, OldValueFROM FieldHistoryArchive WHERE FieldHistoryType = ‘Account’ AND CreatedDate > LAST_MONTH"
4}You can also make a CURL
request.
These
examples result in a CSV file that you can examine for auditing purposes.
1curl --include --request GET \
2--header "Authorization: Bearer token" \
3--header "Accept: text/csv" \
4https://instance.salesforce.com/services/data/vXX.X/jobs/query/750R0000000zxr8IAA/results ?maxRecords=50000