Skip to main content

Open API V1

caution

Only support CSID right now

HTTP Interface

Post /openApi

Request Header

ParamsValueDescription
Content-Typeapplication/jsonJSON Formatted
KTT-YS-BRANDString <Necessary>"yolink"
YS-CSID${CSID} <Necessary>CSID
YS-SECString <Necessary>MD5(Body.toString()+CSSecKey);

Request Body

JSON of BDDP

Response Body

JSON of BUDP

Http Callback

Post ${Callback_URL}

${Callback_URL} should be confirmed by YoSmart. You can set it in Test Server by API. KTT_SVR will report data to this URL!

Request Header

ParamsValueDescription
Content-Typeapplication/jsonJSON Formatted
KTT-CSID${CSID} <Necessary>CSID
KTT-SECString <Necessary>MD5(Body.toString()+CSSecKey); Not check it now, will check this value later;

Request Body

JSON of BUDP

ParamsValueDescription
typeTimestamp <Necessary>Report Type
deviceIdString <Necessary>DeviceId of the reporter
hubIdString <Necessary>DeviceId of the transfer hub

MQTT Interface

Both TCP and websocket are supported. Host is ${API_Host}๏ผŒ port for TCP is 8003 and port for WebSocket is 8004.

Auth

ItemValue
Username${CSID}
Password${MD5(CSSecKey)}
Client IDGeneral Unique UUID

Topic

{CustomerName}/** is authorized to pub and sub.

TopicDesc
{CustomerName}/**/requestSend Message<BDDP> at these channels; Like CSNAME/request, CSNAME/111/request; BUDP will return at response channel;
{CustomerName}/**/responseReceive Message<BUDP> at these channels; If you send a BDDP at CSNAME/11/request,You will get a BUDP at CSNAME/11/response;
{CustomerName}/**/reportDevice's Event(like: StatusChange,Alert,Report), will be reported to this channel;

5. OAuth2.0

YoSmart Support OAuth2.0 to sync Account Info.
OAuth2.0 is Open Protocol

ItemValue
Auth URL/oauth/v2/authorization.htm
Get Token URL/oauth/v2/getAccessToken.api
ClientId${CSID}
ClientSecret${CSSecKey}