i m using sample PS posted at https://github.com/OfficeDev/O365-InvestigationTooling
when i running the API https://manage.office.com/api/v1.0/$tenantGUID/activity/feed/subscriptions/content
i get an error message
i m using sample PS posted at https://github.com/OfficeDev/O365-InvestigationTooling
when i running the API https://manage.office.com/api/v1.0/$tenantGUID/activity/feed/subscriptions/content
i get an error message
Based on my investigation, the value of variable $subs is ‘[]’ when there is no subscription at first. And this value is TRUE so the code will not execute the if branch to add the subscriptions. To fix this issue, we can run the code below manually to add the subscription at first time:
Write-Host "Looks like we need to turn on your subscriptions now."
Write-Host "#####################################################"
#Let's make sure the subscriptions are started
foreach ($wl in $workLoads)
{
Invoke-RestMethod -Method Post -Headers $headerParams -Uri "https://manage.office.com/api/v1.0/$tenantGUID/activity/feed/subscriptions/start?contentType=$wl"
}
Write-Host "#####################################################"
Or we can add the subscription using fiddler via the post below:
Authorization: Bearer {Token}
Please replace the tenant id with yours. In addition, after a subscription is created, it can take up to 12 hours for the first content blobs to become available for that subscription. More detail about Office 365 management activity API, please refer to here.
For content type you can use the below url: https://manage.office.com/api/v1.0/{tenant_id}/activity/feed/subscriptions/start?contentType={ContentType}
For more information related to Office 365 Management Activity API reference, please use below url:- https://msdn.microsoft.com/en-us/library/office/mt227394.aspx#ListCurrentSubscriptions