Skip to content

Instantly share code, notes, and snippets.

@symisc
Last active November 18, 2023 03:10
Show Gist options
  • Save symisc/70f54efd4011ba958f8dad33cf1c4bfc to your computer and use it in GitHub Desktop.
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
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