Last active
November 18, 2023 03:10
-
-
Save symisc/70f54efd4011ba958f8dad33cf1c4bfc to your computer and use it in GitHub Desktop.
Change the PIN Code of a given Facial ID on a FACEIO application - Refer to: https://faceio.net/rest-api#setfacialidpincode for additional information
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
# Change the PIN Code of a given Facial ID on a FACEIO application | |
# Refer to: https://faceio.net/rest-api#setfacialidpincode for the official documentation & expected parameters | |
req = requests.post('https://api.faceio.net/setfacialidpincode',json={ | |
"fid": "FACIAL_ID", # Target Facial ID to change the PIN code for | |
"pin": "1234", # New PIN Code for this user. Must be a numeric STRING! | |
"key": "FACEIO_APP_API_KEY" # Your FACEIO Application API Key. Retrieve this key from the Application Manager on the console at: https://console.faceio.net | |
}) | |
reply = req.json() | |
if reply['status'] != 200: | |
print (reply['error']) | |
else: | |
# log the result | |
print("PIN Code successfully changed!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment