Identity Cards

Identity Cards are used to access a given lock. On this page, we'll dive into the different Identity Card endpoints you can use to manage them programmatically.

The identity Card model

The Identity Card model contains all the information about them.

Properties

  • Name
    cardId
    Type
    integer
    Description

    The ID of the Identity Card.

  • Name
    lockId
    Type
    integer
    Description

    The lock's unique identifier.

  • Name
    cardNumber
    Type
    string
    Description

    The card number.

  • Name
    cardName
    Type
    string
    Description

    The card name.

  • Name
    startDate
    Type
    long
    Description

    The time when the card becomes valid (in milliseconds)

  • Name
    endDate
    Type
    long
    Description

    The time when the card expires (in milliseconds)

  • Name
    createDate
    Type
    long
    Description

    Init time (in milliseconds)

  • Name
    senderUsername
    Type
    String
    Description

    The username of the user who created the identity Card

Identity Card Object

{
  "cardId": 1234567,
  "lockId": 456789,
  "cardNumber": "1234567890123456",
  "cardName": "Office Card",
  "startDate": 1672689580361,
  "endDate": 1675281580361,
  "createDate": 1672689580361,
  "senderUsername": "John"
}

GET/api/v1/card/list

List all identity cards

This endpoint allows you to retrieve a paginated list of all identity cards for a specific lock.

Required attributes

  • Name
    lockId
    Type
    integer
    Description

    The lock's unique identifier.

  • Name
    pageNo
    Type
    integer
    Description

    Page number

  • Name
    pageSize
    Type
    integer
    Description

    Page size minimum 10, maximum 1000

Request

GET
/api/v1/card/list
curl --location --request GET 'https://api.dusaw.com/api/v1/card/list?lockId=456789&pageNo=1&pageSize=20' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {token}'

Response

{
  "list": [
    ...
    {
      "cardId": 1234567,
      "lockId": 456789,
      "cardNumber": "1234567890123456",
      "cardName": "Office Card",
      "startDate": 1672689580361,
      "endDate": 1675281580361,
      "createDate": 1672689580361,
      "senderUsername": "John"
    }
    ...
  ],
  "pageNo":1,
  "pageSize":10,
  "pages":3,
  "total":25
}

POST/api/v1/card/add

Add identity card

This endpoint allows you to add a new identity card to a lock.

Required attributes

  • Name
    lockId
    Type
    integer
    Description

    The lock's unique identifier.

  • Name
    cardNumber
    Type
    string
    Description

    The card number.

  • Name
    cardName
    Type
    string
    Description

    The card name.

  • Name
    startDate
    Type
    long
    Description

    The time when the card becomes valid (in milliseconds)

  • Name
    endDate
    Type
    long
    Description

    The time when the card expires (in milliseconds)

Request

POST
/api/v1/card/add
curl --location --request POST 'https://api.dusaw.com/api/v1/card/add' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {token}' \
  --data-raw '{
    "lockId": 456789,
    "cardNumber": "1234567890123456",
    "cardName": "Office Card",
    "startDate": 1672689580361,
    "endDate": 1675281580361
  }'

Response

{
  "cardId": 1234567,
  "cardNumber": "1234567890123456"
}

POST/api/v1/card/delete

Delete identity card

This endpoint allows you to delete an identity card from a lock.

Required attributes

  • Name
    lockId
    Type
    integer
    Description

    The lock's unique identifier.

  • Name
    cardId
    Type
    integer
    Description

    The card ID.

Request

POST
/api/v1/card/delete
curl --location --request POST 'https://api.dusaw.com/api/v1/card/delete' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {token}' \
  --data-raw '{
    "lockId": 456789,
    "cardId": 1234567
  }'

Response

{
  "success": true
}

Was this page helpful?