Hey folks, I’m scratching my head over this Gmail thing.
I’ve been trying to figure out how to view draft messages created through the Gmail API in the new Gmail interface. The old way of doing it doesn’t seem to work anymore.
Back in the day, you could just stick the message ID at the end of a URL like this:
https://mail.google.com/mail/u/1/#drafts?compose=1631caae9dbb074d
But now, the URLs look totally different. They’re super long and have all these weird characters:
https://mail.google.com/mail/u/1/#drafts?compose=jrjtXSqXwlFGnSGCQgDCdnHGVFdlpFMgzsCNgpQstQLxdLCMkjKstBmWZkCmjhWTQnpsZCJF
I can’t figure out how to make these new URLs using the IDs from the Gmail API. Anyone know how to do this? It’s driving me nuts!
I know this isn’t exactly a coding question, but I heard Google likes us to ask Gmail API stuff here. Thanks for any help!
I’ve encountered this issue as well. Unfortunately, there doesn’t seem to be a straightforward way to convert the API-generated IDs to the new URL format Google is using. It appears to be an internal encoding system that’s not publicly accessible. As a workaround, I’ve had some success using the Gmail API to fetch the draft content and then creating a new draft in the web interface. It’s not ideal, but it allows for viewing the draft content. Alternatively, you might consider using a mail client that integrates with the Gmail API directly, bypassing the need for web interface URLs altogether. Hopefully Google will address this discrepancy in future API updates.
I’ve been grappling with this issue too, and it’s been a real headache. After digging around and experimenting, I found a workaround that might help. Instead of trying to force the API-generated IDs into the new URL format, I’ve started using the Gmail API to fetch the draft content and then recreating it in the web interface.
Here’s what I do: I use the API to get the draft details, then I open a new compose window in Gmail and manually copy over the content. It’s not elegant, but it gets the job done. For drafts I access frequently, I’ve started saving them as templates in Gmail, which makes it easier to find and edit them later.
Another thing that’s helped is using labels for my drafts. I apply specific labels to drafts created via the API, making them easier to locate in the web interface. It’s not a perfect solution, but it’s made managing API-created drafts a bit less painful until Google hopefully addresses this disconnect between the API and the web interface.
hey sophialee92, i’ve run into this too! it’s a pain. from what i can tell, google changed how they handle draft ids in the interface. the api still gives the old style ids, but they don’t work in the new urls. i haven’t found a way to convert them yet. maybe someone else knows a trick?