Introduction
If you’d like to use BioStar 2 New Local API as a RESTful API for your own customization or other purposes, you can simply reference this article. This article will guide you to register Suprema Mobile Access(Airfob Portal) to your users in BioStar 2 via New Local API.
Basics & Procedures
For the information on How to User Suprema Mobile Access, please refer to the article below:
[BioStar 2] How to Use Suprema Mobile Access
In order to register Mobile Access to your BioStar 2, you must connect your Airfob Portal to your BioStar 2. Check out the guidelines provided in the above article.
Once your Airfob Portal is connected to your BioStar 2, you can now register Mobile Access to your BioStar 2 Users.
*Please take note
- Mobile Access Card can be used only with the devices that are registered to Mobile Crednetial's Device Registration.
- How to register devices to Airfob Portal:
1. BioStar 2 > Settings > Mobile Credential
2. Airfob Pass App. > Airfob Portal Login > Register Devices
There are 4 steps required to register Mobile Access to your Users:
- Check if the card already exists by the Card ID you’d like to use
- Create a card with the Card ID you’d like to use
- Create a Mobile Access
- Register Mobile Card to your User
API Call & Parameters
- Step 1. Check if the card already exists by the Card ID you’d like to use
[GET]: /api/v2/cards/registered/?card_id={card_id}
[Parameters]
Name | Type | *M/O | Explanation | Value |
|
|
|
|
|
* M – Mandatory, O – Optional
[Response Body]: If the Card ID is not registered
{ "Response": { "code": "0" } } |
[Response Body]: If the Card ID is already used(registered)
{ "Card": { "id": 19, "crdTypUid": 4, "crdCsn": "164438234751549" }, "Response": { "code": "0" } } |
- Step 2. Create a card with the Card ID you’d like to use
[POST]: /api/cards
[Parameters]
Name | Type | *M/O | Explanation | Value |
Card_type.id | String | M | desc: Card Type ID(0:CSN, 1:WIEGAND, 2:SECURE, 3:ACCESS, 4:CSN_MOBILE, 5:WIEGAND_MOBILE, 6:QR/Barcode, 7:BioStar 2 QR) |
|
Card_type.name | String | M | Card Type Name |
|
Card_type.type | String | M | desc: Card Type(1:CSN, 2:SECURE, 3:ACCESS, 10:CSN_WIEGAND, 4:CSN_MOBILE, 5:WIEGAND_MOBILE, 6:QR/Barcode, 7:BioStar 2 QR) |
|
Card_type.mode | String | M |
| “M” |
Start_datetime | String | O | Start_datetime for the Mobile Card |
|
Expiry_datetime | String | O | Expiry datetime for the Mobile Card |
|
Display_card_id | String | O | Card Display ID |
|
Card_id | String | M | Card ID |
|
isUserPhoto | Boolean | M | Are you going to use User Photo for Mobile Access? |
|
isDepartment | Boolean | M | Are you going to use Department Info for Mobile Access? |
|
isTitle | Boolean | M | Are you going to use Title Info for Mobile Access? |
|
* M – Mandatory, O – Optional
[Request Body]
{ "CardCollection": { "rows": [ { "isUserPhoto": false, "isDepartment": false, "isTitle": false, "card_type": { "id": "4", "name": "CSN Mobile", "type": "4", "mode": "M" }, "start_datetime": "2022-02-09T14:40:00.00Z", "expiry_datetime": "2022-02-10T14:40:00.00Z", "display_card_id": "164438521427749", "card_id": "164438521427749" } ] } } |
[Response Body]
{ "CardCollection": { "total": "1", "rows": [ { "id": "19", "card_id": "164438521427749", "display_card_id": "164438521427749", "card_type": { "id": "4", "name": "CSN Mobile", "type": "4" }, "start_datetime": "2022-02-09T14:40:00.00Z", "expiry_datetime": "2022-02-10T14:40:00.00Z" } ] }, "Response": { "code": "0", "link": "https://support.supremainc.com/en/support/home", "message": "Success" } } |
- Step 3. Create(Register) a Mobile Access
[POST]: /api/v2/mobile
[Parameters]
Name | Type | *M/O | Explanation | Value |
Mobile.user_id | String | M | User ID of the User who will use this Mobile Access |
|
Mobile.name | String | M | User Name of the User |
|
Mobile.title | String | O | Title of the User | Null |
Mobile.department | String | O | Department of the User | Null |
Mobile.phone | String | O | Phone Information of the User | Null |
Mobile.email | String | O | Email information of the User | “abc@suprema.co.kr” |
Mobile.portraitData | String | O | Profile Photo of the User | Null |
Mobile.card_id | String | M | Card ID of the Mobile Access | Ex) “164438234751549” |
Mobile.startDate | Int | M | Start Date of the Mobile Access | 1644382320000 |
Mobile.endDate | Int | M | End Date of the Mobile Access | 1644468720000 |
* M – Mandatory, O – Optional
[Request Body]
{ "MobileCollection": { "mobile": { "user_id": [ "1" ], "name": [ "Javier Montoya Ortega" ], "title": [ null ], "department": [ null ], "phone": [ null ], "email": [ "stars9408@naver.com" ], "portraitData": [ null ], "card_id": [ "1644382347515492" ], "startDate": [ 1644382320000 ], "endDate": [ 1644468720000 ] } } } |
[Response Body]
{ "MobileCollection": { "listMobile": [ { "apisnddt": "2022-02-09T05:51:21.313Z", "userid": "1", "crdid": "164438234751549", "passcode": "", "portalrslt": "" } ] }, "Response": { "code": "0" } } |
- Step 4. Register mobile Card to your User
[POST]: /api/users/{user_id}
[Parameters] : Basic [POST] /api/User/{User_Id} parameters.
* M – Mandatory, O – Optional
[Request Body]
{ "User": { "cards": [
{ "id": "19", "card_id": "164438234751549", "display_card_id": "164438234751549", "status": "1", "is_blocked": "false", "is_assigned": "true", "card_type": { "id": "4", "name": "CSN Mobile", "type": "4" }, "mobile_card": "false", "issue_count": "2", "card_slot": "1", "card_mask": "0", "wiegand_format_id": { "id": "0" }, "start_datetime": "2022-02-09T13:52:00.00Z", "expiry_datetime": "2022-02-10T13:52:00.00Z" } ] } } |
[Response Body]
{ "Response": { "code": "0", "link": "https://support.supremainc.com/en/support/home", "message": "Success" } } |