Office 365 api draft flag
NickName:Robert Sheppard Ask DateTime:2020-01-31T00:31:12

Office 365 api draft flag

I have an Office 365 extension that provides its own "Send" button which does some custom processing of the "draft" email and sends it through other means (ie not Office 365 Web). Since the email isn't sent by Outlook it never makes it to the sent folder (which makes sense). I would like to take that draft email and move it to the sent folder and remove the draft flag so it looks like it was sent by Outlook 365 Web.

        var getMessageUrl = Office.context.mailbox.restUrl + '/v2.0/me/messages/' + itemId;
        var data = JSON.stringify({ 'ToRecipients': [{ 'EmailAddress': { 'Address': '[email protected]', 'Name': 'Katie Jordan' } }], 'IsRead': true, 'IsDraft': false });
        $.ajax({
            url: getMessageUrl,
            type: 'PATCH',
            dataType: 'json',
            headers: { 'Authorization': 'Bearer ' + accessToken, 'Content-Type': 'application/json' },
            data: data
        })
            })
            .done(function (item) {
            })
            .fail(function (error) {
                var err = ""
            });

The request above works fine except the changing of the draft flag. If this isn't the solution what else can I do? I need to get a draft email into the sent folder as "Not" a draft.

Copyright Notice:Content Author:「Robert Sheppard」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/59990441/office-365-api-draft-flag

Answers
Jason Johnston 2020-01-31T13:53:00

Unfortunately you cannot create non-draft messages using the API.",


More about “Office 365 api draft flag” related questions

Office 365 api draft flag

I have an Office 365 extension that provides its own "Send" button which does some custom processing of the "draft" email and sends it through other means (ie not Office 365 Web). Since the email i...

Show Detail

Office 365 create draft reply message rest API

For Office 365 create draft reply message rest API '/messages/{message_id}/createreply' the required request body parameter is 'comment' as per the Office 365 documentation. Office 365 create draft

Show Detail

Create Draft mail in Office 365 via Web API

I have a Web API backend with EF and use AzureAD to authenticate my (office365)users of the web application that is written in AngularJS. Now I want to create a draft mail in my Web API but I don'...

Show Detail

Draft gets saved to O365 group instead of user's draft folder

When sending on behalf of a Outlook365 group's delegated email, the draft id from Office-js can not be used to lookup for the draft with the signed in user's on graph api. This will interrupt our f...

Show Detail

Create a draft email in Outlook 365 and then open it for editing

We're planning to create draft Outlook 365 emails from our ASP.NET MVC C# code which is running as an Azure App. That looks relatively straightforward in the Outlook Mail REST API documentation and...

Show Detail

Flagged messages via Office 365 REST API?

I'm looking for a way to detect & set the 'flagged' status of an email using the Office 365 REST Message API. I don't see 'Flag' listed as a property of a REST Message, though I do see it listed

Show Detail

Office 365 API for Skype

According to the Office 365 API there is no Support yet for Skype for Bussiness, is that true? Link attach https://msdn.microsoft.com/en-us/office-365/office-365-managment-apis-overview Can you pl...

Show Detail

Office 365 API for SharePoint

I am very much new to Office 365 API's. I am using Microsoft.Office365.SharePoint and Microsoft.Office365.OAuth libraries to access the documents in Office 365 sharepoint site. I am able to

Show Detail

Office 365 rest api - Search files

I'm using office 365 rest api's(http://msdn.microsoft.com/en-us/office/office365/api/files-rest-operations) to list the files. But dont find a api to search files? Is search supported in office 365...

Show Detail

Office 365 REST API - prevent global attendee updates on new calendar invite

I'm using the Office 365 Calendar REST API (specifically the "Update Events" calls) to add and remove attendees. Would like to add invitees without triggering an update to all attendees. The docs

Show Detail