Forum Discussion
Using PowerShell to talk to the Office 365 Service Communications API
Hi Michael,
The v2 API (preview) requires that you register the script/app. One immediate term option is to use the non-preview v1 API. Sample code may be found here (download the zip file and look inside the Word document). Also follow along with this blog series for additional code samples that are forthcoming.
Thanks,
Anne
- Brian TeerlynckApr 23, 2018Copper Contributor
Hello Anne,
I'm using powershell to contact the service communication API's (connecting via the azure app)
Now i am able to get data from the API's but i want to set a filter that returns only data from a specific time. Do you have an idea how this filter should be built?
Get Messages
Description:
Returns the messages about the service over a certain time range. Use the type filter to filter for "Service Incident", "Planned Maintenance", or "Message Center" messages.
Service DescriptionPath /Messages Filters StartTime Filter by Start Time (DateTimeOffset, default: ge CurrentTime - 7 days). I'm trying to create this uri with above filter:
"https://manage.office.com/api/v1.0/$tenant/ServiceComms/Messages?$filter=StartTime ge 'CurrentTime - 2 days'"
Source:
https://msdn.microsoft.com/en-us/office-365/office-365-service-communications-api-reference
Thanks in advance!
Brian
- Dean_GrossJun 01, 2018Silver Contributor
Brian Teerlynckdid you ever figure out how to get this type of filter to work? or how to get just the messages from the Message Center?