Open API V1
caution
Only support CSID
right now
HTTP Interface
Post /openApi
Request Header
Params | Value | Description |
---|---|---|
Content-Type | application/json | JSON Formatted |
KTT-YS-BRAND | String <Necessary> | "yolink" |
YS-CSID | ${CSID} <Necessary> | CSID |
YS-SEC | String <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
Params | Value | Description |
---|---|---|
Content-Type | application/json | JSON Formatted |
KTT-CSID | ${CSID} <Necessary> | CSID |
KTT-SEC | String <Necessary> | MD5(Body.toString()+CSSecKey); Not check it now, will check this value later; |
Request Body
JSON of BUDP
Params | Value | Description |
---|---|---|
type | Timestamp <Necessary> | Report Type |
deviceId | String <Necessary> | DeviceId of the reporter |
hubId | String <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
Item | Value |
---|---|
Username | ${CSID} |
Password | ${MD5(CSSecKey)} |
Client ID | General Unique UUID |
Topic
{CustomerName}/** is authorized to pub and sub.
Topic | Desc |
---|---|
{CustomerName}/**/request | Send Message<BDDP> at these channels; Like CSNAME/request, CSNAME/111/request; BUDP will return at response channel; |
{CustomerName}/**/response | Receive Message<BUDP> at these channels; If you send a BDDP at CSNAME/11/request,You will get a BUDP at CSNAME/11/response; |
{CustomerName}/**/report | Device'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
Item | Value |
---|---|
Auth URL | /oauth/v2/authorization.htm |
Get Token URL | /oauth/v2/getAccessToken.api |
ClientId | ${CSID} |
ClientSecret | ${CSSecKey} |