LMS & Developer API Developer Integration

Integrating a DRM Video Player With Any LMS via REST API in 5 Minutes

ClickStream Editorial Team Updated: 2026-12-06 3 min read
Quick Direct Answer (TL;DR)

To integrate Click Stream into Laravel, WordPress, Moodle, or any custom LMS, your backend server calls POST /api/v1/encrypt-video with your private X-API-Key header. The endpoint returns an embed_token and universal_play_url that automatically launches native protected Click Stream apps across Windows, macOS, Android, and iOS.

Key Takeaways:
  • Store your X-API-Key strictly inside backend environment variables (.env) and never expose it in frontend browser JavaScript or mobile bundles.
  • One server-side POST call returns both embed_token and the cross-platform /play launch URL.
  • Control per-lecture watch history persistence directly via allow_history flags.
  • Download the pre-configured Postman Collection from Studio Settings to test integration in minutes.

The Golden Rule of Secure LMS Integration

Never call Click Stream’s encryption endpoint directly from client-side React, Vue, or mobile UI code. Your LMS backend must verify the student’s active course enrollment first, request or retrieve the protected link server-to-server, and pass only the resulting launch URL to the authenticated student.

This separation ensures credentials remain strictly confidential while giving you full control over enrollment rules, coupons, and expiration policies.

Server-Side Code Example (Laravel HTTP Client)

Send a single authenticated POST request from your backend controller or queue worker when publishing a new lecture.

Laravel HTTP Client & 200 OK JSON Output
$response = Http::withHeaders([
    'X-API-Key' => config('services.clickstream.token'),
])->post('https://click-stream.net/api/v1/encrypt-video', [
    'youtube_url'   => 'https://youtu.be/LECTURE_ID',
    'title'         => 'Chapter 04 — Final Revision',
    'allow_history' => true,
])->json();

// Response (200 OK):
// {
//   "status": "success",
//   "embed_token": "cs_9f82a7c4...",
//   "universal_play_url": "https://click-stream.net/play?embed_token=cs_9f82a7c4...",
//   "scheme_url": "clickplayer://?embed_token=cs_9f82a7c4..."
// }

Production Readiness Checklist

Verify these four engineering standards before rolling your protected player out to enrolled cohorts.

Integration Check Recommended Standard Security & UX Impact
X-API-Key Storage Backend .env / Secrets Manager only Prevents token extraction from client source code
Verified Student Metadata Pass name & phone from authenticated LMS session Powers accurate dynamic watermarks and Student 360° reports
Per-Lecture Policy (allow_history) Toggle false for sensitive exam walkthroughs Controls whether watch history persists per lesson
Postman Verification Import official Studio Postman Collection Validates payload formats in 5 minutes prior to coding

Unify LMS Events With Studio Telemetry

Alongside playback protection, LMS backends can push enrollment, purchase, and exam-unlock events into Click Stream Activity Logs so operations teams have one cohesive timeline per student.

Frequently Asked Questions

Yes. Any platform capable of making HTTPS REST requests and rendering standard /play launch links works seamlessly.
Both your private API key, language snippets, and one-click Postman Collection download live inside Studio Settings.
Never. Keep your X-API-Key exclusively on your backend server and issue playback links only after checking student permissions.
It returns your embed_token and ready-to-launch universal_play_url synchronously in milliseconds.

Integrate Click Stream Into Your LMS Today

Create your free Studio account to access your API token, copy-paste code snippets, and ready Postman Collection.

Related Guides & Resources