Doorlock Operation Capability

Last Updated on : 2025-06-20 02:19:02download

This article introduces APIs related to doorlock operation capabilities.

API List

Request method API Description
POST /v1.0/osaas/projects/{project_id}/card-issue-devices/lock-devices/{device_id}/cards Doorlock card operation: issue card (use the unique id of the card generated by the card issuer to issue the door card to the door lock, so as to achieve the operation of unlocking with the specified card)
DELETE /v1.0/osaas/projects/{project_id}/card-issue-devices/lock-devices/{device_id}/cards/{lock_card_id} Doorlock card operation: delete card (use the unique id of the card to send a delete card command to the doorlock, so that the card will be invalid for unlocking the doorlock)
PUT /v1.0/osaas/projects/{project_id}/card-issue-devices/lock-devices/{device_id}/cards/{lock_card_id}/freeze-status Doorlock card operation: card status modification (use the unique id of the card to modify the status of the card corresponding to the specified doorlock, supporting two operations of freezing and unfreezing)
PUT /v1.0/osaas/projects/{project_id}/card-issue-devices/lock-devices/{device_id}/cards/{lock_card_id} Doorlock card operation: card modification (modify the card effective time and expiration time of the corresponding doorlock without using the card issuer to re-make the card)
GET /v1.0/cloud/osaas/projects/{project_id}/card-issue-devices/lock-devices/{device_id}/cards/{lock_card_id} Doorlock card operation: query card (use the door lock card unique id to query the card information corresponding to the specified door lock)

Issue Card

This article introduces the API for issuing cards.

API Description

Use the unique id of the card generated by the card issuer to issue the card to the doorlock, so as to achieve the operation of unlocking with the specified card.

API Address

POST: /v1.0/osaas/projects/{project_id}/card-issue-devices/lock-devices/{device_id}/cards

Request Parameters

Parameter Type Position Mandatory Description
project_id String uri true Unique ID of the project
device_id String uri true Unique ID of the device
request LockCardIssueRequest false Request

request description

Parameter Type Position Mandatory Description
card_id String true Unique ID of the card

Response Parameters

Parameter Type Description
result LockCardOperateResponse Doorlock card return message body

result description

Parameter Type Description
operate_id String Operation unique ID
operate_result Boolean Operation result
lock_card_id String The unique identification of the doorlock card

Request Example

POST: /v1.0/osaas/projects/150188910571223***/card-issue-devices/lock-devices/6c470253258246b99*****/cards

Response Example

{
    "tid": "aae3ead40e3a11ed818882d0e****",
    "result": {
        "lock_card_id": "3245***",
        "operate_id": "1552534592777359***",
        "operate_result": true
    },
    "t": 1658988066464,
    "success": true
}

Card Modification

This article describes the API for modifying cards.

API Description

Modify the card effective time and expiration time of the corresponding doorlock without using the card issuer to re-make the card.

API Address

PUT: /v1.0/osaas/projects/{project_id}/card-issue-devices/lock-devices/{device_id}/cards/{lock_card_id}

Request Parameters

Parameter Type Position Mandatory Description
project_id String uri true Unique ID of the project
device_id String uri true Unique ID of the device
lock_card_id String uri true Unique ID of the doorlock card
request LockCardUpdateRequest false Request

request description

Parameter Type Position Mandatory Description
begin_time Long false Effective time
end_time Long false Expiration time

Response Parameters

Parameter Type Description
result LockCardOperateResponse Doorlock card return message body

result description

Parameter Type Description
operate_id String Unique ID of the operation
operate_result Boolean Operation result
lock_card_id String Unique ID of the doorlock card

Request Example

PUT: /v1.0/osaas/projects/15018891057122****/card-issue-devices/lock-devices/6c470253258246b99****/cards/3245***

Response Example

{
    "tid": "aae3ead40e3a11ed818882d0e****",
    "result": {
        "lock_card_id": "3245***",
        "operate_id": "3245***",
        "operate_result": true
    },
    "t": 1658988066464,
    "success": true
}

Delete Card

This article describes the API for deleting cards.

API Description

Use the unique id of the card to send a delete card command to the doorlock, so that the card will be invalid for unlocking the doorlock.

API Address

DELETE: /v1.0/osaas/projects/{project_id}/card-issue-devices/lock-devices/{device_id}/cards/{lock_card_id}

Request Parameters

Parameter Type Position Mandatory Description
project_id String uri true Unique ID of the project
device_id String uri true Unique ID of the device
lock_card_id String uri true Unique ID of the doorlock card

Response Parameters

Parameter Type Description
result LockCardOperateResponse Doorlock card return message body

result description

Parameter Type Description
operate_id String Unique ID of the operation
operate_result Boolean Operation result
lock_card_id String Unique ID of the doorlock card

Request Example

DELETE: /v1.0/osaas/projects/150188910571223***/card-issue-devices/lock-devices/6c470253258246b99*****/cards/3245***

Response Example

{
    "tid": "aae3ead40e3a11ed818882d0e****",
    "result": {
        "lock_card_id": "3245***",
        "operate_id": "1552534592777359***",
        "operate_result": true
    },
    "t": 1658988066464,
    "success": true
}

Card Status Modification

This article introduces the API for modifying the state of a card.

API Description

Use the unique id of the card to modify the status of the card corresponding to the specified doorlock, supporting two operations of freezing and unfreezing)

API Address

PUT: /v1.0/osaas/projects/{project_id}/card-issue-devices/lock-devices/{device_id}/cards/{lock_card_id}/freeze-status

Request Parameters

Parameter Type Position Mandatory Description
project_id String uri true Unique ID of the project
device_id String uri true Unique ID of the device
lock_card_id String uri true Unique ID of the doorlock card
request LockCardFreezeRequest false Request to modify card status

request description

Parameter Type Position Mandatory Description
freeze_status LockFreezeStatusEnum true Card Operation Status
  • 0:freeze
  • 1:unfreeze

Response Parameters

Parameter Type Description
result LockCardOperateResponse Doorlock card operation result

result description

Parameter Type Description
operate_id String Unique ID of the operation
operate_result Boolean Operation result
lock_card_id String Unique ID of the doorlock card

Request Example

PUT: /v1.0/osaas/projects/150188910571223***/card-issue-devices/lock-devices/6c470253258246b99***/cards/3245***/freeze-status
{
  "freeze_status": 1
}

Response Example

{
    "tid": "aae3ead40e3a11ed818882d0e***",
    "result": {
        "lock_card_id": "3245***",
        "operate_id": "1552534592777359***",
        "operate_result": true
    },
    "t": 1658988066464,
    "success": true
}

Query Card

This article introduces the API for querying cards.

API Description

According to the unique identification of the door lock card, query the card information corresponding to the specified door lock and return information such as the card validity period.

API Address

GET:/v1.0/cloud/osaas/projects/{project_id}/card-issue-devices/lock-devices/{device_id}/cards/{lock_card_id}

Request Parameters

Parameter Type Position Mandatory Description
project_id String uri true Unique ID of the project
device_id String uri true Unique ID of the device
lock_card_id String uri true Unique ID of the doorlock card

Response Parameters

Parameter Type Description
result LockCardInfoResponse Doorlock card operation result

result description

Parameter Type Description
lock_card_id String Unique ID of the doorlock card
begin_time Long Card effective time, 13-digit timestamp
end_time Long Card expiration time, 13-digit timestamp

Request Example

GET:/v1.0/cloud/osaas/projects/150188910571223***/card-issue-devices/lock-devices/6c470253258246b99***/cards/3245***

Response Example

{
    "tid": "aae3ead40e3a11ed818882d0e***",
    "result": {
        "lock_card_id": "3245***",
        "begin_time": 1750226997548,
        "end_time": 1750227997548
    },
    "t": 1658988066464,
    "success": true
}