Nothing left to do today, getting 500 errors for the enrollment and attempt resource endpoints. Everything is set up correctly for hitting those endpoints, but not sure if the 500 is on me or on the application/engineers.

This commit is contained in:
Norm Rasmussen
2024-09-01 16:49:30 -04:00
parent 35194352f5
commit 6323f577de
5 changed files with 196 additions and 80 deletions

View File

@ -1,10 +1,10 @@
import requests
import Apikeys
from utils import apikeys
import pprint
PP = pprint.PrettyPrinter(indent=4)
APIKEY = Apikeys.SANDBOX
APIKEY = apikeys.SANDBOX
HEADERS = {"content-type": "application/json", "X-Api-Key": APIKEY}
BASEURL = "https://api.northpass.com/v2"
@ -23,18 +23,28 @@ def get(url):
return json_get
# def post(url, payload):
# try:
# post_response = requests.post(url, headers=HEADERS, json=payload)
# print(f"Executed Post Request. Status code is {post_response.status_code}")
# except TypeError as h:
# print(
# f"Error occurred. Here's the info: {h} and status code: {post_response.status_code}"
# )
# finally:
# try:
# json_post = post_response.json()
# except JSONDecodeError as e:
# print(f"Error occurred. Here's the info: {e}.")
# finally:
# # PP.pprint(json_get)
# return json_post
#
def post(url, payload):
try:
post_response = requests.post(url, headers=HEADERS, json=payload)
print(f"Executed Post Request. Status code is {get_response.status_code}")
except HTTPError as h:
print(
f"Error occurred. Here's the info: {h} and status code: {get_response.status_code}"
)
finally:
json_post = get_response.json()
# PP.pprint(json_post)
post_response = requests.post(url, headers=HEADERS, json=payload)
print(f"Executed Post Request. Status code is {post_response.status_code}")
print(post_response.text)
return post_response
def delete(url):
try: