I am able to create audit log report using UI of Sharepoint but everytime I have to run a custom report. I have to generate this log automatically using Programming. I have gone through internet and found that SPAuditQuery Can be use to obtain Audit Logs But How? Or how can i use office 365 management api to generate "Edit User & Permission". In Which type of application we can use it? by the way I am using SharePoint Hosted addin.


There is no CSOM/JSOM to generate SharePoint site collection audit logs; the class you referenced is for SharePoint on-prem only.

In general, you shouldn't be using site collection audit logging in SharePoint Online, rather use the Office 365 Security and Compliance center audit logs. Take a look into the Office 365 Management Activity API reference for a potential API that may fit your requirements.

| improve this answer | |
  • In documentation which you have provided, What will be the "REDIRECT URI", btw i have developed Sharepoint Hosted add-in – Amardeep Gupta Jan 1 '19 at 7:21
  • I have to Consume Office 365 Management Activity Api from SharePoint hosted add-in – Amardeep Gupta Jan 1 '19 at 7:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.