مسودة: يصف هذا التوثيق أوكتا فيديو كما ستكون عند الإطلاق، وقد لا تكون بعض الميزات متاحة بعد.
OctaVideoالتوثيق

Issue a playback OTP

POST
/playback/otp

Issues a one-time password (OTP) that lets one viewer play one video, and returns the embed_url to load in an iframe.

Call this from your server each time a signed-in viewer opens a video page, and never expose your library key to the browser. An OTP can be used once and expires after ttl_seconds (5 minutes by default).

Always pass user_id: it makes one person count as one unique viewer across devices.

The video must be ready, otherwise the response is 409 with the code video_not_ready.

Authorization

AccessKey
headerAccessKey<token>

The private key of a library, starting with ovk_. Copy it from API & embeds in the console, keep it on your server, and rotate it there if it leaks.

Header Parameters

AccessKey*string

The library's private key. Same value as the AccessKey security scheme; listed here so code samples include it.

Request Body

application/json
  1. body
video_id*string

The video to play. It must be ready.

Formatuuid
user_id?string

Your own ID for the viewer: printable ASCII, no spaces. Used to count unique viewers across devices.

Lengthlength <= 128
ttl_seconds?integer

How long the OTP stays valid before it is used.

Range1 <= value <= 86400
Default300

Response Body

The OTP and the embed URL.

application/json
  1. response
data*
Example Request
curl -X POST 'https://api.octavideo.tech/api/v1/playback/otp' \  -H 'AccessKey: ovk_YOUR_LIBRARY_PRIVATE_KEY' \  -H 'Content-Type: application/json' \  -d '{  "video_id": "6f1c2b9e-4a7d-4f3e-9b8a-2d5c7e1f0a34",  "user_id": "student-4821",  "ttl_seconds": 300}'
Example Response
{  "data": {    "otp": "Zx8kQ2mVb7nR4tY1uW9eA3sD6fG0hJ5kL2pO8iU7yT4",    "expires_at": "2026-10-25T09:35:00Z",    "embed_url": "https://player.octavideo.tech/embed/0b8e5d3a-1c2f-4e6a-8b7d-9f0a1b2c3d4e/6f1c2b9e-4a7d-4f3e-9b8a-2d5c7e1f0a34?otp=Zx8kQ2mVb7nR4tY1uW9eA3sD6fG0hJ5kL2pO8iU7yT4"  }}