2023-05-04 10:18:35 -04:00
|
|
|
import requests
|
|
|
|
|
import Apikeys
|
|
|
|
|
|
|
|
|
|
apikey = Apikeys.anthology
|
|
|
|
|
|
|
|
|
|
groups_to_create = [
|
2023-06-22 17:00:36 -04:00
|
|
|
"Academic Economics",
|
|
|
|
|
"Academy Use/Navigation",
|
|
|
|
|
"Accreditation",
|
|
|
|
|
"Ally",
|
|
|
|
|
"Anthology 101",
|
|
|
|
|
"Baseline",
|
|
|
|
|
"Beacon",
|
|
|
|
|
"Course Evaluations",
|
|
|
|
|
"Evaluate",
|
|
|
|
|
"CVue",
|
|
|
|
|
"Data Strategy",
|
|
|
|
|
"Digital Assistant",
|
|
|
|
|
"Encompass",
|
|
|
|
|
"Engage",
|
|
|
|
|
"Faculty Development",
|
|
|
|
|
"Finance & HCM",
|
|
|
|
|
"Insight",
|
|
|
|
|
"Learn",
|
|
|
|
|
"Milestone",
|
|
|
|
|
"Occupation Insight",
|
|
|
|
|
"Outcomes",
|
|
|
|
|
"Payroll",
|
|
|
|
|
"Planning",
|
|
|
|
|
"Portfolio",
|
|
|
|
|
"Power BI",
|
|
|
|
|
"Professional Development",
|
|
|
|
|
"Program Review",
|
|
|
|
|
"Radius",
|
|
|
|
|
"Raise",
|
|
|
|
|
"Reach",
|
|
|
|
|
"Student",
|
|
|
|
|
"Talisma",
|
|
|
|
|
]
|
2023-05-04 10:18:35 -04:00
|
|
|
|
|
|
|
|
url = "https://api.northpass.com/v2/bulk/groups"
|
|
|
|
|
headers = {
|
2023-05-18 15:55:20 -04:00
|
|
|
"accept": "application/json",
|
|
|
|
|
"content-type": "application/json",
|
|
|
|
|
"X-Api-Key": apikey,
|
|
|
|
|
}
|
2023-05-04 10:18:35 -04:00
|
|
|
payload2 = []
|
|
|
|
|
for group in groups_to_create:
|
2023-06-22 17:00:36 -04:00
|
|
|
t1 = f"{group} - (T1)"
|
|
|
|
|
t2 = f"{group} - (T2)"
|
|
|
|
|
t3 = f"{group} - (T3)"
|
2023-05-04 10:18:35 -04:00
|
|
|
|
2023-06-22 17:00:36 -04:00
|
|
|
payload = {"data": {"attributes": {"groups":
|
|
|
|
|
[{"name": t1},
|
|
|
|
|
{"name": t2},
|
|
|
|
|
{"name": t3}]}}}
|
|
|
|
|
# print(payload)
|
|
|
|
|
response = requests.post(url, json=payload, headers=headers)
|
|
|
|
|
print(response.status_code)
|
|
|
|
|
print(response)
|