import requests import json from Utils.HikAccessToken import hik_access_token def hik_delete_visitor(hik_accesstoken,expire_visitor): for employeeNo in expire_visitor: requests.post( url="https://api2.hik-cloud.com/api/v1/open/basic/persons/delete?access_token=%s&employeeNo=%s" %(hik_accesstoken,employeeNo) ) return # if __name__ == '__main__': # with open("../config.json") as f: # data = json.load(f) # client_id = data["client_id"] # client_secret = data["client_secret"] # groupId = data["groupId"] # expire_visitor = ['visitor202209161700221863039', 'visitor202209161658221423088'] # hik_accesstoken = hik_access_token(client_id, client_secret) # print("开始删除过期访客信息") # hik_delete_visitor(hik_accesstoken, expire_visitor) # print("删除过期访客信息成功")