Get access token
https://api.sciener.com/oauth2/token
Use Oauth(Resource Owner Password) to authorization. Please pass in the user's username and password to get the access token.
1.1 HTTP request method
POST, ContentType:application/x-www-form-urlencoded
1.2 Response content format
JSON
1.3 Description
Name |
Required |
Value |
Description |
client_id |
Y |
|
The app_id which is assigned by system when you create an application |
client_secret |
Y |
|
The app_secret which is assigned by system when you create an application |
username |
Y |
|
User account of TTLock APP, or the username returned by User registerAPI, do not use the developer account. |
password |
Y |
|
Password(32 chars, low case, md5 encrypted) |
1.4 Response
Name |
Type |
Example |
Description |
access_token |
String |
f45a713ef706d09c892084ee7e350384 |
Access token |
uid |
Int |
1234567890 |
User id |
expires_in |
Int |
7776000(the default value is 7776000 seconds. That is expired in 90 days) |
Expire time of access token, in second. |
scope |
String |
user,key,room |
Permission scope |
refresh_token |
String |
f45a713ef706d09c892084ee7e350384 |
Refresh token |