Skip to content

feat(file): add 'file get <upload-id>'#42

Merged
4ier merged 1 commit into
mainfrom
feat/file-get
Apr 30, 2026
Merged

feat(file): add 'file get <upload-id>'#42
4ier merged 1 commit into
mainfrom
feat/file-get

Conversation

@4ier
Copy link
Copy Markdown
Owner

@4ier 4ier commented Apr 30, 2026

Wraps GET /v1/file_uploads/:id. Closes #34.

Human + JSON output; smoke-tested against a real upload.

$ notion file get <upload-id>
✓ File upload: smoke.txt
ID:             352d45fb-...
Status:         uploaded
Size:           3 bytes
Content-Type:   text/plain
Created:        2026-04-30
Expires:        2026-04-30

See issue #34 for the full spec.

…pload

Wraps GET /v1/file_uploads/:id — the dedicated endpoint for checking the
status of a file upload (pending / uploaded / expired), recovering its
content_type/size, or grabbing an existing file_upload id for re-use
inside a block.

Previously this endpoint was only reachable via:
    notion api GET /v1/file_uploads/<id>

The new command prints a human-friendly summary by default and passes
through the raw JSON with --format json.

Tests cover the full-field render and the minimal 'pending' render,
asserting only on output that goes through fmt.Println — keys rendered
via fatih/color bypass our stdout pipe capture (same pattern as the
existing search table tests).

Closes #34
@4ier 4ier merged commit 6bb0b0d into main Apr 30, 2026
4 checks passed
@4ier 4ier deleted the feat/file-get branch April 30, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

file get <upload-id>: retrieve a single file upload by id

1 participant