Office 365 Management Activity API Reference RRS feed

  • Question

  • Hi folks,

    I need to consume O365 Rest API to query Power BI Audit Log

    Looking at this site there is a little documentation:

    I got a token withou problem using this code:

    $ClientID = "********************"
    $ClientSecret = "********************"
    $loginURL = ""
    $tenantdomain = "********************"
    $TenantGUID = "********************"
    $resource = ""
    $body = @{grant_type="client_credentials";resource=$resource;client_id=$ClientID;client_secret=$ClientSecret}
    $oauth = Invoke-RestMethod -Method Post -Uri $loginURL/$tenantdomain/oauth2/token?api-version=1.0 -Body $body
    $headerParams = @{'Authorization'="$($oauth.token_type) $($oauth.access_token)"} 

    But I dont see documentation about how to query Audit Logs. I see the content type called "Audit.General (includes all other workloads not included in the previous content types)". But I need a documentation about methods of this API

    I tried execute the code below but does not work

    Invoke-WebRequest -Method Get -Headers $headerParams -Uri "$tenantGUID/activity/feed/subscriptions/content?contentType=Audit.General"

    Demétrio Silva DBA e Sharepoint Administrator Senior SQL Server Database Administrator | Developer | BI SharePoint Administrator PowerShell Script Developer MCP | MCTS | MCITP | MCSA | MCT LinkedIn:étrio-silva/16/aba/bb1/ Blog: Twitter: @DemetrioSQLDBA

    Monday, February 4, 2019 9:06 PM

All replies