Forum Discussion
Using PowerShell to talk to the Office 365 Service Communications API
There's a working example here: https://blogs.technet.microsoft.com/cammurray/2014/09/23/using-powershell-to-obtain-your-tenants-office365-health-dashboard/
To get the message center events, use event type 2.
- Apr 03, 2017
Vasil, thanks for pointing me to that. One thing that concerns me about that example is that it is using the old version of the API. Note the command to get the cookie:
$cookie = (invoke-restmethod -contenttype "application/json" -method Post -uri "https://api.admin.microsoftonline.com/shdtenantcommunications.svc/Register" -body $jsonPayload).RegistrationCookie
It uses the old URI. The documentation for the old API is at https://msdn.microsoft.com/en-us/library/office/dn776043(v=office.15).aspx and says "A new version of the Office 365 Service Communications API has been released in preview mode. It is recommended that new applications be built using this version. For more information, see Office 365 Service Communications API reference (preview)."
How would I do the registration step with the new API? I don't see a Register method listed for the new API.
Michael
- cammurrayApr 04, 2017
Microsoft
I wrote the article that was originally referenced. It hasn't been updated for sometime.
The new Service Communications API appears to be in preview at this stage, but it's probably a good idea for me to get my article updated, i'll endevour to do that this week some time.
All the information on the new API appears here: https://msdn.microsoft.com/office-365/office-365-service-communications-api-reference
I would probably suggest using MSAL libraries this time around to simplify the obtainment of a token.
- Richard_PesenkoSep 17, 2018
Microsoft
Cam, did you ever figure out how to leverage the new V2 APIs with PowerShell? The V1 APIs are a lot easier to use, but the V2 APIs look like they would offer more capabilities. Also, the V2 APIs have been in preview for over a year and a half, so I wonder how much longer the V1 APIs will be supported.