Get started
  • English
  • 简体中文
Official Site
Get started
  • English
  • 简体中文
Official Site
  • Get started
  • Concepts
  • Guides
    • Account and authorization
      • Set up a sub-account
      • OAuth for user devices
      • Configure flow resource pools
    • Device access
    • Audio and video
    • Device capability integration
    • Receive device messages
    • Manage cloud storage
    • Release and operations
  • Device capabilities & events
  • API reference
  • SDK and tools
  • Solutions
  • Platform and support
On this page
Authorization → token → getStreamUrl
Compare with the sub-account model

OAuth for user devices

OAuth for user devices

Use this path when the end user owns the Imou Life devices. Your developer account does not bind those cameras. Concept and console screenshots: OAuth 2.0 authorization. APIs: OAuth authorization.

The overseas Open Platform does not offer device hosting: end users cannot host devices from their app onto your developer account. Source: Devices.

Authorization → token → getStreamUrl

  1. Create an OAuth project on the Open Platform. Keep the Project Access Key / Secret Key on your server.
  2. Send the end user to the platform authorization H5. After they confirm, the platform posts code to your callback URL.
  3. Exchange the code with oauthTokenV2: POST /openapi/oauthTokenV2, Basic Authorization of AK:SK, grant_type=authorization_code, same redirect_uri as the project. Success returns access_token (bearer), expires_in 7200 seconds, refresh_token, and scope all.
  4. Refresh before expiry with the same method, grant_type=refresh_token. The user does not open the H5 again.
  5. For RTSP, call getStreamUrl with the project AK/SK and the user access token. Identify the camera by serial number, channel, and stream type (0 main, 1 sub).

Other device and message OAuth methods stay on OAuth authorization. Do not integrate the unpublished things-model OpenAPI (getProductModel, iotDeviceControl). See Device capabilities & events.

Compare with the sub-account model

Sub-accountOAuth user devices
Who owns the deviceYour developer account after bindDeviceThe Imou Life end user
Credential you mintsubAccountToken (St_)oauthTokenV2 user access_token (Ot_ in the concept page)
Typical playOpenSDK or ImouPlayer with your bound devicesgetStreamUrl RTSP
Setup guideSet up a sub-accountThis page

Do not mix the two models on the same camera.

Authorization is valid 90 days on the concept page. Profile changes and deleting an authorization are handled in the current console and OAuth APIs, not in this onboarding flow.

Set up a sub-account
Configure flow resource pools