Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Office365 Reporting REST API - "The query is invalid."

Tags:

rest

office365

How come I'm able to query Office365's Reporting API using the following request:

https://reports.office365.com/ecp/reportingwebservice/reporting.svc/MessageTrace?$select=Subject,SenderAddress,RecipientAddress,Status,Received,Received&$filter=SenderAddress eq '[email protected]' and RecipientAddress eq '[email protected]' and StartDate eq datetime'2016-10-01T00:00:00' and EndDate eq datetime'2016-10-03T00:00:00'

but when I modify it to filter on the subject as well, it returns an error:

https://reports.office365.com/ecp/reportingwebservice/reporting.svc/MessageTrace?$select=Subject,SenderAddress,RecipientAddress,Status,Received,Received&$filter=SenderAddress eq '[email protected]' and RecipientAddress eq '[email protected]' and StartDate eq datetime'2016-10-01T00:00:00' and EndDate eq datetime'2016-10-03T00:00:00' and Subject eq 'Test'

{ "odata.error": { "code": "InvalidQueryException", "message": { "lang": "", "value": "The query is invalid." } } }

like image 418
Paul Calabro Avatar asked Oct 04 '16 06:10

Paul Calabro


1 Answers

try something like

startswith(Subject,'Test')
like image 69
davcup Avatar answered Sep 21 '22 16:09

davcup