企业微信(WeCom)-办公 icon

企业微信(WeCom)-办公

企业微信办公功能 - 文档、微盘、邮件、日程、待办、会议、直播、打卡、审批、汇报、人事、会议室、紧急通知、公费电话

Actions298

文档 → [素材管理] 上传文档文件

AI-generated

Summary

上传文档文件到企业微信文档管理

Inputs

  • docid (required) — 文档ID,通过新建文档接口创建后获得
  • fileName — 文件名,最多 255 个字符(英文算 1 个,汉字算 2 个),可留空以使用二进制数据中的文件名
  • binaryProperty (required) — 要上传的文件所在的二进制属性名称,支持直接上传(≤10MB)或分块上传(≤20GB)

Output shape

a single JSON object representing the API response, containing the uploaded document's media identifier and error information

On success the object includes media_id (string) and errcode (0 on success) with errmsg; on failure errcode is non‑zero and errmsg describes the error. The response is always a single object.

Examples

Example 1: Upload a PDF file with a known docid

docid: doc_12345, fileName: report.pdf, binaryProperty: data

Example 2: Upload using default filename from binary data

docid: doc_67890, binaryProperty: data

Example 3: Upload without specifying filename

docid: doc_xxxxxx, binaryProperty: data, fileName: (empty)

Links

Discussion