Create a draft reply message give an error on providing payload

289 Views Asked by At

I am hitting the Outlook Office 365 API through Postman. I tried to create a draft reply message using this URL:

POST https://outlook.office.com/api/v2.0/me/messages/{message_id}/createreply

The body contained:

body: {
  "Comment": "Sounds great! See you tomorrow."
}

but I got the following error:

{
   "error": {
      "code": "RequestBodyRead",
        "message": "The parameter 'Comment' in the request payload is not a valid parameter for the operation 'CreateReply'."
    }
}

I have used this call based on the documentation.

This issue also exists for create a draft reply all message and create a draft forward message.

1

There are 1 best solutions below

0
On

This is because you're placing comment within the body, it should stand on it's own. From this documentation:

POST https://outlook.office.com/api/beta/me/messages/AAMkADA1MTAAAAqldOAAA=/createreply
Content-Type: application/json

{
  "Comment": "Fanny, Randi, would you name the group if the project is approved, please?" 
}

Note that it is {"comment": "string"} and not body:{"comment": "string"}.