Skip to content

docs(gmail): the --draft tip prints a send command that fails (users.drafts.send --body) #914

Description

@Rhim80

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:

  1. gws gmail users.drafts.send --body '{"id":"..."}'
    error: unrecognized subcommand 'users.drafts.send'
    Subcommands are space-separated: users drafts send.

  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions