Microsoft 365 Outlook API - Create Reply Draft

Hi everyone,

I built a simple scenario for answering to incoming emails with GPT and prioritizing them.

My question is about the answering part. I want the response to be drafted only, so I can check and send it manually.

I’ve tried the “Reply to a Message” and “Create a Draft Message” modules. The former doesn’t have the option to save it as a draft, the latter can only create a new message (doesn’t directly respond to the incoming mail).

I’ve looked into the Outlook API and found this: message: createReply - Microsoft Graph v1.0 | Microsoft Learn

This seems like it would get the job done. Problem is, I am not familiar at all with API requests. I’m struggling to fill in the necessary information into the Outlook API call module in Make.

I would appreciate it a lot if someone could help me with this! Thanks so much in advance!

Hey @stom

In the Outlook API call Module , In URL Box - Map the message id from your first module.

Thanks,
Sachin Shrivastava

3 Likes

Hi Sachin,

thank you, will do that :). Do I have to change anything in the other fields as well?

No, All things are correct.
Message is in your body
Message id in URL

2 Likes

Hi guys,

I am working on a similar scenario but am having an issue to write the draft in the api call. I am getting the following error:

[400] Unable to read JSON request payload. Please ensure Content-Type header is set and payload is of valid JSON format.

Any idea on how to solve that?

Thank you

Sorry to hit you up again, but I have the same error as @lemontec . I think we both would really appreciate your help haha

Okay I think I figured it out.

The API Call only accepts json format, so we have to change the format first. But now I don’t get the output I want, have to figure out how to only get the GPT response…

2 Likes

yeah that’s what i was thinking too. I will look in the afternoon and let you know if i find the solution or let me know if you find it first :slight_smile:

@stom

The solution I have found has one more step: update a message.
The API call will only create the draft response without any content, you can then use the message ID to update it with your generated content. It works well for me.

2 Likes

Hey man, thanks for this! It works. But I have the problem that the line breaks get replaced by “\n”. Do you know a way around this?
Best, Tom

1 Like

@lemontec lol i figured out we don’t even have to use the json format if the use the “update message” module anyway. this module can work with the normal gpt output. :slight_smile:

3 Likes