TS props script, notes

This commit is contained in:
Norm Rasmussen
2023-01-05 17:15:12 -05:00
parent 3bf4d6a151
commit 26610f8ae0
12 changed files with 368 additions and 116 deletions

View File

@ -3,8 +3,9 @@ import requests
baseUrl = "https://api.northpass.com/v2/people/"
baseUrlname = "https://api.northpass.com/v2/people?filter[name][eq]="
baseUrlemail = "https://api.northpass.com/v2/people?filter[email][eq]="
apiKey = "JRDpCGQ7vSRiva6t5OkWDr5eJ" #G2
#apiKey = "6hUfJdAartHTHhHc0WIRZYPWe" #Walmart
apiKey = "JRDpCGQ7vSRiva6t5OkWDr5eJ" # G2
# apiKey = "6hUfJdAartHTHhHc0WIRZYPWe" #Walmart
def getfromName(baseUrlname, apiKey):
name = "Someone else"
@ -20,13 +21,14 @@ def getfromName(baseUrlname, apiKey):
else:
print("Another error! " + response.status_code)
response = response.json()
#print(response)
#uuid = response["data"][0]["id"]
#print("Learner ID:" )
#print(uuid)
# print(response)
# uuid = response["data"][0]["id"]
# print("Learner ID:" )
# print(uuid)
def getfromEmail(baseUrlemail, apiKey):
#email = "norm2test@northpass.com" # The %2B encodes the + sign in the URL. Using the + sign won't work.
# email = "norm2test@northpass.com" # The %2B encodes the + sign in the URL. Using the + sign won't work.
email = " "
url = baseUrlemail + f"{email}"
print(url)
@ -42,10 +44,11 @@ def getfromEmail(baseUrlemail, apiKey):
else:
print("Another Error!")
response = response.json()
#print(response)
# print(response)
uuid = response["data"]
#print("Learner ID:" )
#print(uuid)
# print("Learner ID:" )
# print(uuid)
def getfromUuid(baseUrl, apiKey):
uuid = "57b2b5eb-aa56-4cee-bb32-8c678a2de1b7"
@ -54,12 +57,13 @@ def getfromUuid(baseUrl, apiKey):
"accept": "*/*",
"x-api-key": apiKey,
"content-type": "application/json",
}
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.text)
if __name__ == "__main__":
getfromUuid(baseUrl, apiKey)
#getfromEmail(baseUrlemail, apiKey)
#getfromName(baseUrlname, apiKey)
# getfromEmail(baseUrlemail, apiKey)
# getfromName(baseUrlname, apiKey)