I’m having trouble with the Office 365 Management Activity API. No matter what time range I specify in my request, it always sends back info from the last 24 hours. I’ve tried asking for 3 hours of data and even 3 days, but it’s always the same result.
Here’s an example of the URL I’m using:
https://manage.office.com/api/v1.0/activity/feed/subscriptions/content?PublisherIdentifier=123ABC&contentType=Audit.SharePoint&startTime=2023-11-24T10:00:00Z&endTime=2023-11-24T13:00:00Z
The weird thing is, when I get a nextpage URI in the response, its starttime and endtime are set to cover the past 24 hours.
Has anyone else run into this? Any ideas on how to fix it? I’m pretty stumped!
I’ve been wrestling with this exact problem for months, and it’s been a real headache. Here’s what I’ve learned: the API seems to have a mind of its own when it comes to time ranges. What’s worked for me is to implement a caching system on my end. I fetch data every 24 hours and store it locally. Then, when I need specific time ranges, I pull from my cache instead of relying on the API’s quirks.
It’s not ideal, but it gets the job done. You might also want to look into using the delta query feature if you haven’t already. It can help with incremental data retrieval, which might sidestep some of these timing issues.
If all else fails, you might need to bite the bullet and adapt your code to work with the 24-hour data dumps. It’s frustrating, but sometimes you’ve got to work with the quirks of the system you’re dealing with.
I’ve encountered a similar issue with the O365 Management API. From my experience, the API tends to buffer data and doesn’t always provide real-time results. This behavior is likely intentional to ensure data consistency and completeness.
A workaround I’ve found effective is to request a larger time range than needed, then filter the results on your end. For instance, if you need 3 hours of data, request 24-48 hours and process only the relevant entries.
Also, check your API permissions and ensure you’re using the correct content type. Sometimes, certain event types have different data retention policies.
If the issue persists, it might be worth reaching out to Microsoft Support. They can provide more insight into any known limitations or potential configuration issues on your tenant.
yo, i’ve seen this too. it’s super annoying! the api is kinda wonky with time ranges. what i do is grab a bigger chunk of data and then sort thru it myself. it’s not perfect but it works. maybe try hitting up ms support if u need it to be more precise?