Noninteractive changes added, first draft getOTPHistory
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user