After gws gmail +send --draft, the CLI prints this tip:
Tip: copy the draft "id" from the response above, then send with:
gws gmail users.drafts.send --body '{"id":"<draft-id>"}'
Both halves of that command are wrong, so following the tip fails twice:
-
gws gmail users.drafts.send --body '{"id":"..."}'
→ error: unrecognized subcommand 'users.drafts.send'
Subcommands are space-separated: users drafts send.
-
gws gmail users drafts send --params '{"userId":"me"}' --body '{"id":"..."}'
→ error: unexpected argument '--body' found
The request-body flag is --json, not --body.
Putting the id in --params instead returns HTTP 400 Invalid draft, since it goes to the query string rather than the request body.
What works:
gws gmail users drafts send --params '{"userId":"me"}' --json '{"id":"<draft-id>"}'
Suggested fix: update the tip's second line to the working form.
Environment: gws 0.22.5 (npm @googleworkspace/cli, current latest), macOS arm64.
After
gws gmail +send --draft, the CLI prints this tip:Both halves of that command are wrong, so following the tip fails twice:
gws gmail users.drafts.send --body '{"id":"..."}'→
error: unrecognized subcommand 'users.drafts.send'Subcommands are space-separated:
users drafts send.gws gmail users drafts send --params '{"userId":"me"}' --body '{"id":"..."}'→
error: unexpected argument '--body' foundThe request-body flag is
--json, not--body.Putting the id in
--paramsinstead returns HTTP 400Invalid draft, since it goes to the query string rather than the request body.What works:
Suggested fix: update the tip's second line to the working form.
Environment: gws 0.22.5 (npm
@googleworkspace/cli, current latest), macOS arm64.