You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Gmail新UI中Message Id/ThreadId映射及API草稿URI查询设置

Answers to Your Gmail UI & API Mapping Questions

Great questions—let's break these down clearly for you:

1. Mapping Gmail Message ID/Thread ID to the New Gmail UI

The Message ID and Thread ID returned by the Gmail API are directly compatible with the new Gmail UI—no special mapping is needed. These IDs are global unique identifiers that the UI relies on under the hood to locate specific messages or threads.

To jump straight to a message or thread in the new UI:

  • For a specific message: Use the format https://mail.google.com/mail/u/[your-user-index]/#inbox/m/{messageId}. Replace [your-user-index] with your account number (like 1 for a secondary account) and {messageId} with the id value from the API response.
  • For a thread: Use https://mail.google.com/mail/u/[your-user-index]/#thread/{threadId}, replacing {threadId} with the corresponding API value.

The new UI will automatically resolve these IDs to the correct message/thread without any extra conversion steps.

2. URI Query String for Viewing API-Created Drafts in the New Gmail UI

When you create a draft via the Gmail API, the response includes a unique id field for that draft. To open this draft directly in the new Gmail UI, you need to append this draft ID to the drafts page URL using the compose parameter.

The full URI format looks like this:

https://mail.google.com/mail/u/[your-user-index]/#drafts?compose={draftId}

For example, if your user index is 1 and the draft ID from the API is 18bxyzabc123def, the URL would be:

https://mail.google.com/mail/u/1/#drafts?compose=18bxyzabc123def

This will load the new Gmail UI directly into the draft editor with your API-created draft content ready to edit or send.

内容的提问来源于stack exchange,提问作者Chris Wood

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 10:07:54