Created script to get sent webhooks from our endpoint. Not many filtering options. Update some templates for Spark, and Luminate.

This commit is contained in:
Norm Rasmussen
2024-11-26 16:39:18 -05:00
parent b0abcb7022
commit 991cdde784
11 changed files with 533 additions and 437 deletions

View File

@ -12,20 +12,6 @@ HEADERS = {
}
BASEURL = "https://api.northpass.com/v2/"
GROUPS = [
"Academic Economics",
"Academy Use/Navigation",
"Accreditation",
"Anthology 101",
"Baseline",
"Course Evaluations",
"Engage",
"Evaluate",
"Finance & HCM",
"Learn",
"Portfolio",
"Power BI",
"Raise",
"Reach",
"Student",
]
@ -34,23 +20,24 @@ def all_groups():
Get all Group IDs
"""
gids = []
group_count = 0
while True:
group_count += 1
url = f"https://api.northpass.com/v2/groups?page={group_count}"
gresponse = requests.get(url, headers=HEADERS)
gdata = gresponse.json()
gnext = gdata["links"]
for group in GROUPS:
group_count = 0
while True:
group_count += 1
url = f"https://api.northpass.com/v2/groups?filter[name][cont]={group}&page={group_count}"
gresponse = requests.get(url, headers=HEADERS)
gdata = gresponse.json()
gnext = gdata["links"]
for response in gdata["data"]:
group_id = response["id"]
group_name = response["attributes"]["name"]
group_tupe = (group_id, group_name)
print(group_tupe)
gids.append(group_tupe)
for response in gdata["data"]:
group_id = response["id"]
group_name = response["attributes"]["name"]
group_tupe = (group_id, group_name)
print(group_tupe)
gids.append(group_tupe)
if "next" not in gnext:
break
if "next" not in gnext:
break
get_courses(gids)