How can I reliably communicate with a Gmail session with a thread ID if the user is logged into multiple accounts?

If you’re signed in to multiple Gmail accounts, Google changes the URLs to link to the account you are using. For instance:

https://mail.google.com/mail/u/0/#inbox/138d85da096d2126for convo in my main account vs https://mail.google.com/mail/u/1/#inbox/128cfe99d055805dfor the convoy in my other account.

Please note that one account has /u/0in the url and the other has u/1.

My question is: given that I used the Gmail REST API to search for the identifier of a particular thread, how can I reliably communicate with this thread? Is there any software way to ask Google which accounts the user logs into, and in what order (0, 1, 2, ...) does each account fall under?

+4
source share
1 answer

It looks like you can enable the query parameter with a name authUserthat points to the email account you want to link to:

https://mail.google.com/mail/ ?authuser=your.email.address@gmail.com # all / 138d85da096d2126

+4

All Articles