Sandeep Bhutani
Sandeep Bhutani

Reputation: 629

Set important of message in reply - Microsoft Graph API

We are using Microsoft graph api Reply API to send reply to incoming emails. Our requirement is to set importance to high for emails. However the request payload as shown below does not have any option to set the importance or other message parameters. Can someone suggest how to make a reply by changing message properties?

POST https://graph.microsoft.com/v1.0/me/messages/AAMkADA1MTAAAAqldOAAA=/reply
Content-Type: application/json

{
  "message":{  
    "toRecipients":[
      {
        "emailAddress": {
          "address":"[email protected]",
          "name":"Samantha Booth"
        }
      },
      {
        "emailAddress":{
          "address":"[email protected]",
          "name":"Randi Welch"
        }
      }
     ]
  },
  "comment": "Samantha, Randi, would you name the group please?" 
}

Please note that if we use send api, then the conversation ID will get lost and outlook will not show the mail as a thread.

Upvotes: 0

Views: 1118

Answers (1)

vicky kumar
vicky kumar

Reputation: 738

As per the doc, you can add you parameter while replying to the mail, enter image description here

You can add the any property you want to add under message object, you can see the property importance under message enter image description here

You can try with below code https://graph.microsoft.com/v1.0/me/messages/{message_id}/reply

 {
        "message": {
            "toRecipients": [
                {
                    "emailAddress": {
                        "address": "[email protected]",
                        "name": "Vicky"
                    }
                }
            ],
            "importance": "high"
        },
        "comment": "adding importance high"
    }

enter image description here

Mail with high importance enter image description here

Hope this helps

Thanks

Upvotes: 2

Related Questions