MicrosoftDocs / office-365-management-api

Note this repo not actively maintained. To publish changes or PR review, tag @lindalu-MSFT.
https://learn.microsoft.com/en-us/office/office-365-management-api/
Creative Commons Attribution 4.0 International
40 stars 109 forks source link

filter not working for Get Messages #74

Open chathway opened 5 years ago

chathway commented 5 years ago

https://manage.office.com/api/v1.0/_tenantname_.onmicrosoft.com/ServiceComms/Messages?ID=_incidentid_

Where tenantname is our tenant name and incidentid is the incident id I want to filter on.

This should return me results for the specified incident ID only however, it returns all results. The same is true for the other filters too.

VinceRibs commented 5 years ago

I have the same issue. I found a partial solution here : https://stackoverflow.com/questions/57204681/using-or-in-filters-for-office-365-service-communications-api-or-filtering-by-mu

But some operator are not working like the OR operator making impossible to get a specific set of Ids.

jason-ra commented 4 years ago

See example here of valid format: https://community.dynamics.com/crm/b/crminthefield/posts/monitoring-dynamics-365-ce-service-health-and-messages-using-the-microsoft-office-365-service-communications-api

https://manage.office.com/api/v1.0/_tenantname_.onmicrosoft.com/ServiceComms/Messages?$filter%20eq%20'_incidentid_'

PowerShell example of CurrentStatus service:

$TenantDomain=domain.qsuper.onmicrosoft.com $Workload=Exchange Invoke-RestMethod -Uri "https://manage.office.com/api/v1.0/$($TenantDomain)/ServiceComms/CurrentStatus?`$filter=Workload%20eq%20'$($Workload)'" -Headers $headers -Method Get