user2111747
user2111747

Reputation: 25

GMail Link to Draft

I've created a Gmail draft by using the API. I got the folowing data:

{
 "id": "r-5124711675755XXXXXXX",
 "message": {
 "id": "1660c28d2XXXXXXXX",
 "threadId": "1660c28d2XXXXXXXX",
 "labelIds": [
 "DRAFT"
 ]
}

}

Now i wanna open my newly created draft in my browser by calling the URL:

https://mail.google.com/mail/u/0/#drafts?compose=CXXXXXXXXXXXXXxxxXXXXXXXXXXXXxxxXzrTZcJkDlnZdSMRLCMqkPfsVFRxrxPmNjhNScgV

But where i get the value compose=CXXXXXXXXXXXXXxxxXXXXXXXXXXXXxxxXzrTZcJkDlnZdSMRLCMqkPfsVFRxrxPmNjhNScgV??

Upvotes: 1

Views: 2102

Answers (2)

carlesgg97
carlesgg97

Reputation: 4430

A bit late to the party, but you can simply do the following concatenation:

https://mail.google.com/mail/#all/<threadId>

This will open the draft's thread from which you can edit it.

Upvotes: 1

payne
payne

Reputation: 14177

In the current Gmail UI, the id seems to be the draft message ID returned by the API.

From your example, the compose URL would be:

https://mail.google.com/mail/u/0/#drafts?compose=1660c28d2XXXXXXXX

NOTE: I don't see anywhere in the docs where this is defined/supported behavior. It may work with the current Gmail UI, and then break with a future version.

Here is some information about the new Gmail UI: How does a Gmail message Id or ThreadId map to the new Gmail UI?

Upvotes: 0

Related Questions