Connect API V2 Documentation

The Codelocks Connect API is organised around REST.

Codelocks has an PHP example of using the API with GuzzleHTTP.

https://github.com/Codelocks/customer-examples

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.


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

Parameterid
Requiredyes
Parameter Typepath
Value Typestring
DescriptionFor 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
Parameterlockmodel
Requiredyes
Parameter Typequery
Value Typestring
DescriptionThis is the lock model. Allowed values are : KL1060, KL1060C2, KL1060G3, CL5000N, C3SMART or K3CONNECT
ExampleKL1060
Parameterduration
Requiredyes
Parameter Typequery
Value Typestring
DescriptionThis is the durationID. You can use the durations endpoint to see the available durations for your lock model and corresponding start times.
Example0
Parameterstart
Requiredyes
Parameter Typequery
Value Typestring
DescriptionThis 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
Example2020-10-01 16:00
Parameteridentifer
Requiredyes
Parameter Typequery
Value Typestring
DescriptionFor 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
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

Utility: General


GET …/init

Generates a Lock initialisation sequence for a KitLock or CL5000N lock.

Parameters

Parameterlockmodel
Requiredyes
Parameter Typequery
Value Typestring
DescriptionThis is the lock model. Allowed values are :, KL1060, KL1060C2, KL1060G3, CL5000N, C3SMART or K3CONNECT
ExampleC3SMART
Parametermastercode
Requiredno
Parameter Typequery
Value Typestring
DescriptionIf provided this will be incorporated into the generated initialisation code.
Example11223344
Parametertimezone
Requiredno
Parameter Typequery
Value Typestring
DescriptionThe timezone the lock is in.
ExampleEurope/London
Parameterrandomid
Requiredno
Parameter Typequery
Value Typestring
DescriptionGenerate 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.
Exampletrue
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
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary 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

Parameterlockmodel
Requiredyes
Parameter Typequery
Value Typestring
DescriptionThis is the lock model. Allowed values are :, KL1060, KL1060C2, KL1060G3, CL5000N, C3SMART or K3CONNECT
ExampleC3SMART
Parameteroperation
Requiredno
Parameter Typequery
Value Typestring
DescriptionAvailable operations: durations or modes, Default: durations
Example11223344
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
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

GET …/duration/modes

Provides all the unique modes for a given lock model

Parameters

Parameterlockmodel
Requiredyes
Parameter Typequery
Value Typestring
DescriptionThis is the lock model. Allowed values are : KL1060, KL1060C2, KL1060G3, CL5000N, C3SMART or K3CONNECT
ExampleC3SMART
REQUEST
https://api-connect.codelocks.io/u/2/duration/modes?lockmodel=C3SMART
RESPONSE
[
    {
        "Mode": "string",
        "SubMode": "string",
        "LockModels": "string"
    }...
]
RESPONSE CODES
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary 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

Parameterid
Requiredyes
Parameter Typepath
Value Typeinteger
DescriptionDuration ID value
Example0
Parameterlockmodel
Requiredyes
Parameter Typequery
Value Typestring
DescriptionThis is the lock model. Allowed values are : KL1060, KL1060C2, KL1060G3, CL5000N, C3SMART or K3CONNECT
ExampleC3SMART
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
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

Utility: C3 Smart


GET …/c3smart/account

Get C3Smart account information

Parameters

Parameteraccesskey
Requiredyes
Parameter Typequery
Value Typestring
DescriptionC3 Smart access key to retrieve the account information for. This can be found in the User Info section of the C3 Smart App
Examplerspr7tps3q
REQUEST
https://api-connect.codelocks.io/u/2/c3smart/account?accesskey=rsp7tps3q
RESPONSE
 {
   "email": "string",
   "spccmstatus": "string"
 }
RESPONSE CODES
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

GET …/c3smart

Returns a list of C3 Smart locks, use for retrieving key information enabling the generation of NetCodes.

Parameters

Parameteraccesskey
Requiredyes
Parameter Typequery
Value Typestring
DescriptionC3 Smart access key to retrieve the locks information for. This can be found in the User Info section of the C3 Smart App
Examplerspr7tps3q
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
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary 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

Parameterid
Requiredyes
Parameter Typepath
Value Typestring
DescriptionThe LockId that you wish to retrieve information about
Example06050408434e47533137303434303431
Parameteraccesskey
Requiredyes
Parameter Typequery
Value Typestring
DescriptionC3 Smart access key that is the admin of the lock. This can be found in the User Info section of the C3 Smart App
Examplerspr7tps3q
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
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

GET …/c3smart/{id}/audit

Get the audit information of a given C3 Smart lock.

Parameters

Parameterid
Requiredyes
Parameter Typepath
Value Typestring
DescriptionThe Lock Identifier that you wish to retrieve audit information about
Example06050408434e47533137303434303431
Parameteraccesskey
Requiredyes
Parameter Typequery
Value Typestring
DescriptionC3 Smart access key that is the admin of the lock. This can be found in the User Info section of the C3 Smart App
Examplerspr7tps3q
Parameterpage
Requiredno
Parameter Typequery
Value Typeinteger
DescriptionPage number to return
Example1
Parameterperpage
Requiredno
Parameter Typequery
Value Typeinteger
DescriptionThe quantity of audit entries to be returned per page (max 100)
Example100
Parameterpageorder
Requiredno
Parameter Typequery
Value Typestring
DescriptionOrder to sort the results before returning them: ascending or descending
Exampledescending
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
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

GET …/c3smart/{id}/clients

Get the smart phone clients of a given C3 Smart lock.

Parameters

Parameterid
Requiredyes
Parameter Typepath
Value Typestring
DescriptionThe LockID that you wish to retrieve smart phone client information from.
Example06050408434e47533137303434303431
Parameteraccesskey
Requiredyes
Parameter Typequery
Value Typestring
DescriptionC3 Smart access key that is the admin of the lock. This can be found in the User Info section of the C3 Smart App
Examplerspr7tps3q
Parameterpage
Requiredno
Parameter Typequery
Value Typeinteger
DescriptionPage number to return. Default 1
Example1
Parameterperpage
Requiredno
Parameter Typequery
Value Typeinteger
DescriptionThe number of audit entries to be returned per page. Default 50
Example100
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
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

POST…/c3smart/{id}/client

Create a new Smart Phone client of a given C3 Smart lock.

Parameters

Parameterid
Requiredyes
Parameter Typepath
Value Typestring
DescriptionThe LockId to add the Smart Phone client to.
Example06050408434e47533137303434303431
Parameteraccesskey
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionC3 Smart access key that is the admin of the lock. This can be found in the User Info section of the C3 Smart app
Examplerspr7tps3q
Parameterclientemail
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionThe email address to be invited as a new Smart Phone client (needs to be a valid C3 Smart account)
Exampleexample@codelocks.com
Parameteractiveperiods
Requiredyes
Parameter Typeformdata
Value TypeJSON
DescriptionJSON active periods. Required schema can be found in /c3smart/help/spcconfig endpoint.
Example
Parameteraccesstype
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionType of access to be granted: STANDARD or ONE_TIME
ExampleSTANDARD
Parametermessage
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionMessage to include in the invitation
ExampleTest Message
REQUEST
https://api-connect.codelocks.io/u/2/c3smart/06050408434e47533137303434303431/client
RESPONSE
{
  "result": "string"
}
RESPONSE CODES
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

PUT …/c3smart/{id}/client

Update an existing smart phone client of a given C3 Smart lock.

Parameters

Parameterid
Requiredyes
Parameter Typepath
Value Typestring
DescriptionThe LockID to add the smart phone client to.
Example06050408434e47533137303434303431
Parameteraccesskey
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionC3 Smart access key that is the admin of the lock. This can be found in the User Info section of the C3 Smart App
Examplerspr7tps3q
Parameterclientemail
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionThe email address of the smart phone client to be updated (needs to be a valid C3 Smart account).
Exampleexample@codelocks.com
Parameteractiveperiods
Requiredyes
Parameter Typeformdata
Value TypeJSON
DescriptionJSON 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
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

PATCH …/c3smart/{id}/client

Suspend or restore a smart phone client on a given lock

Parameters

Parameterid
Requiredyes
Parameter Typepath
Value Typestring
DescriptionThe Lock ID to add the smart phone client to.
Example06050408434e47533137303434303431
Parameteraccesskey
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionC3 Smart access key that is the admin of the lock. This can be found in the User Info section of the C3 Smart App
Examplerspr7tps3q
Parameterclientemail
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionThe email address of the smart phone client to be suspended or restored (needs to be a valid C3 Smart account).
Exampleexample@codelocks.com
Parameteraction
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionSUSPEND or RESTORE
ExampleSUSPEND
REQUEST
https://api-connect.codelocks.io/u/2/c3smart/06050408434e47533137303434303431/client
RESPONSE
{
  "result": "string"
}
RESPONSE CODES
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

DELETE …/c3smart/{id}/client

Delete a specified C3 smart phone client on a specified lock.

Parameters

Parameterid
Requiredyes
Parameter Typepath
Value Typestring
DescriptionThe LockID to add the smart phone client to.
Example06050408434e47533137303434303431
Parameteraccesskey
Requiredyes
Parameter Typequery
Value Typestring
DescriptionC3 Smart access key that is the admin of the lock. This can be found in the User Info section of the C3 Smart App
Examplerspr7tps3q
Parameterclientemail
Requiredyes
Parameter Typequery
Value Typestring
DescriptionThe email address of the smart phone client to be deleted (needs to be a valid C3 Smart account).
Exampleexample@codelocks.com
REQUEST
https://api-connect.codelocks.io/u/2/c3smart/06050408434e47533137303434303431/client
RESPONSE
{
  "result": "string"
}
RESPONSE CODES
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

GET …/c3smart/help/spcconfig

Get the schema and other information for active period configuration.

Parameters

Parameteraccesskey
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionC3 Smart access key can be found in the User Info section of the C3 Smart app
Examplerspr7tps3q
REQUEST
https://api-connect.codelocks.io/u/2/c3smart/help/spcconfig?accesskey=rspr7tps3q
RESPONSE
{
  "activeperiods": "string",
  "schema": "string"
}
RESPONSE CODES
CodeStatus
200OK
400Invalid Data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

GET …/k3connect/account

Get K3 Connect account information.

Parameters

Parameteraccesskey
Requiredyes
Parameter Typequery
Value Typestring
DescriptionK3 Connect access key to retrieve the account information for. This can be found in the User Info section of the K3 Connect App
Examplerspr7tps3q
REQUEST
https://api-connect.codelocks.io/u/2/k3connect/account?accesskey=rsp7tps3q
RESPONSE
{
  "email": "string",
  "spccmstatus": "string"
}
RESPONSE CODES
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

GET …/k3connect

Returns a list of K3 Connect locks, use for retrieving key information enabling the generation of NetCodes.

Parameters

Parameteraccesskey
Requiredyes
Parameter Typequery
Value Typestring
DescriptionK3 Connect access key to retrieve the account information from. This can be found in the User Info section of the K3 Connect App
Examplerspr7tps3q
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
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary 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

Parameterid
Requiredyes
Parameter Typepath
Value Typestring
DescriptionThe LockID that you wish to retrieve information for.
Example06050408434e47533137303434303431
Parameteraccesskey
Requiredyes
Parameter Typequery
Value Typestring
DescriptionK3 Connect access key that is the admin of the lock. This can be found in the User Info section of the K3 Connect App
Examplerspr7tps3q
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
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

GET …/k3connect/{id}/audit

Get the audit information of a given K3 Connect lock.

Parameters

Parameterid
Requiredyes
Parameter Typepath
Value Typestring
DescriptionThe LockID that you wish to retrieve audit information about.
Example06050408434e47533137303434303431
Parameteraccesskey
Requiredyes
Parameter Typequery
Value Typestring
DescriptionK3 Connect access key that is the admin of the lock. This can be found in the User Info section of the K3 Connect App
Examplerspr7tps3q
Parameterpage
Requiredno
Parameter Typequery
Value Typeinteger
DescriptionPage number to return
Example1
Parameterperpage
Requiredno
Parameter Typequery
Value Typeinteger
DescriptionThe number of audit entries to be returned per page (max 100)
Example100
Parameterpageorder
Requiredno
Parameter Typequery
Value Typestring
DescriptionOrder to sort the results before returning them: ascending or descending
Exampledescending
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
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

GET …/k3connect/{id}/clients

Get the smart phone client of a given K3 Connect lock.

Parameters

Parameterid
Requiredyes
Parameter Typepath
Value Typestring
DescriptionThe LockID that you wish to retrieve information about
Example06050408434e47533137303434303431
Parameteraccesskey
Requiredyes
Parameter Typequery
Value Typestring
DescriptionK3 Connect access key that is the admin of the lock. This can be found in the User Info section of the K3 Connect App
Examplerspr7tps3q
Parameterpage
Requiredno
Parameter Typequery
Value Typeinteger
DescriptionPage number to return. Default: 1
Example1
Parameterperpage
Requiredno
Parameter Typequery
Value Typeinteger
DescriptionThe audit entries to be returned per page. Default: 50
Example100
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
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

POST…/k3connect/{id}/client

Create a new smart phone client of a given C3 Smart lock.

Parameters

Parameterid
Requiredyes
Parameter Typepath
Value Typestring
DescriptionThe LockID to add the smart phone client to.
Example06050408434e47533137303434303431
Parameteraccesskey
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionK3 Connect access key that is the admin of the lock. This can be found in the User Info section of the K3 Connect App
Examplerspr7tps3q
Parameterclientemail
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionThe email address to be invited as a new smart phone client (needs to be a valid K3 Connect account).
Exampleexample@codelocks.com
Parameteractiveperiods
Requiredyes
Parameter Typeformdata
Value TypeJSON
DescriptionJSON active periods. Required schema can be found in /k3connect/help/spcconfig endpoint.
Example
Parameteraccesstype
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionType of access to be granted: STANDARD or ONE_TIME
ExampleSTANDARD
Parametermessage
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionMessage to include in the invitation
ExampleTest Message
REQUEST
https://api-connect.codelocks.io/u/2/k3connect/06050408434e47533137303434303431/client
RESPONSE
{
  "result": "string"
}
RESPONSE CODES
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

PUT …/k3connect/{id}/client

Update an existing smart phone client of a given K3 Connect lock.

Parameters

Parameterid
Requiredyes
Parameter Typepath
Value Typestring
DescriptionThe LockID to add the C3 smart phone client to.
Example06050408434e47533137303434303431
Parameteraccesskey
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionC3 Smart access key that is the admin of the lock. This can be found in the User Info section of the C3 Smart App
Examplerspr7tps3q
Parameterclientemail
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionThe email address of the smart phone client you are trying to update (needs to be a valid C3 Smart account).
Exampleexample@codelocks.com
Parameteractiveperiods
Requiredyes
Parameter Typeformdata
Value TypeJSON
DescriptionJSON 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
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

PATCH …/k3connect/{id}/client

Suspend or restore a K3 Connect smart phone client on a given lock.

Parameters

Parameterid
Requiredyes
Parameter Typepath
Value Typestring
DescriptionThe LockID to add the smart phone client to.
Example06050408434e47533137303434303431
Parameteraccesskey
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionK3 Connect access key that is the admin of the lock. This can be found in the User Info section of the K3 Connect App
Examplerspr7tps3q
Parameterclientemail
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionThe email address of the smart phone client to be suspended or restored (needs to be a valid K3 Connect account).
Exampleexample@codelocks.com
Parameteraction
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionSUSPEND or RESTORE
ExampleSUSPEND
REQUEST
https://api-connect.codelocks.io/u/2/k3connect/06050408434e47533137303434303431/client
RESPONSE
{
  "result": "string"
}
RESPONSE CODES
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

DELETE …/k3connect/{id}/client

Delete a specified C3 Smart phone client on a specified lock.

Parameters

Parameterid
Requiredyes
Parameter Typepath
Value Typestring
DescriptionThe LockID to add the smart phone client to.
Example06050408434e47533137303434303431
Parameteraccesskey
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionK3 Connect access key that is the admin of the lock. This can be found in the User Info section of the K3 Connect App
Examplerspr7tps3q
Parameterclientemail
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionThe email address smart phone client to be deleted (needs to be a valid K3 Connect account).
Exampleexample@codelocks.com
REQUEST
https://api-connect.codelocks.io/u/2/k3connect/06050408434e47533137303434303431/client
RESPONSE
{
  "result": "string"
}
RESPONSE CODES
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error

GET …/k3connect/help/spcconfig

Get schema information for K3 Connect active periods.

Parameters

Parameteraccesskey
Requiredyes
Parameter Typeformdata
Value Typestring
DescriptionK3 Connect access key can be found in the User Info section of the K3 Connect App
Examplerspr7tps3q
REQUEST
https://api-connect.codelocks.io/u/2/k3connect/help/spcconfig?accesskey=rspr7tps3q
RESPONSE
{
  "activeperiods": "string",
  "schema": "string"
}
RESPONSE CODES
CodeStatus
200OK
400Invalid data supplied
403Missing or invalid authentication key
404Missing required parameter
422Unprocessible entity. Parameters invalid.
500Internal server error
502Tertiary endpoint error