Skip to content

Commit 98cee79

Browse files
committed
docs(gmail): clarify web URL sync IDs
1 parent a3768d0 commit 98cee79

4 files changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@googleworkspace/cli": patch
3+
---
4+
5+
Document that Gmail web URL sync IDs are not Gmail API message or thread IDs.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,11 @@ gws gmail +send --to alice@example.com --subject "Hello" --body "Hi there"
341341
# Reply to a message
342342
gws gmail +reply --message-id MESSAGE_ID --body "Thanks!"
343343
344+
# Gmail web URL IDs such as FMfcgz... are browser sync IDs, not API IDs.
345+
# Search/list first when you need the API message or thread ID.
346+
gws gmail users messages list \
347+
--params '{"userId":"me","q":"from:alice@example.com subject:\"Quarterly report\"","maxResults":10}'
348+
344349
# Append a row to a spreadsheet
345350
gws sheets +append --spreadsheet SPREADSHEET_ID --values "Alice,95"
346351

skills/gws-gmail-read/SKILL.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ gws gmail +read --id 18f1a2b3c4d --format json | jq '.body'
4545

4646
- Converts HTML-only messages to plain text automatically.
4747
- Handles multipart/alternative and base64 decoding.
48+
- The `--id` value must be a Gmail API message ID. Opaque Gmail web URL IDs
49+
such as `FMfcgz...` are browser sync IDs and are not accepted by the Gmail
50+
API; search or list messages first when you only have a browser URL.
4851

4952
## See Also
5053

skills/gws-gmail/SKILL.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,17 @@ gws schema gmail.<resource>.<method>
5959

6060
Use `gws schema` output to build your `--params` and `--json` flags.
6161

62+
## Gmail IDs
63+
64+
Gmail API methods require API message or thread IDs, not browser URL sync IDs.
65+
Recent Gmail web URLs often end with opaque IDs such as `FMfcgz...`; passing
66+
those values to `users.messages.get` or `users.threads.get` returns
67+
`Invalid id value`.
68+
69+
To act on a message you are viewing in Gmail, first locate the API ID with a
70+
query you can verify:
71+
72+
```bash
73+
gws gmail users messages list --params '{"userId":"me","q":"from:alice@example.com subject:\"Quarterly report\"","maxResults":10}'
74+
gws gmail users messages get --params '{"userId":"me","id":"API_MESSAGE_ID"}'
75+
```

0 commit comments

Comments
 (0)