3

Is there any limit on the payload size of a POST request in Graph API. This link suggests a limitation of 4MB. Is there any reference to this in the documentation?

Also is there any limitation for the outlook REST API

bala
  • 311
  • 3
  • 11

1 Answers1

3

That is correct, individual requests to Microsoft Graph must be 4MB of less. An example from the documentation for /attachments:

Since there is currently a limit of 4MB on the total size of each REST request, this limits the size of the attachment you can add to under 4MB.

Marc LaFleur
  • 31,987
  • 4
  • 37
  • 63
  • Thanks Marc. In my application I am trying to use 'POST /users/{id|userPrincipalName}/messages' API and inject message directly into users inbox. The messages might have attachments. – bala Oct 04 '17 at 12:11
  • Just to be clear, this would create a `draft` message. Is that what you're looking for? – Marc LaFleur Oct 04 '17 at 14:06
  • I read the docs again and realised 'POST /messages' can create only draft messages. I want to inject an actual message not 'draft' messages. Looks like there is no api to do so and I have to send via SMTP only. Is this right or can it be done via API? – bala Oct 05 '17 at 12:25
  • That is correct. A number of properties and events rely on the SMTP pipeline. For example, saving a `draft` wouldn't trigger a push notification to their phone's email client like an incoming email would. What about sending a message to themselves? That would push it through the correct pipeline without requiring setting up another mailbox. – Marc LaFleur Oct 05 '17 at 14:37
  • 1
    Thanks for the suggestion Mark. Sending a message to themselves would work for my use case. – bala Oct 07 '17 at 03:26