How can I reliably link to a Gmail conversation given a thread ID if the user is logged into multiple accounts?
Asked Answered
T

1

6

If you're logged into multiple Gmail accounts, Google changes the URLs to reference which account you're currently using. For example:

https://mail.google.com/mail/u/0/#inbox/138d85da096d2126 for a convo in my primary account vs https://mail.google.com/mail/u/1/#inbox/128cfe99d055805d for a convo in another one of my accounts.

Note that one account has /u/0 in the URL and the other has u/1.

My question is: given that I've used the Gmail REST API to find the ID of a particular thread, how can I reliably link to that thread? Is there any programmatic way to ask Google which accounts the user is logged into, and what sequence (0, 1, 2, ...) each account falls under?

Trauner answered 4/10, 2014 at 0:45 Comment(0)
T
9

Looks like you can include a query parameter called authUser that specifies the email account you want to link to:

https://mail.google.com/mail/[email protected]#all/138d85da096d2126

Trauner answered 15/10, 2014 at 19:7 Comment(3)
Hmm, I just tried it and it worked. What's happening when you try it?Trauner
if your account isnt logged in, it doesnt prompt you to log into that user. it just tries using the /0/ accountJacintajacinth
Correct, this only works for users who are logged in.Trauner

© 2022 - 2024 — McMap. All rights reserved.