The Codelocks Connect API is organised around REST.
Codelocks has an PHP example of using the API with GuzzleHTTP.
DEVELOPER PROGRAMME
Request a 14 day API trial to join the Codelocks Developer Programme (charges apply).
C3 SMART APP
For more information on C3 Smart.
CHANGES FROM PREVIOUS VERSION
There are some additional API endpoints which have been added in the /v2 of the Connect API for the C3 Smart platform. In addition to this some of the K3 Connect methods have had their paths updated to maintain consistency.
AVAILABLE METHODS
NETCODE
UTILITY – GENERAL
Lock Initialisation
Lock Timezones
Lock Durations
Lock Modes
Lock Duration IDs
UTILITY – C3 SMART
C3 Smart Account Info
List C3 Smart Locks
Get C3 Smart Lock
C3 Smart Lock Audit
List C3 Smart Phone Clients
Add C3 Smart Phone Client
Update C3 Smart Phone Client
Suspend/Restore C3 Smart Phone Clients
Delete C3 Smart Phone Client
C3 Smart Help and Active Period Schema
UTILITY – K3 CONNECT
K3 Connect Account Info
List K3 Connect Locks
Get K3 Connect Lock
K3 Connect Lock Audit
List K3 Connect Smart Phone Clients
Add K3 Connect Smart Phone Client
Update K3 Connect Smart Phone Client
Suspend/Restore K3 Connect Smart Phone Clients
Delete K3 Connect Smart Phone Client
K3 Connect Help and Active Period Schema
Authentication
The Codelocks Connect API uses API keys to authenticate requests. The API key will need to be passed with each request.
Your API keys carry many privileges, so be sure to keep them secure! Do not share your private API key in publicly accessible areas such as GitHub, client-side code etc.
If your API key is compromised, please contact Codelocks Customer Support immediately so that it can be suspended.
All API requests are made of HTTPS. Calls over plain HTTP will fail. API requests without authentication will fail.
API AUTHENTICATION
You will need to pass your API key in a HTTP header value 'x-api-key' with each request made to Codelocks Connect API.
NetCode
GET …/netcode/{id}
Generates a NetCode for the given parameters.
NOTE: Some changes have been made to this method to split out the id parameter into lockid and timecode (depending on which lock model you are using) and the identifier parameter to identifier and accesskey. The old method of using id and identifier has been left in to maintain backwards compatibility.
Parameters
Parameter | id |
Required | yes |
Parameter Type | path |
Value Type | string |
Description | For K3 Connect/C3 Smart locks (CL4510 + CL5510) this is the lockid retrieved from the /locks method. For Kitlock locks this is the timecode. |
Example (KitLock) | 202011161623 |
Example (K3 Connect/C3 Smart) | 06040408437e47533039303739303339 |
Parameter | lockmodel |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | This is the lock model. Allowed values are : KL1060, KL1060C2, KL1060G3, CL5000N, C3SMART or K3CONNECT |
Example | KL1060 |
Parameter | duration |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | This is the durationID. You can use the durations endpoint to see the available durations for your lock model and corresponding start times. |
Example | 0 |
Parameter | start |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | This is the start time of the NetCode. Hour length NetCodes must start on the hour and day length codes must start at midnight. Format: yyyy-MM-dd hh:mm |
Example | 2020-10-01 16:00 |
Parameter | identifer |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | For K3 Connect/C3 Smart this is the accesskey of the account which owns the lock. For KitLock locks and CL5000N this is the six digit numeric identifier. |
Example (KitLock) | 123456 |
Example (K3 Connect/C3 Smart) | k961cfazhu |
Additional Notes
The value that the user needs out of the response is ‘ActualNetCode’.
Historical information about NetCodes requested via this API is not held by Codelocks.
Each request for a NetCode is counted towards the API key usage totals, even if the parameters are the same as a previous request and the same NetCode has been returned.
When the batteries are removed (or run out of power) on a KitLock (or CL5000N) then the real time clock settings are lost. The real time clock will need to be reset and the correct time updated for NetCodes to work. The lock will retain the NetCode initialisation so does not need to be reset to continue NetCode operation (after clock has been set).
Any NetCode generated with the same parameters (lock, start time and duration) will be the same irrespective of which mechanism (Connect API, Connect App (where application) or Connect Portal) has generated the NetCode.
Multiple valid NetCodes will be available on any lock running the NetCode alogithm just with different start times and durations.
REQUEST (KITLOCK/CL5000N)
https://api-connect.codelocks.io/n/2/netcode/202011161623?start=2020-10-01%2016:00&duration=4&lockmodel=KL1060C2&identifier=451254
REQUEST (K3 CONNECT/C3 SMART)
https://api-connect.codelocks.io/n/2/netcode/06040408437e47533039303739303339?start=2020-10-01%2016:00&duration=4&lockmodel=K3CONNECT&identifier=k961cfazhu
RESPONSE
{
"Startdate": "string",
"DurationHours": integer,
"DurationDays": integer,
"Mode": "string",
"SubMode": "string",
"Timecode": "string",
"ActualNetcode": "string",
"Resultstatus": "string",
"LockId": "string",
"Expires": "string",
"Startdata": {
"datetime": {
"date": "string",
"timezone_type": "string",
"timezone": "string"
},
"original": "string",
"date_ymd": "string",
"date_dmy": "string",
"date_mdy": "string",
"time_his": "string",
"time_hi": "string",
"time_h": "string",
"timezone": "string"
}
}
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
Utility: General
GET …/init
Generates a Lock initialisation sequence for a KitLock or CL5000N lock.
Parameters
Parameter | lockmodel |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | This is the lock model. Allowed values are :, KL1060, KL1060C2, KL1060G3, CL5000N, C3SMART or K3CONNECT |
Example | C3SMART |
Parameter | mastercode |
Required | no |
Parameter Type | query |
Value Type | string |
Description | If provided this will be incorporated into the generated initialisation code. |
Example | 11223344 |
Parameter | timezone |
Required | no |
Parameter Type | query |
Value Type | string |
Description | The timezone the lock is in. |
Example | Europe/London |
Parameter | randomid |
Required | no |
Parameter Type | query |
Value Type | string |
Description | Generate a random 6 digit identifer for KL1060 and KL1550, or a Group ID + Member ID for KL1060C2. If the random 6 digit identifier is generated within external platform it can be passed in here to override the Codelocks generated identifier and will be incorporated into the returned sequence. |
Example | true |
Additional Notes
This method is only available for KitLocks locks and CL5000N. C3 Smart and K3 Connect locks are initialised in the respective smart phone apps.
REQUEST (KITLOCK/CL5000N)
https://api-connect.codelocks.io/u/2/init?lockmodel=C3SMART
RESPONSE
{
"DefaultMastercode": "string",
"InitSeqFormat": "string",
"InitSeqFormatDesc": "string",
"InitSeq": "string",
"TimeCode": "string",
"TimeCodeFormatted": "string",
"DST": "string",
"RandomID": "string"
}
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
GET …/init/tz
Get a list of the available timezones
Parameters
No parameters needed
Additional Notes
If the timezone you wish to use is not in the returned list then please contact Codelocks Support to have it added in.
REQUEST
https://api-connect.codelocks.io/u/2/init/tz
RESPONSE
[
{
"TZName": "string",
"TZOffset": "string"
}
]
RESPONSE CODES
GET …/durations
Provides all the available Duration IDs for a given lock model or all the unique modes for a given lock.
NOTE: The endpoint to get a list of the unique modes has been moved to its own endpoint.
Parameters
Parameter | lockmodel |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | This is the lock model. Allowed values are :, KL1060, KL1060C2, KL1060G3, CL5000N, C3SMART or K3CONNECT |
Example | C3SMART |
Parameter | operation |
Required | no |
Parameter Type | query |
Value Type | string |
Description | Available operations: durations or modes, Default: durations |
Example | 11223344 |
Additional Notes
Specify durations as operation to list all the available durations for the specified lock mode.
Specify modes as operation to list the available NetCode modes for the specified lock model.
REQUEST
https://api-connect.codelocks.io/u/2/durations?lockmodel=C3SMART
RESPONSE
[
{
"DurationID": integer,
"Mode": "string",
"SubMode": "string",
"DurationDays": integer,
"DurationHours": integer,
"LockModels": "string"
}...
]
or
[
{
"Mode": "string",
"SubMode": "string",
"LockModels": "string"
}...
]
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
GET …/duration/modes
Provides all the unique modes for a given lock model
Parameters
Parameter | lockmodel |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | This is the lock model. Allowed values are : KL1060, KL1060C2, KL1060G3, CL5000N, C3SMART or K3CONNECT |
Example | C3SMART |
REQUEST
https://api-connect.codelocks.io/u/2/duration/modes?lockmodel=C3SMART
RESPONSE
[
{
"Mode": "string",
"SubMode": "string",
"LockModels": "string"
}...
]
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
GET …/duration/{id}
Return information about a given duration ID. Includes any rules for generating a NetCode with this duration and lock model.
Parameters
Parameter | id |
Required | yes |
Parameter Type | path |
Value Type | integer |
Description | Duration ID value |
Example | 0 |
Parameter | lockmodel |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | This is the lock model. Allowed values are : KL1060, KL1060C2, KL1060G3, CL5000N, C3SMART or K3CONNECT |
Example | C3SMART |
Additional Notes
NetCode durations and modes are lock model specific. Some lock models may not support all NetCode modes.
REQUEST
https://api-connect.codelocks.io/u/2/duration/0?lockmodel=C3SMART
RESPONSE
{
"LockModel": "string",
"DurationID": integer,
"Rules": [
{
"ApplyDST": integer,
"ConvertToUTC": integer,
"RestrictedStartTime": "string"
}
],
"Duration": [
{
"Days": integer,
"Hours": integer
}
],
"Mode": [
{
"Name": "string",
"SubMode": "string"
}
]
}
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
Utility: C3 Smart
GET …/c3smart/account
Get C3Smart account information
Parameters
Parameter | accesskey |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | C3 Smart access key to retrieve the account information for. This can be found in the User Info section of the C3 Smart App |
Example | rspr7tps3q |
REQUEST
https://api-connect.codelocks.io/u/2/c3smart/account?accesskey=rsp7tps3q
RESPONSE
{
"email": "string",
"spccmstatus": "string"
}
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
GET …/c3smart
Returns a list of C3 Smart locks, use for retrieving key information enabling the generation of NetCodes.
Parameters
Parameter | accesskey |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | C3 Smart access key to retrieve the locks information for. This can be found in the User Info section of the C3 Smart App |
Example | rspr7tps3q |
Additional Notes
This method will list all the locks on the C3 Smart account associated with the provided accesskey as such this list will match the list of locks in the C3 Smart App for the account.
REQUEST
https://api-connect.codelocks.io/u/2/c3smart?accesskey=rsp7tps3q
RESPONSE
[
{
"LockId": "string",
"LockName": "string",
"BatteryStatus": "string",
"BatteryUpdated": "string",
"Manufacturer": "string",
"ModelName": "string",
"FirmwareVersion": "string",
"Timezone": "string",
"TimezoneOffset": "string",
"DstStart": "string",
"DstEnd": "string",
"DstTime": "string",
"PairingDate": "string"
},...
]
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
GET …/c3smart/{id}
Returns the details of a single C3 Smart lock.
Note: Some locks do not support the full range of response parameters, where a parameter is not supported:, not_available will be returned as the parameter value.
Parameters
Parameter | id |
Required | yes |
Parameter Type | path |
Value Type | string |
Description | The LockId that you wish to retrieve information about |
Example | 06050408434e47533137303434303431 |
Parameter | accesskey |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | C3 Smart access key that is the admin of the lock. This can be found in the User Info section of the C3 Smart App |
Example | rspr7tps3q |
REQUEST
https://api-connect.codelocks.io/u/2/c3smart/06050408434e47533137303434303431?accesskey=rsp7tps3q
RESPONSE
{
"LockId": "string",
"LockName": "string",
"BatteryStatus": "string",
"BatteryUpdated": "string",
"Manufacturer": "string",
"ModelName": "string",
"FirmwareVersion": "string",
"Timezone": "string",
"TimezoneOffset": "string",
"DstStart": "string",
"DstEnd": "string",
"DstTime": "string",
"PairingDate": "string",
"LockLocation": "string"
}
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
GET …/c3smart/{id}/audit
Get the audit information of a given C3 Smart lock.
Parameters
Parameter | id |
Required | yes |
Parameter Type | path |
Value Type | string |
Description | The Lock Identifier that you wish to retrieve audit information about |
Example | 06050408434e47533137303434303431 |
Parameter | accesskey |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | C3 Smart access key that is the admin of the lock. This can be found in the User Info section of the C3 Smart App |
Example | rspr7tps3q |
Parameter | page |
Required | no |
Parameter Type | query |
Value Type | integer |
Description | Page number to return |
Example | 1 |
Parameter | perpage |
Required | no |
Parameter Type | query |
Value Type | integer |
Description | The quantity of audit entries to be returned per page (max 100) |
Example | 100 |
Parameter | pageorder |
Required | no |
Parameter Type | query |
Value Type | string |
Description | Order to sort the results before returning them: ascending or descending |
Example | descending |
Additional Notes
The Lock Audit is not real-time. Lock audit information is updated when the lock is synchronised with the C3 Smart App either via a Sync operation or a BLE unlock operation. The only exception to this is if the lock is connected via WiFI Gateway.
REQUEST
https://api-connect.codelocks.io/u/2/c3smart/06050408434e47533137303434303431/audit?accesskey=rsp7tps3q&page=1&perpage=100&pageorder=descending
RESPONSE
[
{
"AuditEntryID": integer,
"LockID": "string",
"DateEntered": "string",
"EntryType": "string",
"EntryText": "string"
}
]
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
GET …/c3smart/{id}/clients
Get the smart phone clients of a given C3 Smart lock.
Parameters
Parameter | id |
Required | yes |
Parameter Type | path |
Value Type | string |
Description | The LockID that you wish to retrieve smart phone client information from. |
Example | 06050408434e47533137303434303431 |
Parameter | accesskey |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | C3 Smart access key that is the admin of the lock. This can be found in the User Info section of the C3 Smart App |
Example | rspr7tps3q |
Parameter | page |
Required | no |
Parameter Type | query |
Value Type | integer |
Description | Page number to return. Default 1 |
Example | 1 |
Parameter | perpage |
Required | no |
Parameter Type | query |
Value Type | integer |
Description | The number of audit entries to be returned per page. Default 50 |
Example | 100 |
Additional Notes
If no C3 smart phone clients exist for the specified lock, then an empty array is returned.
REQUEST
https://api-connect.codelocks.io/u/2/c3smart/06050408434e47533137303434303431/clients?accesskey=rsp7tps3q&page=1&perpage=100
RESPONSE
[
{
"lockid": "string",
"email": "string",
"status": "string",
"accesstype": "string",
"activeperiods": [
{
"starts": "string",
"ends": "string",
"enabled": true,
"mon": true,
"tue": true,
"wed": true,
"thu": true,
"fri": true,
"sat": true,
"sun": true
}
]
},...
]
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
POST…/c3smart/{id}/client
Create a new Smart Phone client of a given C3 Smart lock.
Parameters
Parameter | id |
Required | yes |
Parameter Type | path |
Value Type | string |
Description | The LockId to add the Smart Phone client to. |
Example | 06050408434e47533137303434303431 |
Parameter | accesskey |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | C3 Smart access key that is the admin of the lock. This can be found in the User Info section of the C3 Smart app |
Example | rspr7tps3q |
Parameter | clientemail |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | The email address to be invited as a new Smart Phone client (needs to be a valid C3 Smart account) |
Example | example@codelocks.com |
Parameter | activeperiods |
Required | yes |
Parameter Type | formdata |
Value Type | JSON |
Description | JSON active periods. Required schema can be found in /c3smart/help/spcconfig endpoint. |
Example |
Parameter | accesstype |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | Type of access to be granted: STANDARD or ONE_TIME |
Example | STANDARD |
Parameter | message |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | Message to include in the invitation |
Example | Test Message |
REQUEST
https://api-connect.codelocks.io/u/2/c3smart/06050408434e47533137303434303431/client
RESPONSE
{
"result": "string"
}
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
PUT …/c3smart/{id}/client
Update an existing smart phone client of a given C3 Smart lock.
Parameters
Parameter | id |
Required | yes |
Parameter Type | path |
Value Type | string |
Description | The LockID to add the smart phone client to. |
Example | 06050408434e47533137303434303431 |
Parameter | accesskey |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | C3 Smart access key that is the admin of the lock. This can be found in the User Info section of the C3 Smart App |
Example | rspr7tps3q |
Parameter | clientemail |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | The email address of the smart phone client to be updated (needs to be a valid C3 Smart account). |
Example | example@codelocks.com |
Parameter | activeperiods |
Required | yes |
Parameter Type | formdata |
Value Type | JSON |
Description | JSON active periods. Required schema can be found in /c3smart/help/spcconfig endpoint. |
Example |
REQUEST
https://api-connect.codelocks.io/u/2/c3smart/06050408434e47533137303434303431/client
RESPONSE
{
"result": "string"
}
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
PATCH …/c3smart/{id}/client
Suspend or restore a smart phone client on a given lock
Parameters
Parameter | id |
Required | yes |
Parameter Type | path |
Value Type | string |
Description | The Lock ID to add the smart phone client to. |
Example | 06050408434e47533137303434303431 |
Parameter | accesskey |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | C3 Smart access key that is the admin of the lock. This can be found in the User Info section of the C3 Smart App |
Example | rspr7tps3q |
Parameter | clientemail |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | The email address of the smart phone client to be suspended or restored (needs to be a valid C3 Smart account). |
Example | example@codelocks.com |
Parameter | action |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | SUSPEND or RESTORE |
Example | SUSPEND |
REQUEST
https://api-connect.codelocks.io/u/2/c3smart/06050408434e47533137303434303431/client
RESPONSE
{
"result": "string"
}
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
DELETE …/c3smart/{id}/client
Delete a specified C3 smart phone client on a specified lock.
Parameters
Parameter | id |
Required | yes |
Parameter Type | path |
Value Type | string |
Description | The LockID to add the smart phone client to. |
Example | 06050408434e47533137303434303431 |
Parameter | accesskey |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | C3 Smart access key that is the admin of the lock. This can be found in the User Info section of the C3 Smart App |
Example | rspr7tps3q |
Parameter | clientemail |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | The email address of the smart phone client to be deleted (needs to be a valid C3 Smart account). |
Example | example@codelocks.com |
REQUEST
https://api-connect.codelocks.io/u/2/c3smart/06050408434e47533137303434303431/client
RESPONSE
{
"result": "string"
}
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
GET …/c3smart/help/spcconfig
Get the schema and other information for active period configuration.
Parameters
Parameter | accesskey |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | C3 Smart access key can be found in the User Info section of the C3 Smart app |
Example | rspr7tps3q |
REQUEST
https://api-connect.codelocks.io/u/2/c3smart/help/spcconfig?accesskey=rspr7tps3q
RESPONSE
{
"activeperiods": "string",
"schema": "string"
}
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid Data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
GET …/k3connect/account
Get K3 Connect account information.
Parameters
Parameter | accesskey |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | K3 Connect access key to retrieve the account information for. This can be found in the User Info section of the K3 Connect App |
Example | rspr7tps3q |
REQUEST
https://api-connect.codelocks.io/u/2/k3connect/account?accesskey=rsp7tps3q
RESPONSE
{
"email": "string",
"spccmstatus": "string"
}
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
GET …/k3connect
Returns a list of K3 Connect locks, use for retrieving key information enabling the generation of NetCodes.
Parameters
Parameter | accesskey |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | K3 Connect access key to retrieve the account information from. This can be found in the User Info section of the K3 Connect App |
Example | rspr7tps3q |
Additional Notes
This method will list all the locks on the K3 Connect account associated with the provided accesskey.
REQUEST
https://api-connect.codelocks.io/u/2/k3connect?accesskey=rsp7tps3q
RESPONSE
[
{
"LockId": "string",
"LockName": "string",
"BatteryStatus": "string",
"BatteryUpdated": "string",
"Manufacturer": "string",
"ModelName": "string",
"FirmwareVersion": "string",
"Timezone": "string",
"TimezoneOffset": "string",
"DstStart": "string",
"DstEnd": "string",
"DstTime": "string",
"PairingDate": "string"
},...
]
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
GET …/k3connect/{id}
Returns the details of a single K3 Connect lock.
Note: Some locks do not support the full range of response parameters, where a parameter is not supported, not_available will be returned as the parameter value.
Parameters
Parameter | id |
Required | yes |
Parameter Type | path |
Value Type | string |
Description | The LockID that you wish to retrieve information for. |
Example | 06050408434e47533137303434303431 |
Parameter | accesskey |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | K3 Connect access key that is the admin of the lock. This can be found in the User Info section of the K3 Connect App |
Example | rspr7tps3q |
REQUEST
https://api-connect.codelocks.io/u/2/k3connect/06050408434e47533137303434303431?accesskey=rsp7tps3q
RESPONSE
{
"LockId": "string",
"LockName": "string",
"BatteryStatus": "string",
"BatteryUpdated": "string",
"Manufacturer": "string",
"ModelName": "string",
"FirmwareVersion": "string",
"Timezone": "string",
"TimezoneOffset": "string",
"DstStart": "string",
"DstEnd": "string",
"DstTime": "string",
"PairingDate": "string",
"LockLocation": "string"
}
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
GET …/k3connect/{id}/audit
Get the audit information of a given K3 Connect lock.
Parameters
Parameter | id |
Required | yes |
Parameter Type | path |
Value Type | string |
Description | The LockID that you wish to retrieve audit information about. |
Example | 06050408434e47533137303434303431 |
Parameter | accesskey |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | K3 Connect access key that is the admin of the lock. This can be found in the User Info section of the K3 Connect App |
Example | rspr7tps3q |
Parameter | page |
Required | no |
Parameter Type | query |
Value Type | integer |
Description | Page number to return |
Example | 1 |
Parameter | perpage |
Required | no |
Parameter Type | query |
Value Type | integer |
Description | The number of audit entries to be returned per page (max 100) |
Example | 100 |
Parameter | pageorder |
Required | no |
Parameter Type | query |
Value Type | string |
Description | Order to sort the results before returning them: ascending or descending |
Example | descending |
Additional Notes
The Lock Audit is not real-time. Lock audit information is updated when the lock is synchronised with the K3 Connect App either via a Sync operation or a BLE unlock operation from the App. The only exception to this is if the lock is connected via WiFI Gateway.
REQUEST
https://api-connect.codelocks.io/u/2/k3connect/06050408434e47533137303434303431/audit?accesskey=rsp7tps3q&page=1&perpage=100&pageorder=descending
RESPONSE
[
{
"AuditEntryID": integer,
"LockID": "string",
"DateEntered": "string",
"EntryType": "string",
"EntryText": "string"
}
]
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
GET …/k3connect/{id}/clients
Get the smart phone client of a given K3 Connect lock.
Parameters
Parameter | id |
Required | yes |
Parameter Type | path |
Value Type | string |
Description | The LockID that you wish to retrieve information about |
Example | 06050408434e47533137303434303431 |
Parameter | accesskey |
Required | yes |
Parameter Type | query |
Value Type | string |
Description | K3 Connect access key that is the admin of the lock. This can be found in the User Info section of the K3 Connect App |
Example | rspr7tps3q |
Parameter | page |
Required | no |
Parameter Type | query |
Value Type | integer |
Description | Page number to return. Default: 1 |
Example | 1 |
Parameter | perpage |
Required | no |
Parameter Type | query |
Value Type | integer |
Description | The audit entries to be returned per page. Default: 50 |
Example | 100 |
Additional Notes
If no C3 Smart phone clients exist for the specified lock, then an empty array is returned.
REQUEST
https://api-connect.codelocks.io/u/2/k3connect/06050408434e47533137303434303431/clients?accesskey=rsp7tps3q&page=1&perpage=100
RESPONSE
[
{
"lockid": "string",
"email": "string",
"status": "string",
"accesstype": "string",
"activeperiods": [
{
"starts": "string",
"ends": "string",
"enabled": true,
"mon": true,
"tue": true,
"wed": true,
"thu": true,
"fri": true,
"sat": true,
"sun": true
}
]
},...
]
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
POST…/k3connect/{id}/client
Create a new smart phone client of a given C3 Smart lock.
Parameters
Parameter | id |
Required | yes |
Parameter Type | path |
Value Type | string |
Description | The LockID to add the smart phone client to. |
Example | 06050408434e47533137303434303431 |
Parameter | accesskey |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | K3 Connect access key that is the admin of the lock. This can be found in the User Info section of the K3 Connect App |
Example | rspr7tps3q |
Parameter | clientemail |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | The email address to be invited as a new smart phone client (needs to be a valid K3 Connect account). |
Example | example@codelocks.com |
Parameter | activeperiods |
Required | yes |
Parameter Type | formdata |
Value Type | JSON |
Description | JSON active periods. Required schema can be found in /k3connect/help/spcconfig endpoint. |
Example |
Parameter | accesstype |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | Type of access to be granted: STANDARD or ONE_TIME |
Example | STANDARD |
Parameter | message |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | Message to include in the invitation |
Example | Test Message |
REQUEST
https://api-connect.codelocks.io/u/2/k3connect/06050408434e47533137303434303431/client
RESPONSE
{
"result": "string"
}
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
PUT …/k3connect/{id}/client
Update an existing smart phone client of a given K3 Connect lock.
Parameters
Parameter | id |
Required | yes |
Parameter Type | path |
Value Type | string |
Description | The LockID to add the C3 smart phone client to. |
Example | 06050408434e47533137303434303431 |
Parameter | accesskey |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | C3 Smart access key that is the admin of the lock. This can be found in the User Info section of the C3 Smart App |
Example | rspr7tps3q |
Parameter | clientemail |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | The email address of the smart phone client you are trying to update (needs to be a valid C3 Smart account). |
Example | example@codelocks.com |
Parameter | activeperiods |
Required | yes |
Parameter Type | formdata |
Value Type | JSON |
Description | JSON active periods. Required schema can be found in /c3smart/help/spcconfig endpoint. |
Example |
REQUEST
https://api-connect.codelocks.io/u/2/k3connect/06050408434e47533137303434303431/client
RESPONSE
{
"result": "string"
}
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
PATCH …/k3connect/{id}/client
Suspend or restore a K3 Connect smart phone client on a given lock.
Parameters
Parameter | id |
Required | yes |
Parameter Type | path |
Value Type | string |
Description | The LockID to add the smart phone client to. |
Example | 06050408434e47533137303434303431 |
Parameter | accesskey |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | K3 Connect access key that is the admin of the lock. This can be found in the User Info section of the K3 Connect App |
Example | rspr7tps3q |
Parameter | clientemail |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | The email address of the smart phone client to be suspended or restored (needs to be a valid K3 Connect account). |
Example | example@codelocks.com |
Parameter | action |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | SUSPEND or RESTORE |
Example | SUSPEND |
REQUEST
https://api-connect.codelocks.io/u/2/k3connect/06050408434e47533137303434303431/client
RESPONSE
{
"result": "string"
}
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
DELETE …/k3connect/{id}/client
Delete a specified C3 Smart phone client on a specified lock.
Parameters
Parameter | id |
Required | yes |
Parameter Type | path |
Value Type | string |
Description | The LockID to add the smart phone client to. |
Example | 06050408434e47533137303434303431 |
Parameter | accesskey |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | K3 Connect access key that is the admin of the lock. This can be found in the User Info section of the K3 Connect App |
Example | rspr7tps3q |
Parameter | clientemail |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | The email address smart phone client to be deleted (needs to be a valid K3 Connect account). |
Example | example@codelocks.com |
REQUEST
https://api-connect.codelocks.io/u/2/k3connect/06050408434e47533137303434303431/client
RESPONSE
{
"result": "string"
}
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |
GET …/k3connect/help/spcconfig
Get schema information for K3 Connect active periods.
Parameters
Parameter | accesskey |
Required | yes |
Parameter Type | formdata |
Value Type | string |
Description | K3 Connect access key can be found in the User Info section of the K3 Connect App |
Example | rspr7tps3q |
REQUEST
https://api-connect.codelocks.io/u/2/k3connect/help/spcconfig?accesskey=rspr7tps3q
RESPONSE
{
"activeperiods": "string",
"schema": "string"
}
RESPONSE CODES
Code | Status |
200 | OK |
400 | Invalid data supplied |
403 | Missing or invalid authentication key |
404 | Missing required parameter |
422 | Unprocessible entity. Parameters invalid. |
500 | Internal server error |
502 | Tertiary endpoint error |