none
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:

    https://docs.microsoft.com/en-us/office/office-365-management-api/office-365-management-activity-api-reference#retrieving-content

    I got a token withou problem using this code:

    cls
    $ClientID = "********************"
    $ClientSecret = "********************"
    
    $loginURL = "https://login.microsoftonline.com/"
    $tenantdomain = "********************"
    
    $TenantGUID = "********************"
    $resource = "https://manage.office.com"
    
    $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)"} 
    $oauth

    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 "https://manage.office.com/api/v1.0/$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: br.linkedin.com/pub/demétrio-silva/16/aba/bb1/ Blog: https://demetriosilva.wordpress.com/ Twitter: @DemetrioSQLDBA

    Monday, February 4, 2019 9:06 PM

All replies