Preview upload document
preview_upload_documentPreview a document attachment to a weclapp record without upload.
Inline: only after the user explicitly confirms, call execute_approved(approval_token=approval.token, payload={**execution.payload, "content_base64": content_base64}). Keep approved fields unchanged; add matching bytes INSIDE payload. No separate base64 parameter or file.
Args: entity_id: Receiving record id. file_name: Non-empty stored name. content_sha256: SHA-256 of exact bytes. content_type: Detected MIME (PDF, image, Office, text/csv). bytes: Exact length (inline max ~1.5 MB). entity_name: DOCUMENTABLE_ENTITIES type; alias entity_type. description: Optional, max 4000 chars. Returns: Token bound to target, MIME, digest, length; comments validate parent. preconditions: Update access; record exists. post_effects: Single-use token; no upload. Guarded routes:
transport="agent_upload" (no inline fields, 20 MB): native file or connector file_path; same file at execute.
transport="agent_upload_batch": entity_name and connector file_paths (2–10 distinct targets, 20 MB); no entity_id.
Status: only upload_intent_ref; read-only.
Article image: entity_name="article", target="image", article_image={article_image_id? (replace), main_image?}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | ||
| bytes | No | ||
| target | No | ||
| entity_id | No | ||
| file_name | No | ||
| transport | No | ||
| description | No | ||
| entity_name | No | ||
| entity_type | No | ||
| content_type | No | ||
| article_image | No | ||
| content_sha256 | No | ||
| correlation_id | No | ||
| upload_intent_ref | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||