产品 · 下载 · 文件
创建 upload_id 后,以 multipart/form-data 上传文件,再关联到商品。下载需要 Bearer 令牌及 category 对应权限;响应直接包含文件字节,不使用公开地址或密码。 共享销售文件的明确访问规则。 new_purchases / recent_and_new / selected / all_purchasers.
GET
/api/v1/products/{product_id}/files/{file_id}/versions/{version_id}/contentcURL 请求
: "${SHOPENTLY_SHOP_URL:?}"
curl --disable --globoff --fail-with-body --silent --show-error \
--proto '=https' --connect-timeout 5 --max-time 300 \
--request GET \
--header "Authorization: Bearer ${SHOPENTLY_ACCESS_TOKEN:?}" \
--max-filesize 262144000 \
--output "${SHOPENTLY_OUTPUT_FILE:?}" \
--url "${SHOPENTLY_SHOP_URL%/}"'/api/v1/products/example/files/00000000-0000-4000-8000-000000000001/versions/00000000-0000-4000-8000-000000000001/content?category=digital'
响应
Content-Type: application/pdf
Content-Disposition: attachment; filename="manual.pdf"
所需权限
特定字段所需的附加权限
category=internal: 查看商品文件 · 内部文件catalog.product_file:read_internalcategory=customer_document: 查看商品文件 · 客户文档catalog.product_file:read_customer_documentcategory=digital: 查看商品文件 · 数字商品catalog.product_file:read_digital