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

Throughout this article, you’ll be guided to register Visual Face by uploading a picture using BioStar 2 New Local API.

 

There are 4 steps required to register Mobile Access to your Users:

  1. Prepare a picture that has a user’s face
  2. Detect face from the picture provided(BASE64 format) using /api/users/check/upload_picture
  3. Retrieve the face template information(BASE64 format) from STEP #2
  4. Register the face template to the user

 

 

API Call & Parameters 

 

- Step 1. Prepare a picture that has a user’s face

 

  • Supported image file formats are JPG, JPEG, and PNG.
  • Supported image file size: minimum 250 x 250, maximum 10MB.
  • From BioStar 2.8.10, the minimum size limit is removed.

 

*You must convert this image file to BASE64 format. (In this case, I used  website that converts images to BASE64 for you)

*BASE64 format looks like this: /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAMCAgMCAgMDA…”

 

 

- Step 2. Detect face from the picture provided(BASE64 format) using /api/users/check/upload_picture

 

[PUT]: /api/users/check/upload_picture

[Parameters] 

Name

Type

*M/O

Explanation

Value

Template_ex_picture

String

M

User Picture in BASE64

 

   * M – Mandatory, O – Optional

[Request Body]

{

       "template_ex_picture": "/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAMCAgMCAgMDA…"

}

 

[Response Body]

{

       "image": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQE...",

       "Response": {

           "code": "0",

           "link": "https://support.supremainc.com/en/support/home",

           "message": "Success"

    }

}

 

 

 

 

- Step 3. Retrieve the face template information(BASE64 format) from STEP #2

 

[Retrieve the below value from the ‘RESPONSE BODY’ from STEP 2]

      

 "image": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQE...",

 

 

 

 

- Step 4. Register the face template to the use

 

[PUT]: /api/users/{user_id}

[Parameters] : Basic [POST] /api/User/{User_Id} parameters.

Name

Type

*M/O

Explanation

Value

User.credentials.visualFaces.template_ex_picture

String

M

User Picture in BASE64

BASE64

User.credentials.visualFaces.useProfile

Boolean

M

Use this Visual Face for Profile Picture

True/False

   * M – Mandatory, O – Optional

[Request Body]

{

       "User": {

           "credentials": {

               "visualFaces": [

                {

                       "template_ex_picture": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQE…",

                    "useProfile": "false"

                }

               ]

           }

    }

}

 

[Response Body]

{

       "Response": {

           "code": "0",

           "link": "https://support.supremainc.com/en/support/home",

           "message": "Success"

    }

}