Open API V2
caution
This only supports UAC
at this time
HTTP API V2
Post /open/yolink/v2/api
Request Header
Params | Value | Description |
---|---|---|
Content-Type | application/json | JSON Formatted |
Authorization | Bearer Token <Necessary> | Access Token |
Request Body
JSON of BDDP
Response Body
JSON of BUDP
You can obtain access token through the following token interface (refresh_token and expires_in included too)
tip
It's recommend that confirm the access_token is not expired before calling the API with access_token. It's also recommend using refresh_token to get a new access_token in preference
caution
The UAC is your security key, do not share it to third party applications or store it in public storage.
MQTT API V2
Both TCP and websocket are supported. Host is ${API_Host}๏ผ port for TCP is 8003 and port for WebSocket is 8004.
caution
UAC are limited to keep 5 connections and establish 10 connections in 5 minutes.
Auth
Item | Value |
---|---|
Username | ${access_token of UAC} |
Password | None |
Client ID | General Unique UUID |
Topic yl-home/${Home ID}/** is authorized to publish and subscribe
tip
You can get Home Id in Home.getGeneralInfo method.
Topic | Desc |
---|---|
yl-home/${Home ID}/+/report | Device's Event(like: StatusChange,Alert,Report), will be reported to this channel; |
yl-home/${Home ID}/**/request | Pub BDDP |
yl-home/${Home ID}/+/response | Sub BUDP |
OAuth2.0
YoSmart Support OAuth2.0 to sync Account Info.
Learn more about OAuth2.0
Item | Value |
---|---|
Token URL | ${SVR_URL}/open/yolink/token |
//Get access token by UAC
curl -X POST -d "grant_type=client_credentials&client_id=${UAID}&client_secret=${Secret Key of UAC}" ${API Host}/open/yolink/token
//Get access token by refresh_token
curl -X POST -d "grant_type=refresh_token&client_id=${UAID}&refresh_token=${Refresh Token}" ${API Host}/open/yolink/token