Soeren
Soeren

Reputation: 711

GMail API: adding attachment to existing draft

Does the GMail REST API actually permit adding an attachment to an existing draft? The Users.drafts update endpoint seems to replace the entire draft's content with all its parts, when I really only want to add another part/attachment.

While I could theoretically fetch the entire draft and write it back, I am concerned about the possible race condition when that very draft is simultaneously being edited in the GMail user interface.

Upvotes: 1

Views: 420

Answers (1)

Tholle
Tholle

Reputation: 112787

The only way to edit an existing draft (changing text content, add an attachment, etc.) is to get the draft, edit it, and do a modify call.

Upvotes: 1

Related Questions