DLock
This resource represents a digital lock key, a LIVE Lock key wrapped into an InVue Certificate that is used by the Mobile SDK to open locks in conjunction with a Customer Intermediate Certificate.
The creation of such a Key Certificate requires a Customer Intermediate Certificate for signature.
POST
Creating a Key Certificate.
This request is used to enroll new locks and procure the Key Certificate required to operate the lock. The Lock Serial Number is the primary key here and can not be registered twice. The key certificates are unique for each lock.
POST https://api.invue.com/v1/dlock
Example request:
POST /v1/dlock HTTP/1.1
Host: api.invue.com
Authorization: Bearer 181d415f34379af07b2c11d144dfbe35d.181d415f34379af07b2c11d144dfbe35d.181d415f34379af07b2c11d144dfbe35d
Content-Type: application/json
Accept: application/json
Accept-Charset: utf-8
{
"serial_no" : "0000051a00000005",
"type": "CAM",
"certificate": "Certificate Owner",
"enrolment_code": "Uyu7y0bmu5sTdGwN1GcJHK3MnPYGc1n2fuYFz8TbVgbvRNk7tgfxE1eLLrWium0T+64Ra4KOzZy1u/Ha+i/UeoGdBk+tY/Kle/Nr8e2gkksl1BMpijWSY/tvhFBqFhcUPbkCagN6ep2azG2Ir8y8r5IySY9mwHZlRbfQxsM43LdcpDcYK9m0WO0A7fGEmB+cZ7u9uLuqkJ04oNC+4p1X4N9n4yMdvUF3SQLQOgFHfjkv0w67+TJq5J4uY/6x6G+2kwAFROO4VJgaAG/CO7GJZ/xIDxe52PgGj6AwojCqRMBZUXvDrC8Hg/JCQdjPSyv5T+MvFXMucoCdwpvr09Lu4A==",
"base64": true
}
Where JSON parameters are:
Field | Type | Description |
---|---|---|
serial_no | string | The serial number of the lock to be provisioned/registered |
type | string | The type of lock. This can be an empty string. |
certificate | string | The owner value of your certificate, also referred to as the certificate name. This will be provided with the Customer Intermediate Certificate. |
enrolment_code | string | This is the enrolment code returned by the lock. It will be used by the API to calculate the key for this lock. |
base64 | Boolean | When true, will return the Key Certificate in base64 encoding. This is the format required by the Mobile SDK. When false, the certificate is returned in its native JSON format. If you get the certificate this way, you will need to do the base64 encoding yourself. Alternatively, you can do a GET to request the certificate in any format. |
Response
Example response with base64 = true:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"status": 200,
"msg": "DLock registered successfully",
"data": {
"key": "eyJ0eXBlIjoia2V5IiwiaXNzdWVyIjoid2luZ21hbiIsInZhbGlkIjowLCJleHBpcmVzIjowLCJkYXRhIjp7fSwia2V5IjoiSmhibllkc29zMnErVkRQQVNjbERES2RYTVozeUs0Mi9KTStBLzJkMlpxMUdUTTNNa3lEK0FzL1MwaGJVQWxzNDU0Ri9OdEJ0YlhIT3N2Q0RHaG9yRDEvbEsyd0ZJQjVvNks3TjJSK25xbEdmY1FsZGlvdVlaSTd0L1BPZ3M3bGkwb2lnRjU4N3k5YUI2Q0FhMlQ4UWJwYk1ZQzZTZElrcFhMdzc5MlZBc0ZQNDVoenlkK2duM1kwSG9KdFlMSDg2VjJxYlF2QWVLZGxxV3h3YjI2TG5KQThJZVNzMC9ieCsxQVBlOUdUNVYzMGlEZFVxUHU1ZkF4dXJKckdpc2laRHI3bVpMTFBvRmU5MFl3M2F2ZWlDdDhMRENNUUJ3M1VuaHREM2tRQXprUmFuVlFXYnNKT0Z5N1JSQnFJMnQvNFBvazk3YllPUFU2U3JaUTlmZEhMdit3PT0iLCJzaWduYXR1cmUiOiJsYXJPOVp0eTZuQ0czREw2NE1FVFIzeXhEc2VTdmdFc2hmN3U2Y3VBOWdHWHNWNmIwZWVVTGdoMjllRWV5aXBTVWhlSWlHeThFbFFtbUprdEM1YTd6d3F2Um5lS2wvVkVQcmVCNEdkM05vSkdtSlFGU2kycXY5elJBYVFBZXFoWGJMSWM3amRjamNwUnJyTFNEZWxFUjcvTVNVY1IvMHFPN0VJU25uSUhZNjVYeXorRnZXSWdmemF5cWhLVFdhM3dEdmZLM2pNb1VVSXBhdE5tcTVZSmVPWGxUdzVLTFdPdUV5Vjg1d21QUTFWRy9qcnVtenByVThHVVM3QytiWHdDNTJVeGdHV0t6VnIwSlEvaGVZM3JaVHp5RTRFWDYwUk9EUE1YVEk5MnliSm1yQmhVMlN0WTJLNVNoL2FZRXlEN1c5eGFFcUdzcUIrK3hFMTFUcGptMlE9PSJ9"
}
}
Example response with base64 = false:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"status": 200,
"msg": "DLock registered successfully",
"data": {
"key": {
"type": "key",
"issuer": "customer",
"valid": 0,
"expires": 0,
"data": {},
"key": "JhbnYdsos2q+VDPASclDDKdXMZ3yK42/JM+A/2d2Zq1GTM3MkyD+As/S0hbUAls454F/NtBtbXHOsvCDGhorD1/lK2wFIB5o6K7N2R+nqlGfcQldiouYZI7t/POgs7li0oigF587y9aB6CAa2T8QbpbMYC6SdIkpXLw792VAsFP45hzyd+gn3Y0HoJtYLH86V2qbQvAeKdlqWxwb26LnJA8IeSs0/bx+1APe9GT5V30iDdUqPu5fAxurJrGisiZDr7mZLLPoFe90Yw3aveiCt8LDCMQBw3UnhtD3kQAzkRanVQWbsJOFy7RRBqI2t/4Pok97bYOPU6SrZQ9fdHLv+w==",
"signature": "larO9Zty6nCG3DL64METR3yxDseSvgEshf7u6cuA9gGXsV6b0eeULgh29eEeyipSUheIiGy8ElQmmJktC5a7zwqvRneKl/VEPreB4Gd3NoJGmJQFSi2qv9zRAaQAeqhXbLIc7jdcjcpRrrLSDelER7/MSUcR/0qO7EISnnIHY65Xyz+FvWIgfzayqhKTWa3wDvfK3jMoUUIpatNmq5YJeOXlTw5KLWOuEyV85wmPQ1VG/jrumzprU8GUS7C+bXwC52UxgGWKzVr0JQ/heY3rZTzyE4EX60RODPMXTI92ybJmrBhU2StY2K5Sh/aYEyD7W9xaEqGsqB++xE11Tpjm2Q=="
}
}
}
Where the data object contains the following payload:
Field | Type | Description |
---|---|---|
key | string | The Key Certificate. This certificate will be expected in base64 encoding by the Mobile SDK. |
Possible errors:
Error code | Description |
---|---|
400 Bad Request | There was an error with the request, no installer code, or invalid installer code. |
401 Unauthorized | The accessToken is invalid or has been revoked. |
403 Forbidden | The accessToken is valid, but the owner of the token was not granted access to the resource. |
GET
Getting the Key Certificate for a lock that has been provisioned.
Returns the DLock’s resource if the DLock has been registered to the api key owner.
GET https://api.invue.com/v1/dlock/{{lock-serial}}?base64=true
Example request:
GET /v1/dlock/0000051a00000000?base64=true
Host: api.invue.com
Authorization: Bearer 181d415f34379af07b2c11d144dfbe35d.181d415f34379af07b2c11d144dfbe35d.181d415f34379af07b2c11d144dfbe35d
Content-Type: application/json
Accept: application/json
Accept-Charset: utf-8
The GET request requires the serial number of the lock for which the Key Certificate is requested.
Note the request can have a parameter:
?base64=true
When the base64 parameter is present and equals true, the returned certificate will be base64 encoded.
Response
Example response with base64 = true:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"status": 200,
"msg": "DLock registered successfully",
"data": {
"key": "eyJ0eXBlIjoia2V5IiwiaXNzdWVyIjoid2luZ21hbiIsInZhbGlkIjowLCJleHBpcmVzIjowLCJkYXRhIjp7fSwia2V5IjoiSmhibllkc29zMnErVkRQQVNjbERES2RYTVozeUs0Mi9KTStBLzJkMlpxMUdUTTNNa3lEK0FzL1MwaGJVQWxzNDU0Ri9OdEJ0YlhIT3N2Q0RHaG9yRDEvbEsyd0ZJQjVvNks3TjJSK25xbEdmY1FsZGlvdVlaSTd0L1BPZ3M3bGkwb2lnRjU4N3k5YUI2Q0FhMlQ4UWJwYk1ZQzZTZElrcFhMdzc5MlZBc0ZQNDVoenlkK2duM1kwSG9KdFlMSDg2VjJxYlF2QWVLZGxxV3h3YjI2TG5KQThJZVNzMC9ieCsxQVBlOUdUNVYzMGlEZFVxUHU1ZkF4dXJKckdpc2laRHI3bVpMTFBvRmU5MFl3M2F2ZWlDdDhMRENNUUJ3M1VuaHREM2tRQXprUmFuVlFXYnNKT0Z5N1JSQnFJMnQvNFBvazk3YllPUFU2U3JaUTlmZEhMdit3PT0iLCJzaWduYXR1cmUiOiJsYXJPOVp0eTZuQ0czREw2NE1FVFIzeXhEc2VTdmdFc2hmN3U2Y3VBOWdHWHNWNmIwZWVVTGdoMjllRWV5aXBTVWhlSWlHeThFbFFtbUprdEM1YTd6d3F2Um5lS2wvVkVQcmVCNEdkM05vSkdtSlFGU2kycXY5elJBYVFBZXFoWGJMSWM3amRjamNwUnJyTFNEZWxFUjcvTVNVY1IvMHFPN0VJU25uSUhZNjVYeXorRnZXSWdmemF5cWhLVFdhM3dEdmZLM2pNb1VVSXBhdE5tcTVZSmVPWGxUdzVLTFdPdUV5Vjg1d21QUTFWRy9qcnVtenByVThHVVM3QytiWHdDNTJVeGdHV0t6VnIwSlEvaGVZM3JaVHp5RTRFWDYwUk9EUE1YVEk5MnliSm1yQmhVMlN0WTJLNVNoL2FZRXlEN1c5eGFFcUdzcUIrK3hFMTFUcGptMlE9PSJ9"
}
}
Example response with base64 = false:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"status": 200,
"msg": "DLock registered successfully",
"data": {
"key": {
"type": "key",
"issuer": "customer",
"valid": 0,
"expires": 0,
"data": {},
"key": "JhbnYdsos2q+VDPASclDDKdXMZ3yK42/JM+A/2d2Zq1GTM3MkyD+As/S0hbUAls454F/NtBtbXHOsvCDGhorD1/lK2wFIB5o6K7N2R+nqlGfcQldiouYZI7t/POgs7li0oigF587y9aB6CAa2T8QbpbMYC6SdIkpXLw792VAsFP45hzyd+gn3Y0HoJtYLH86V2qbQvAeKdlqWxwb26LnJA8IeSs0/bx+1APe9GT5V30iDdUqPu5fAxurJrGisiZDr7mZLLPoFe90Yw3aveiCt8LDCMQBw3UnhtD3kQAzkRanVQWbsJOFy7RRBqI2t/4Pok97bYOPU6SrZQ9fdHLv+w==",
"signature": "larO9Zty6nCG3DL64METR3yxDseSvgEshf7u6cuA9gGXsV6b0eeULgh29eEeyipSUheIiGy8ElQmmJktC5a7zwqvRneKl/VEPreB4Gd3NoJGmJQFSi2qv9zRAaQAeqhXbLIc7jdcjcpRrrLSDelER7/MSUcR/0qO7EISnnIHY65Xyz+FvWIgfzayqhKTWa3wDvfK3jMoUUIpatNmq5YJeOXlTw5KLWOuEyV85wmPQ1VG/jrumzprU8GUS7C+bXwC52UxgGWKzVr0JQ/heY3rZTzyE4EX60RODPMXTI92ybJmrBhU2StY2K5Sh/aYEyD7W9xaEqGsqB++xE11Tpjm2Q=="
}
}
}
Where the data object contains the following payload:
Field | Type | Description |
---|---|---|
key | string | The Key Certificate. This certificate will be expected in base64 encoding by the Mobile SDK. |
Possible errors:
Error code | Description |
---|---|
401 Unauthorized | The accessToken is invalid or has been revoked. |
404 Not Found | The Lock Serial Number was not found. The lock was not registered to the owner of the API key. |
DELETE
Deletes the Dlock’s resource if the Dlock has been registered to the api key owner.
DELETE https://api.invue.com/v1/dlock/{{lock-serial}}
Example request:
DELETE /v1/dlock/0000051a00000000 HTTP/1.1
Host: api.invue.com
Authorization: Bearer 181d415f34379af07b2c11d144dfbe35d.181d415f34379af07b2c11d144dfbe35d.181d415f34379af07b2c11d144dfbe35d
Content-Type: application/json
Accept: application/json
Accept-Charset: utf-8
Response
HTTP/1.1 204 No Content
Possible errors:
Error code | Description |
---|---|
401 Unauthorized | The accessToken is invalid or has been revoked. |
404 Not Found | The Lock Serial Number was not found. The lock was not registered to the owner of the API key. |
PUT
PATCH
PUT and Patch will return
Error code | Description |
---|---|
405 Method Not Allowed | No such method |