You need to sign in to do that
Don't have an account?

Access to Setup Audit Trail via APEX / Webservice API
Hello,
I have been looking for a way to access the setup audit trail programatically, using apex or webservice api. But without any luck.
Is there a way to achieve this..
Maybe by using some URL Tricks ?
The basic requirement is to get a list of all the actions performed by a user in a given time (as displayed in the setup audit trail). It would be great if I could simply query that from some Table ?
Any Ideas , Leads, Comments please.
You can't query this table directly, although you could, if you were so inclined, use a PageReference to the link and call the getContent function. This should allow you to retrieve the contents of the audit trail as a CSV. I'm not entirely sure how reliable this method would be, but in lieu of a standard API, your options are fairly limited. And you would have to process each row instead of filtering by user.
List<SetupAuditTrail> stuffDoneByConsultants =
[SELECT Id,
Action,
CreatedBy.Name,
CreatedDate,
Display,
Section
FROM SetupAuditTrail
WHERE CreatedBy.Email LIKE '%xyzconsulting.com%'];