top of page

Integration

Sifely is providing free API and SDK, so you could build your own system or APP to control the smart locks.

what you could do with the API and SDK:

  • Build your own App to control Sifely locks;

  • Integrate Sifely lock function into your current system, like PMS, dashboard; So that you could send eKey or passcode without operating on the Sifely APP, but just on your own dashboard. User with the Sifely App could get your ekey and unlock the door. Or could use the passcode to unlock.

 

Principle:

Lock data was stored in the cloud end, and it was exclusively coupled with one user. To get the lock data, you need to have to provide your user token and data style, then our server grants the corresponding data to you. So you could control the locks.

 

How to get your access token

To get the access token, if you are a Sifely user, just directly input the username you used in Sifely APP, and the passcode transferred into md5 style. then the token will be granted, and you could visit your own data.

sifely api

Steps:

1)Register a developer account and create an application. Please remark your application with #sifelyapp, and your application needs to be reviewed. After it is reviewed, all the APIs are available.

2)If you want to develope app,download the SDK from github and include them to your app project, refering to the guidelines in github. They are native SDKs for Android and iOS system.
github: https://github.com/ttlock/Android_SDK_Demo

https://github.com/ttlock/iOS_SDK_Demo

3)User register. you could build up your own database and transfer an random code to our OPEN API server to prevent your data information exposure. If you already registered in Sifely app, just use that account name as your username.

4) Get the User access token. Use the token to get grab the lock data.

5) Initate the locks, to couple the locks with the master user.

6) then you could call related API to get the lock data and build your own applications.

 

 

Sample1: Get a passcode

https://euapi.ttlock.com/v3/keyboardPwd/get

Get a 6-9 digits random passcode from the cloud, the passcode israndomly generated and can't be cutomized, if you need a custom passcode, refer to cloud API: Add a custom passcode.

The lenght of the passcode is generally decided by it's period, it's decided by the algorithm and can't be changed.

Random passcodes's valid period can only be accruate to Hours, if the startDate is set to timestamp of 19:20, then the real start time will be 19:00, we suggest you to set the startDate and endDate on hour.

When period passcode exceed one year, it's valid period can only be accruate to month, it means the day and time of the startDate of endDate must be the same, for example:2020-10-18 00:00:00 to 2022-10-18 00:00:00.

1 Request example

POST, ContentType:application/x-www-form-urlencoded

curl --location -g --request POST 'https://euapi.ttlock.com/v3/keyboardPwd/get' \--data-urlencode 'clientId=fd2ff35ee3xxxxxx' \--data-urlencode 'accessToken=780f7671b6e6bxxxxxxx' \--data-urlencode 'lockId=24451' \--data-urlencode 'keyboardPwdType=3' \--data-urlencode 'keyboardPwdName=test' \--data-urlencode 'startDate=1626945087000' \--data-urlencode 'endDate=1636945087000' \--data-urlencode 'date=1626945087000'

2 Request parameters

1.PNG

2.1 Passcode type:

2.PNG
3.PNG

3 Response and example

5.PNG

{    "keyboardPwd": "0563456",    "keyboardPwdId": 10236}

for sure, if you have any other questions about API, please contact our technical team: john@sifely.com

 

Sample 2: Send ekey

https://euapi.ttlock.com/v3/key/send

The ekey receiver can login TTLock APP to get the ekey send by lock administrator.

If the developer want to develop your own APP based on our APP SDK,the ekey can be requested by cloud API: Get the eKey list of an account with access token get by receiverUsername and it's passowrd.

receiverUsername should be account registered in TTLock APP or user registered by cloud API: User register.

If receiverUsername is a mobile phone number or email account which is not registered yet, you can request with parameter createUser=1, the cloud will automatically create an user account for it, the default password of the account is the last six char of receiverUsername , for example: receiverUsername=+158876191905, it's default password will be 191905.

A user account can only have one ekey for a lock, so if you send ekey to a user already have this lock's ekey, the old ekey will be deleted.

Send ekey to oneself or top administrator is forbidden.

1 Request example

POST, ContentType:application/x-www-form-urlencoded

curl --location -g --request POST 'https://euapi.ttlock.com/v3/key/send' \--data-urlencode 'clientId=4773aa036f7f49c68d876bb4be85c80c' \--data-urlencode 'accessToken=dfd5489d0cee31f0bdfaf59d0d42d71f' \--data-urlencode 'lockId=163377' \--data-urlencode 'receiverUsername=18876191905' \--data-urlencode 'keyName=Ekey for jack' \--data-urlencode 'startDate=1625025703000' \--data-urlencode 'endDate=1635025703000' \--data-urlencode 'createUser=1' \--data-urlencode 'remarks=Have a nice day.' \--data-urlencode 'date=1625025703000'

2 Request parameters

6.PNG
7.PNG

3 Response and example

8.PNG
bottom of page