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

你说的曾经没有我的故事 提交于 2019-11-30 07:38:16

问题


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?


回答1:


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/?authuser=your.email.address@gmail.com#all/138d85da096d2126



来源:https://stackoverflow.com/questions/26188541/how-can-i-reliably-link-to-a-gmail-conversation-given-a-thread-id-if-the-user-is

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!