OAuth authorization APIs
OAuth authorization
Module overview
These APIs operate on devices that an end user authorized to your OAuth project. They are not sub-account APIs and do not use the administrator accessToken from accessToken.
Use the OAuth Project Access Key and Project Secret Key (console OAuth project). Pass the end user's OAuth access token (Ot_ prefix) where a method requires token in params.
Product flow and billing: OAuth 2.0 authorization. Sub-account model: Sub-accounts and policies — do not mix OAuth user tokens with sub-account or administrator tokens.
API list
| No. | API | Description |
|---|---|---|
| 1 | oauthTokenV2: Exchange or refresh OAuth tokens | authorization_code or refresh_token grant |
| 2 | getStreamUrl: Get RTSP stream URL | RTSP URL for an authorized device channel |
OAuth with other APIs
Device query, configuration, messages, thing models, and other capabilities documented under 05-api may support OAuth-authorized calls when you sign requests with the OAuth project keys and pass the end user's Ot_ token in params.token. See Development specification for the JSON request body and signature rules. OAuth-specific errors include OA1005 and OA1007 in Return codes.
