0

I am using outlook rest api v2 (https://msdn.microsoft.com/en-us/office/office365/api/api-catalog)

What is the maximum URL length which is 'safe' for a get request. In my case i would like to request the messages from a group of several conversations. I came up with a request looking something like this (assume conversation IDs are different):

https://outlook.office.com/api/v2.0/me/mailfolders/inbox/messages?$filter=ConversationId eq 'AAQkADNjZDVkNTljLTMwNmEtNDM1Yi1iZjgyLTAwNTgzYzBmNDc4NQAQAA6kWdKUPhNGknn6sPucTnE=' or ConversationId eq 'AAQkADNjZDVkNTljLTMwNmEtNDM1Yi1iZjgyLTAwNTgzYzBmNDc4NQAQAA6kWdKUPhNGknn6sPucTnE=' or ConversationId eq 'AAQkADNjZDVkNTljLTMwNmEtNDM1Yi1iZjgyLTAwNTgzYzBmNDc4NQAQAA6kWdKUPhNGknn6sPucTnE='

I was wondering how many of those 'or' clauses can i safely join in one request. Are there any limitations in Outlook API aside from the 'standard' URL length limitations?

  • It looks like ODATA 'or' requests are limited to 10 items. – Benoit Patra Feb 10 '17 at 17:30
  • Possible duplicate of [Best way to achieve Conversation view for mail folder using Outlook REST API](http://stackoverflow.com/questions/41161515/best-way-to-achieve-conversation-view-for-mail-folder-using-outlook-rest-api) – Benoit Patra Feb 10 '17 at 17:31
  • Retrieving mail "by conversation" is a requested feature on uservoice. Consider upvoting https://officespdev.uservoice.com/forums/224641-feature-requests-and-feedback/suggestions/18765490-be-able-to-fetch-mails-by-conversations-in-folde – Benoit Patra Mar 29 '17 at 17:23

1 Answers1

0

You should rather use $batch (documented here: https://msdn.microsoft.com/en-us/office/office365/api/batch-outlook-rest-requests).

Put each filter in its own query. I believe you can make up to 20 requests.

Yogesh
  • 2,198
  • 1
  • 19
  • 28
  • I considered this approach as well. The thing is that i also need to page through the requests, since it may not return all the messages the first time. Paging and determining when all messages have arrived seems to be messier with the batch approach... – Yordana Dekova Feb 10 '17 at 12:32
  • Add a decent $top and that might be enough to cover most cases for you. Handling next page links wouldn't be that difficult either, you just add them to the next set of batch. – Yogesh Feb 10 '17 at 14:55