0

I'm trying to get messages from office365 and filter the From property. If I don't do the filter part, I get the messages as expected. I just don't know what to put in the filter string...

This is what i've done:

MSOutlookFolderFetcher *folderFetcher = [[self.client getMe] getFoldersById:folderID];
NSURLSessionTask *task = [[[[[[folderFetcher getMessages] top:10] skip:0] orderBy:@"DateTimeReceived"] filter:[NSString stringWithFormat:@"From.EmailAddress.Address eq '%@'",emailAddress]] read:^(NSArray<MSOutlookMessage> *messages, MSODataException *error) {


    completion(messages);
}];

[task resume];

I get the following error:

Code: 400

Meassage: "Cannot resolve the OData request URL."

This is the link to their documentary: http://www.odata.org/documentation/odata-version-2-0/uri-conventions#FilterSystemQueryOption

I've tried several options, with quotes, without them... with "=" and with "eq" as their documentation says... Nothing goes.

Does anyone knows the answer??

Thanks

Jason Johnston
  • 17,194
  • 2
  • 20
  • 34
Nimrod Shai
  • 1,149
  • 13
  • 26

1 Answers1

1

The Office 365 APIs don't currently support filtering on complex types. From is a complex type unfortunately. From https://msdn.microsoft.com/office/office365/APi/complex-types-for-mail-contacts-calendar#UseODataqueryparameters: "Note You cannot use $filter with complex types."

Jason Johnston
  • 17,194
  • 2
  • 20
  • 34