Noninteractive changes added, first draft getOTPHistory

This commit is contained in:
=
2025-09-09 13:21:08 -04:00
parent 53e60df179
commit 999d1f9d9d
3 changed files with 52 additions and 7 deletions
+21
View File
@@ -0,0 +1,21 @@
import json
import requests
import os
def getOTPHistory(url, type):
endpoint = url + '/v1/otp/usage'
payload = {
"status" : type
}
headers = {"X-APIKey": os.getenv('APIKEY')}
payload = json.dumps(payload)
response = requests.post(endpoint, headers=headers, data=payload, verify=False)
data = response.json()
results = data.get("response", {}).get("otpusage", [])
print(results)