Skip to main content
POST
在管理 API 主机 (api.scanova.io) 上上传文件,使用您的原始管理 API 密钥进行身份验证。
file
必填
要上传的文件。file 或 upload 二者必须提供其一。
file
file 的别名 —— 提供其中一个即可。
string
以逗号分隔的类别,用于限制验证范围(image、video、audio、pdf、doc、script)。各类别的验收标准见列出允许的文件类型。
string
此文件的用途:avatar、qr_logo、qr_content、poster、qr_image、profile_pic、banner、smart、thumbnail,或 unknown(默认)。
string
自由文本类别标签,例如 QR 类别 slug 或 "Custom Design"。
integer
一个批量媒体批次的 id,来自创建批量媒体批次,用于将此上传与其关联。

验证

  • 扩展名和 MIME 类型必须同时存在于检测到的 file_type 类别的允许列表中 —— 不一致的情况(例如实际是 PDF 却带有 .png 扩展名)将被拒绝。
  • 大小根据类别限制进行检查 —— 但 pdf/doc 文件除外,此时账户的计划配额 DOCUMENT_FILE_SIZE(以 MB 为单位)会覆盖静态上限。
  • JavaScript (.js) 上传会在大小检查之前被解析,以确认其为语法有效的 JS。
  • SVG 会被扫描是否嵌入了脚本,若发现则拒绝。
  • 没有扩展名的文件一律被拒绝。
上述任何验证错误都会返回 400,并附带说明问题的消息。

相关内容

授权

Authorization
string
header
必填

Send your Management API key as the raw value of the Authorization header — no "Bearer " or "Token " prefix, and no other characters. Example: Authorization: YOUR_API_KEY. A header containing more than one space-separated part is rejected outright. Requests also require the request's Host header to be the management API host (e.g. api.scanova.io) — the same key sent to the regular API host will not authenticate.

响应

File uploaded.