Kanorio

API 参考

Units

Content Delivery API: POST /units/{id}/open

本页只有英文版。API 参考、Webhook 事件和更新日志保持英文,与代码中的字段名称、错误码一致。
Base URL https://{site}/api/v1ErrorsPagination

Parameters

  • idstring · pathrequired

Request body

  • mode"read" | "download"

Response 200

  • mode"read" | "download"required
  • urlstringrequired

    Signed URL of the original file (download, or playback when there is no streaming version).

  • expiresInintegerrequired

    Seconds. Videos: 1.5 × duration + 10 minutes, between 15 minutes and 4 hours; other files: 600.

  • titlestring | nullrequired
  • fileNamestringrequired
  • mimeTypestring | nullrequired
  • allowDownloadbooleanrequired
  • renditionsobject[]

    Playback sources: original, plus hls (adaptive-streaming master manifest on a signed path, play this one when present), thumbnails (progress-bar storyboard VTT) and poster for transcoded videos. Same validity as expiresIn.

  • renditions[].kind"original" | "mp4" | "hls" | "poster" | "thumbnails"required
  • renditions[].urlstringrequired
  • renditions[].mimeTypestringrequired
  • renditions[].widthinteger
  • renditions[].heightinteger
  • renditions[].bytesinteger
  • posterstring | null
  • thumbnailsstring | null
  • streaming"none" | "partial" | "ready"

    partial: only the lowest quality is in the manifest yet; ready: all qualities.

Errors

  • UNIT_NOT_FOUND 404
  • NOT_PREVIEW 403
curl -X POST "https://{site}/api/v1/units/{id}/open" \
  -H "Content-Type: application/json" \
  -d '{}'