1
votes

I'm using Ruby on Rails and Office 365 REST API to get messages with $search params. My request look like that

https://outlook.office.com/api/v1.0/me/folders/inbox/messages?$search="oundatio‌n"

This request can not search emails contain "Foundatio‌n", it just can find emails have exactly "oundatio‌n" word. I want to search all emails have words contain "oundatio‌n" like "Foundatio‌n", "Soundatio‌n"... oundatio‌n .... Could you help me? Thank you very much!

1
What have you tried? I don't know this API, but common wildcard searches might include "*oundatio‌n" or "%oundatio‌n"InbetweenWeekends
Hi, thank you for reply. I tried, both of them not work.Hom nom nom nom ...
have you tried: "%oundation%" . let me know if this works.Mostafa
@Mostafa It not works bro, if using $search="%oundation%", got nothing . If $search=%oundation%, I got "message": "Syntax error: character '%' is not valid at position 0 in '%oundation%'."Hom nom nom nom ...

1 Answers

1
votes

The Outlook v1.0 REST API's search function uses the Advanced Query Syntax. As such, you can only search for a partial string if you know the beginning of that string. If you only type the end or middle part of the string, only results that begin with that part will be returned. For instance, if you were to look for my "foundation", then typing "found" will give the expected results. Only typing "ation" will not return the correct results.

Using a common wildcard character such as * will not make any difference since wildcards are not supported. As special characters are ignored in general, searching for "oundation" or "*oundation" will return the same results.

You can find further clarification on AQS's search syntax here, and you can test your queries in the Outlook OAuth Sandbox.