We have a function set up to send emails via Outlook from our web app and it's been working great, but suddenly this morning my email inbox is flooded with errors from our system saying it couldn't send the email with outlook because of a bad request. The errors all look like this:
{"error":{"code":"BadRequest","message":"Invalid OData type specified: \"Microsoft.OutlookServices.FileAttachment\"","innerError":{"date":"2021-07-02T05:43:00","request-id":"XXX","client-request-id":"XXX"}}}
As I say it was working yesterday, but now it's not. And a lot of these don't have specific attachments outside of the embedded header image, which has not been changed since it was working.
Any suggestions on reasons for the error?
As announced on November 17, 2020, version 2.0 of the Outlook REST API has been deprecated. Consequently, the beta REST endpoint is also deprecated and will be fully decommissioned in November 2022. Migrate existing apps to use Microsoft Graph.
The beta version of the Outlook REST API is deprecated. As announced on November 17, 2020, version 2.0 of the Outlook REST API has been deprecated. Consequently, the beta REST endpoint is also deprecated and will be fully decommissioned in November 2022.
Re: "The OData request is not supported" when creating an Event in Teams with Graph API @diegoSpace you need to user POST method instead of PUT. and the userId is your email address 。 and the correct request is as below.
The Mail REST API is supported in all versions of the Outlook REST API. The functionality may differ depending on the specific version. Target user All Mail API requests are performed on behalf of the signed-in user unless specified.
OK so I figured this out. For some reason our attachments were still set as '#Microsoft.OutlookServices.FileAttachment' for the data type. I changed this to 'microsoft.graph.fileAttachment' and it is now working again. I don't know why it decided to force a change over today, but I'll leave this question and answer up in case someone else has the same problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With