Getting Started
Official Site
Getting Started
Official Site
  • Document description
  • Read before you start

    • Create application
    • Docking mode
    • Account system
    • Resource download
    • Integrate your camera
    • From AppId to cloud live
      • Use for live
      • Build a dashboard
      • Add live video to SaaS
      • Fits your ACL
      • Get your accessToken
  • Light application development guide

  • Mobile application development guide

  • Cloud live development guide

  • Desktop application development guide

  • Third party development guide

  • Message push development guide

  • IoT things data model

  • HTTP interface

  • Reference documents

On this page
Direct Answer
Why the boundary matters
Responsibility split
Implementation steps
Mental model (text)
Security vs retail examples
Recommended BFF contract
Pitfalls

Security / retail SaaS: where Imou OpenAPI fits your ACL

Security / retail SaaS: where Imou OpenAPI fits your ACL

Direct Answer

Imou OpenAPI delivers devices and video streams for your developer application; your SaaS still owns tenant, site, and role ACL. Cloud credentials prove that your app may call Open Platform—not that every signed-in end user may watch every camera. Authorize in your product first, then mint short-lived play credentials (kitToken or carefully gated live URLs) on a BFF. Never put appSecret or accessToken in the browser.

Why the boundary matters

Security and retail platforms sell multi-tenant isolation as a product feature. Operators expect Camera A at Store 12 to be invisible to Tenant B. Open Platform correctly scopes what your developer app can access after devices are bound—but that scope is application-level, not your customer hierarchy.

Teams that skip this distinction often ship a shared admin accessToken path to every tenant, then discover that “cloud ACL” never existed. The fix is architectural: treat Imou as the media plane and keep tenancy in your identity and authorization layer.

Responsibility split

ConcernWho owns itTypical mechanism
App credentials (appId / appSecret)Your platform opsSecrets manager; server-only
Device binding & OpenAPI inventoryYour integration + Open PlatformBind devices; sync with listDeviceDetailsByPage
Tenant / site / role who-can-watchYour SaaSSession + ACL before any play mint
Live / playback stream deliveryImou Open PlatformgetKitToken + ImouPlayer, bindDeviceLive, OpenSDK, etc.
Audit of “who watched what”Your SaaSLog ACL decisions and session IDs in your product
Live-view quota & subscribed servicesYour AppId on Open PlatformMy Resources

OpenAPI answers: “Can this developer app operate these bound cameras?”
Your ACL answers: “May this user, in this tenant, watch this camera now?”

Both answers must be yes before a player starts.

Implementation steps

  1. Create an application on open.imoulife.com. Keep appSecret off every client surface.
  2. Bind cameras into the Open Platform developer asset pool so inventory and live APIs can see them.
  3. Obtain accessToken on the BFF (accessToken docs). Cache and refresh server-side. This token authenticates OpenAPI—not end users.
  4. Sync inventory into your tenancy model with [listDeviceDetailsByPage](https://open.imoulife.com/book/http/device/manage/query/listDeviceDetailsByPage.html) (pageSize 1–50). Map deviceId / channel to site, store, or customer records you already trust.
  5. Authorize before minting. On each live or playback request, verify tenant membership, site scope, role, and any ticket or time-window rules in your database. Deny with your own 403—do not call OpenAPI “to see what happens.”
  6. Mint short-lived play credentials only after ACL pass:
  • Interactive web → [getKitToken](https://open.imoulife.com/book/js/sdk.html) + ImouPlayer
  • HLS → [bindDeviceLive](https://open.imoulife.com/book/http/device/live/bindDeviceLive.html)
  • RTMP → [createDeviceRtmpLive](https://open.imoulife.com/book/http/device/live/createDeviceRtmpLive.html)
  • Native → OpenSDK
  1. Operate on demand. Prefer SD (streamId = 1) for multi-tile views; HD (streamId = 0) for focus. Destroy players when tiles close. Features such as talk, PTZ, or cloud playback depend on device model and subscribed services—gate UI accordingly.

Mental model (text)

End user  →  SaaS session + ACL  →  BFF  →  accessToken (server)
                                      ↓
                         getKitToken / bindDeviceLive / OpenSDK
                                      ↓
                         Browser / app gets kitToken or gated live URL only

Tenancy lives left of the BFF. Streams live right of OpenAPI. The BFF is the only bridge that may hold both.

Security vs retail examples

Security / guarding SaaS. A contractor may manage many customer sites. Your ACL must encode customer, site, shift window, and role (viewer vs PTZ operator). OpenAPI will happily mint a play credential for any camera bound to your AppId—so the contractor’s session must never be allowed to pass an arbitrary deviceId without a join through your assignment tables.

Retail / chain operations. Franchise A and Franchise B may share the same Open Platform developer app on your backend. That does not mean they share cameras. Store mapping lives in your database; listDeviceDetailsByPage is how you refresh hardware metadata, not how you decide who can watch. A district manager sees only stores in their district; a cashier may see none.

In both cases, product managers should treat “cameras in the product” as an extension of existing RBAC—not a separate “video admin token” feature.

Recommended BFF contract

Expose something like POST /api/cameras/:id/live-session that:

  1. Requires a signed-in SaaS session
  2. Loads the camera’s tenant/site from your ledger
  3. Checks role and optional ticket / time rules
  4. Uses cached accessToken to call getKitToken or bindDeviceLive
  5. Returns only kitToken or a gated HLS URL (plus expiry / streamId)

Inventory sync (listDeviceDetailsByPage) belongs on a separate, cheaper path—cron or admin refresh—so list pages never open streams. Prefer streamId = 1 (SD) for walls and 0 (HD) for single-camera inspection.

Pitfalls

  • Sharing one admin play path across tenants. If any authenticated user can request any deviceId, you have no multi-tenant video product—only a shared DVR remote.
  • Putting accessToken in ImouPlayer. kitToken ≠ accessToken. Player expects kitToken (about 2 hours TTL). Cache roughly 1 hour on the BFF; refresh before expiry.
  • Shipping appSecret or accessToken to the browser. Clients should receive only short-lived play credentials after ACL.
  • Treating live URLs as public embeds. HLS/RTMP addresses are sensitive. Issue them only through authenticated routes; rotate or unbind when access ends.
  • Prefetching every camera at login. That burns live-view quota and collapses bandwidth. Sync inventory cheaply; open streams when cells are visible.
  • Assuming OpenAPI “knows” your roles. Cloud APIs do not implement your retail franchise tree or security contractor hierarchy. You do.
  • Logging full live URLs or tokens into support tickets and third-party APM. Prefer opaque session IDs in your audit trail.

Capabilities such as talk, PTZ, and cloud playback depend on device model and subscribed services—surface controls only when available. Product overview: Video Monitoring.

Add live video to SaaS
Get your accessToken