Skip to main content

Open API V2

caution

This only supports UAC at this time

HTTP API V2

Post /open/yolink/v2/api

Request Header

ParamsValueDescription
Content-Typeapplication/jsonJSON Formatted
AuthorizationBearer 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

ItemValue
Username${access_token of UAC}
PasswordNone
Client IDGeneral Unique UUID

Topic yl-home/${Home ID}/** is authorized to publish and subscribe

tip

You can get Home Id in Home.getGeneralInfo method.

TopicDesc
yl-home/${Home ID}/+/reportDevice's Event(like: StatusChange,Alert,Report), will be reported to this channel;
yl-home/${Home ID}/**/requestPub BDDP
yl-home/${Home ID}/+/responseSub BUDP

OAuth2.0

YoSmart Support OAuth2.0 to sync Account Info.
Learn more about OAuth2.0

ItemValue
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