API 参考
Progress
Customer API: POST /progress
Request body
unitIdstringrequiredreportsobject[]requiredreports[].positionSecondsnumberFurthest position reached (seconds). Clients that only send this still resume and complete (by position ratio).
reports[].durationSecondsnumberreports[].completedbooleanManual 'mark complete' for non-media units; ignored for quiz units.
reports[].openedbooleanNon-media unit opened: records the first open and sets the unit to in-progress; does not complete it.
reports[].sessionIdstringBrowser-generated id of this viewing session; send the same value on every report of the session. Required for playback records (segments, play count, watch time).
reports[].segmentsnumber[][]Ranges played since the previous report as [from, to] or [from, to, speed] in media seconds. Completion uses the union of all ranges, so skipping ahead does not count.
reports[].startupMsintegerreports[].stallCountintegerreports[].stallMsintegerreports[].renditionintegerCurrent rendition height (px).
reports[].seekTargetsnumber[]Seek destinations (seconds) since the previous report.
reports[].device"desktop" | "mobile" | "tablet"litebooleanHeartbeat: when this report does not complete the unit the server skips deliverable-level completion and returns deliverable: null.
Response 200
unit"not_started" | "in-progress" | "completed"requiredunitCoveredPercentinteger | nullMedia units: share of the file watched after this report (union of watched ranges / duration, 0-100); null without a duration or range data.
deliverableobject | nullrequirednull on lite heartbeats that did not complete the unit
deliverable.idstringrequireddeliverable.percentnumberrequireddeliverable.completedbooleanrequireddeliverable.completedAtstring | nulldeliverableJustCompletedbooleanrequired
Errors
UNIT_NOT_FOUND404VALIDATION400FORBIDDEN403
curl -X POST "https://{site}/api/v1/customer/progress" \
-H "Authorization: Bearer $KANORIO_CUSTOMER_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'