Praveen Kumar
Praveen Kumar

Reputation: 21

Outlook Mail Search Api

I will be working on the outlook mail search api and as i have read in the documentation

Outlook Rest Mail API Documentation

https://msdn.microsoft.com/en-us/office/office365/api/mail-rest-operations#get-messages

Simply querying using $search parameter:

url: https://outlook.office.com/api/beta/me/MailFolders/INBOX/messages?$select=Sender,Subject,From,CcRecipients,HasAttachments,Id,SentDateTime,ToRecipients,BccRecipients&$top=10&$skip=0&$search=sample email

With search criteria "from:" Keyword:

url: https://outlook.office.com/api/beta/me/MailFolders/INBOX/messages?$select=Sender,Subject,From,CcRecipients,HasAttachments,Id,SentDateTime,ToRecipients,BccRecipients&$top=10&$skip=0&$search=from:invitation

They have $search keyword but by using $search i am getting BAD REQUEST. According to my understanding $search is not supported by Outlook API.

Anyone has any idea how i can perform the search over the mails as i want to perform folder wise search operation?

Thanks in Advance

Upvotes: 2

Views: 1864

Answers (1)

mithril_knight
mithril_knight

Reputation: 547

G-reetings.

How about using double quotes to wrap your subject search?

Like this one

https://outlook.office.com/api/beta/me/MailFolders/INBOX/messages?$select=Sender,Subject,From,CcRecipients,HasAttachments,Id,SentDateTime,ToRecipients,BccRecipients&$top=10&$skip=0&$search="from:invitation"

Or use urlencode all along

%22from%3Ainvitation%22

Upvotes: 2

Related Questions