본문 바로가기

Troubleshooting

biostar2 api 이용해 사용자 크리덴셜 비주얼 페이스 등록 후 인증하기.

 

addUser_url = "https://"+ip_address+"/api/users"

 

headers = {

            "bs-session-id": sessionID,

            "Content-Type": "application/json"        

             }

 

 

data =  {

                    "User": {

                        "user_id": self.scan_user,

                        "user_group_id": {

                            "id": "1",

                            "name": "secure"                            

                        },

                        "disabled": "false",                    

                        "start_datetime": "2001-01-01T00:00:00.00Z",

                        "expiry_datetime": "2030-12-31T23:59:00.00Z",                  

                        "access_groups": [{

                            "name": "aiden",

                            "id": 12

                        }],

                        # access_groups를 등록해야 출입 인증이 가능하다.

                        # AG은 출입문을 만들어 장치와 연동하고 출입 그룹에 등록해 줘야 한다.

                        "name": user_name,      

                        "email": car_num+"@inc.co.kr",

                        "department": company

                        "title": "",

                        "phone": phone_num,        

                        "user_ip": visit_reason,  

                        "credentials": {

                            "visualFaces": [

                                {

                                    "flag": "1",

                                    "template_ex_normalized_image": scan_img_base64,

                                    "templates": [

                                        {

                                            "credential_bin_type": self.credential_bin_type,

                                            "templateEx": self.template_ex

                                        },

                                    ],

                                    "useProfile": "false"

                                }

                            ]

                        }

                    }

            }

           

            response = requests.post(addUser_url, headers=headers, json=data, verify=False)        

 

BIOSTAR2 API 문서를 보고 대부분의 개발을 했지만 

 

Technical Support | Suprema (supremainc.com)

 

Technical Support | Suprema

How can we help you today?

support.supremainc.com

API 문서만 보고 진행이 잘 안 될 때는 위 사이트를 통해 많은 도움을 받았다. 

반응형

'Troubleshooting' 카테고리의 다른 글

CSV 파일 생성 시 인코딩.  (0) 2023.09.18
python으로 csv 파일 생성하기.  (0) 2023.09.07
Biostar2에 장치 연결 안 됨.  (0) 2023.08.28
express 모듈 설치하기.  (0) 2023.08.02
PYQT QDialog 창 닫기.  (0) 2023.08.01