From BioStar 2 v2.8.8, BioStar 2 supports FaceStation F2 and Visual Face as a user credential. 


Since BioStar 2 New Local API Swagger does not implement for Visual Face Enrollment, we share the temporary descriptions and a patch file as follows.


With respect to the APIs used for Visual Face Enrollment Link, you can check it in Swagger with the patch file at the last part of this article.


The APIs that cannot be added to the current Swagger patch are:
1. GET /api/devices/{device_id}/credentials/face?pose_sensitivity=0
2. PUT /api/users/{user_id}
3. PUT /api/users/check/upload_picture



  • Getting Visual Face on the FaceStation F2

- API: GET /api/devices/{device_id}/credentials/face?pose_sensitivity=0 

- An example of the response

"credentials": {
"faces": [
{
"template_ex_normalized_image": "Base64 : /9j/4AAQSkZJRgABAQEASABIAAD...",
"templates": [
{"template_ex": "Base64 : AAAAAAEA1AC2AcwADgFiAQMHX...", "credential_bin_type": "5"},
{"template_ex_ir": "Base64 : AAAAAAEAGAG2AcYA9AAAAAAAX...", "credential_bin_type": "6"}
],
"flag":"1",
"useProfile":"false"
}
]
},


  • Adding Visual Face through updating user information

- API: PUT /api/users/{user_id}

- Use "visualFaces" parameter and you can use the value of the "faces" from response of '/api/devices/{device_id}/credentials/face?pose_sensitivity=0'.

- An example of the request

"credentials": {
"visualFaces": [
{
"template_ex_normalized_image": "Base64 : /9j/4AAQSkZJRgABAQEASABIAAD...",
"templates": [
{"template_ex": "Base64 : AAAAAAEA1AC2AcwADgFiAQMHX...", "credential_bin_type": "5"},
{"template_ex_ir": "Base64 : AAAAAAEAGAG2AcYA9AAAAAAAX...", "credential_bin_type": "6"}
],
"flag":"1",
"useProfile":"false"
}
]
},


  • Adding Visual Face through uploading a user image

- API: PUT /api/users/check/upload_picture 

- An example of the request

{
"template_ex_picture": "Base64 : /9j/4AAQSkZJRgABAQAAAQABAAD"
}

- An example of the response 

{
"image": "Base64 : /9j/4AAQSkZJRgABAQAAAQABAAD...",
"Response": {
"code": "0",
"link": "https:\/\/support.supremainc.com\/en\/support\/home",
"message": "Success"
}
}


  • When adding visual face through updating user information

- API: PUT /api/users/{user_id}

- Use the parameter is as "template_ex_picture" in "visualFaces". And the value is the response of "image" after executing /api/users/check/upload_picture.

- An example of the request

{
"User": {
"credentials": {
"visualFaces": [
{
"template_ex_picture": "Base64 : /9j/4AAQSkZJRgA...",
"useProfile": "false"
}
]
}
}
}



To set email setting for Visual Face Mobile Enrollment link, please download the below swagger.json. There are the relevant APIs.


swagger.json > This patch based on BioStar 2 v2.8.8.

- How to apply the patch file:
1. Stop of all BioStar 2 service.
2. Download the patch through the above the link.
3. Overwrite the downloaded patch file in the following path.
-Path: C:\Program Files\BioStar 2(x64)\nginx\html\swagger\swaggerApiFile
4. Restart all BioStar 2 services.

- Changes>
1. The version indicated updates (2.8.8)
2. POST_api/v2/send_email
3. GET_api/setting/alarm_smtps
4. GET_api/setting_email
5. PUT_api/setting/alarm_smtps/1
6. PUT_api/setting_email