Get access token

https://api.sciener.com/oauth2/token

Cloud APIs grant access by OAuth 2.0 's Resource Owner Password grant type,you have to request with username and password,all the cloud apis should be requested with access token.

Note:access token returned will expire in seconds of expires_in(Default validity of 90 days),request with expired access token will get 10004 error code,you should get a new token with this API, or Refresh the access token.

1 Request example

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

2 Request parameters

NameTypeRequiredDescription
clientIdStringYclientId from Create application
clientSecretStringYclientSecret from Create application
usernameStringYusername you used to login sciener APP or TTLock APP,or The prefixed username return by cloud api: User register. Notice:please do not use your open platform's developer account.
passwordStringYPassword(32 chars, low case, md5 encrypted)

Note: The username and password here are the account of the TTLock app. You need to download the TTLock app and register. please do not use your open platform's developer account.

3 Response and example

NameTypeRequest parameters
access_tokenStringAccess token
uidIntUser id
expires_inIntExpire time of access token, default validity of 90 days, in second.
refresh_tokenStringRefresh token

Error code 10007,"errmsg":"invalid account or invalid password"

  1. Please verify that you are using a TTlock app account. Note: Do not use a developer account.

  2. Please check whether you can log in to the TTlock app using your account credentials.

  3. Verify that the encrypted MD5 value is correct.

image-20261104104017457