API DOCUMENTATION

Table of Contents

  • Getting Started
    • Setup 1: Setup the lock using KAS Cloud App
    • Step 2: Retrieve your API Key
    • Step 3: Start using the API
  • API Specification
    • Remote Unlock
    • Add Password
    • Delete Password
    • Get Passwords


Change Log

4/8/2019

  • Added “GET PASSWORDS” endpoint
  • Retrieve API Key through an endpoint for added security

5/4/2019

  • API is live
  • Contact support@kas.com.au today to get your API key

Getting Started

Step 1: Setup the lock using KAS Cloud App

In order to start using the API, each lock and gateway needs to be set up and bound to an account created on the KAS Cloud App. To do this, download the app and set up the lock. Note you can only conduct API calls on locks which are bound to your account.

Once the locks(s) and gateway(s) are activated to your account. Now retrieve your API Key

Step 2: Retrieve your API Key

The API Key is used to authenticate your account with the locks and gateways that you own. It’s a way to identifying that you are in fact the owner of the device.

Example:

API Key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1YzI3Yjk3ZDRiMTJhMTAwMTc3MTVlZmYiLCJsYXRlc3RfdG9rZW5fZGF0ZSI6IjIwMTktMDEtMTNUMDY6NTI6MzUuMjg5WiIsImlhdCI6MTU0NzUwMTM5Mn0.v8cuLVqum_sWuM1OsSWiM3MUpRYRHuSMsBYucZIYVk0

Note: the above string is an invalid token. Just for demo purposes only.

Get your API Key by the consuming a HTTP endpoint. Note only Paid plans can use an API Key. Open API is only for paid plan users. Once you’ve signed up, request your API KEY from the endpoint you can start using the API.

Visit this page on details to obtain the API Key: https://console.kas.com.au/account/apikey

The above link is protected and requires an account to view it. Create an account using the iOS or Android app, activate your lock/gateway, return to this link and all details are provided.

Note: the API key is dynamic and needs to be refreshed every 24 hours. We do not provide static API Keys.

Step 3: Start using the API

Now, your locks are setup using the KAS Cloud App and you have your API Key, proceed below to get started.

Overview and Specifications

  • To use the API, it requires a paid subscription. Find out more
  • Use the HTTP Status code to check for call result.
  • Unless specified please use HEADER : Content-type: Application/JSON
  • Unless specified please use HEADER: x-auth-token: <Your API Key here>

API Commands

Remote Unlock

Unlocks the door.

Lock Gateway required to conduct this command. This command will work if a Gateway is 1) activated, 2) connected to a network, 3) within the specified range of the target door lock.

Tip: This API is perfect for IFTTT

Request

Request URLhttps://cloud.kas.com.au/api/lockCommand/remoteUnlock/:{factory_name}/:{API_KEY}factory_name is obtained from app interface. It either starts with ‘SS’ or ‘UL’. Replace API_KEY with your API Key retrieved from above.
Request MethodGET
HeaderContent-typeapplication/json
Bodynil

Example

GET https://cloud.kas.com.au/api/lockCommand/remoteUnlock/SS000510/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1YzI3Yjk3ZDRiMTJhMTAwMTc3MTVlZmYiLCJsYXRlc3RfdG9rZW5fZGF0ZSI6IjIwMTktMDEtMTNUMDY6NTI6MzUuMjg5WiIsImlhdCI6MTU0NzUwMTM5Mn0.v8cuLVqum_sWuM1OsSWiM3MUpRYRHuSMsBYucZIYVk

Response

HTTP Status CodeResponse Body (Plain Text)
200{
“ack”:1
“message”: “Success”
}
400You are not the admin.
Invalid Token.
Lock is not found.
500Unknown Error

Notice:

This command may take up to 15 seconds to return a result. It’s because the command needs to be delivered through the gateway network and the lock will response with the “ack” result.

Add Online Password

Creates an 4-6 digit pin code for door access

You DO need a gateway connected to conduct this command.

Request

Request Headerx-auth-token<your API Key here>
Request URLhttps://cloud.kas.com.au/api/lockCommand/remotePassword/:{factory_name}factory_name is obtained from app interface. It either starts with ‘SS’ or ‘UL’.
Request MethodPOST
HeaderContent-typeapplication/json
Bodypassword_id: [Int] 101->200 ,
password_start_time: [String] YYYYMMDDHHmm,
password_end_time: [String] YYYYMMDDHHmm,
password: [String] 1234 or 223344 (4-6 digits),
password_name: [String] “John”,
email_checked: [Bool] – will send an email with the pincode, start time and end time detials to the email specified in “password_email”,
password_email: [String] – email format only,
password_message: [String] – custom message to be displayed in the email.
{
“password_id”:101,
“password_start_time”:”201901011200″,
“password_end_time”:”201904251200″,
“password”:”1234″,
“password_name”: “John”,
“email_checked”: false,
“password_email”: “test@email.com”,
“password_message”: “Watch out for the dog.”
}

Example

POST https://cloud.kas.com.au/api/lockCommand/remotePassword/S000510

Response

HTTP Status CodeResponse Body (Plain Text)
200{
“ack”: 1,
“message”: “Success”,
“password”: “1234”,
“l_factory_name”: “SS000910”,
“l_passwords”: [
{
“_id”: “5ca4249ea77c8200170e9ad8”,
“password_start_time”: “201904031142”,
“password_end_time”: “201909261142”,
“password_id”: 101,
“password_name”: “John Pin Code”,
“password”: “654321”,
“password_email”: “test@email.com”,
“password_message”: “From BH Web Console”
},
{
“_id”: “5ca6f3a0343edc7c9a028b80”,
“password_start_time”: “201901011200”,
“password_end_time”: “201904251200”,
“password_id”: 103,
“password_name”: “Cleaner pin”,
“password”: “0953”,
“password_email”: “test@test.com”,
“password_message”: “Go to front door.”
}
]
}
400You are not the admin.
Invalid Token.
Lock is not found.
Password is already existing.
Error with Start and End times
500Unknown Error

Notice:

  • The response object will return the list of pincodes in the lock and their respective ID.
  • The lock must have the clock set (Use the mobile app or Web Console to set it)
  • If you Add Password with an ID which is already existing inside the lock memory, the API will override the ID with the new request.

Delete Online Password

Deletes an existing pin code in the lock memory

You DO need a gateway connected to conduct this command.

Request

Request Headerx-auth-token<your API Key here>
Request URLhttps://cloud.kas.com.au/api/lockCommand/remotePassword/:{factory_name}factory_name is obtained from app interface. It either starts with ‘SS’ or ‘UL’.
Request MethodDELETE
HeaderContent-typeapplication/json
Bodypassword: [String] 1234 or 223344 (4-6 digits),{
“password”:”1234″
}

Example

DELETE https://cloud.kas.com.au/api/lockCommand/remotePassword/S000510

Response

HTTP Status CodeResponse Body
200{
“ack”: 1,
“message”: “Password deleted successfully.”
}
400You are not the admin.
Invalid Token.
Lock is not found.
500Unknown Error

Notice:

  • The response object will provide the appropriate “ack” if the password was deleted or not.
  • If “ack” is not equal to 1, you should conduct the command again.

Get Online Passwords

Retrieves a list of existing pin code in the lock memory

You DO NOT need a gateway connected to conduct this command.

Request

Request Headerx-auth-token<your API Key here>
Request URLhttps://cloud.kas.com.au/api/lockCommand/remotePassword/:{factory_name}factory_name is obtained from app interface. It either starts with ‘SS’ or ‘UL’.
Request MethodGET
HeaderContent-typeapplication/json
Bodynonenone

Example

GET https://cloud.kas.com.au/api/lockCommand/remotePassword/S000510

Response

HTTP Status CodeResponse Body
200{
“l_factory_name”: “SS000761”,
“l_passwords”: [
{
“password_start_time”: “201907141412”,
“password_end_time”: “201907260000”,
“password_id”: 150,
“password_name”: “Cleaner 5213”,
“password”: “224126”
}
],
“l_lock_title”: “0101”
}
400You are not the admin.
Invalid Token.
Lock is not found.
500Unknown Error

Notice:

  • This command is useful when need to see what pincodes are in the lock memory.

Separator

ACK and Response Values

ACKResponse Body (Plain Text)Correction
1Successn/a
2Error. Internal interface error.Try command again
5PendingWaiting for the API response.
8Failed. No gateway nearbyEnsure gateway is nearby. You might have to wait a few minutes for the gateway and lock to automatically discover each other.


More API coming soon…

We are always developing more APIs for customers to use. See the list of APIs coming soon:

  • PUT Free Passage on or off