跳至內容
ShopentlyLearn

產品 · 下載 · 檔案

建立 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}/content

cURL 請求

: "${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"

所需權限

身份驗證
存取權杖
最低方案
STANDARD
所需權限
特定欄位所需的附加權限
  • category=internal: 檢視商品檔案 · 內部檔案catalog.product_file:read_internal
  • category=customer_document: 檢視商品檔案 · 客戶文件catalog.product_file:read_customer_document
  • category=digital: 檢視商品檔案 · 數位商品catalog.product_file:read_digital