Changed up some of Anthology's bulk unenroll/enroll scripts so I have a ready to go script if anything goes wrong.
This commit is contained in:
130
Scripts/API_Tests/antho-knowledgestate-fix.py
Normal file
130
Scripts/API_Tests/antho-knowledgestate-fix.py
Normal file
@ -0,0 +1,130 @@
|
||||
import pandas as pd
|
||||
import requests
|
||||
import Apikeys
|
||||
|
||||
MASTER = "~/Downloads/Anthology-Master-CSV-FirstChanges.csv"
|
||||
BASEURL = "https://api.northpass.com/v2/people"
|
||||
APIKEY = Apikeys.ANTHOLOGY
|
||||
HEADERS = {
|
||||
"accept": "*/*",
|
||||
"X-Api-Key": APIKEY,
|
||||
"content-type": "application/json",
|
||||
}
|
||||
KNOWLEDGEGROUPS = [
|
||||
'289f8d54-e487-48a0-ac43-5c51c1d0b151',
|
||||
'a71e6ca9-aaa5-45a6-9e23-3b4c2a707c3d',
|
||||
'b69916db-59e3-4b06-a5f1-d358338ed7d7',
|
||||
'3875a210-f86d-4b4a-a86a-980022374936',
|
||||
'c482c095-4d67-4673-a175-ab27a5bd959b',
|
||||
'4992b00e-0453-4060-9451-fa963f56150e',
|
||||
'3f8dc68e-1458-4199-9641-6781960e085e',
|
||||
'8585fe89-a050-4dbb-beb8-6ebd7358a970',
|
||||
'd2542667-0dbf-4680-a5af-042d70f24a55',
|
||||
'7395831e-4325-4b16-85bb-36c94f68aec0',
|
||||
'180571e8-f943-4980-8997-b3eed2a0c141',
|
||||
'2b69f2f8-d567-48c3-8bb3-22e0dc8819bd',
|
||||
'2b5267b2-ce87-4e77-ad88-5cfec80496b9',
|
||||
'483c3416-ddfb-43fe-983b-08abb6b50c62',
|
||||
'df9855d7-12ae-4170-acf6-a05cd4f52515',
|
||||
'1582d056-55fb-403b-8a65-f3b641c96b69',
|
||||
'be95bdcc-e72a-4132-8a67-9dde9bad5e2a',
|
||||
'299dd454-076d-4580-8cb9-4301997e86cd',
|
||||
'0a3412da-5f73-4738-8364-15d5919750f3',
|
||||
'197da27d-0497-40b5-b2f8-cec4124d32f6',
|
||||
'a031d9a8-e433-45cf-826a-8881644f8eac',
|
||||
'02702bf3-261c-41e0-a22d-26d3e90493a3',
|
||||
'a013fa2c-5b84-49d3-a3b4-fb80a768f37c',
|
||||
'c5ea5c83-9535-4d52-a2d0-12c101e3aee9',
|
||||
'672a0dd4-a5a0-43c1-bd40-f66cdb241ec7',
|
||||
'3b149bfe-31c5-4991-bd6c-ba4c760089d4',
|
||||
'b6ae5e37-db6a-4b79-949f-be73b216f677',
|
||||
'2f787b42-e43a-4cea-9c12-19a647e21eeb',
|
||||
'bfb708e4-18eb-47b5-afde-737f16721e9a',
|
||||
'f02032d3-3d60-4cb1-acac-855c229646c3',
|
||||
'96b24666-85f2-4f70-ae59-f5a924cc045f',
|
||||
'f7701275-cebc-482b-ac31-9cfcd93937c3',
|
||||
'fcfe4ee2-b247-4244-8cfc-f3d98d219fea',
|
||||
'c6b6d415-323e-46c1-859e-be86fd36ec48',
|
||||
'e53216bf-9815-42c7-89c1-953a7b1289a3',
|
||||
'5eeef2ff-1616-43bb-a0c1-aa84ad551824',
|
||||
'c78fffea-32b8-477e-81e9-7133119d9207',
|
||||
'59ccfdeb-8a8a-4693-b4fa-27034192071c',
|
||||
'849f1551-604a-4b5c-9b5d-e2771eed488c',
|
||||
'cf5d1920-9618-43f3-8dac-53954d19a956',
|
||||
'4d0bf08e-3dda-4a2e-8213-72a020873a03',
|
||||
'e48c8995-6a64-45c1-ae62-ba96fcc01542',
|
||||
'0ef5fdd2-718c-47d2-88bc-2d0193b18530',
|
||||
'8302b674-c728-42d2-9ba3-908b4d970436',
|
||||
'ab461de6-1137-4548-87bf-f9dd78905417',
|
||||
'0b26d479-d9a7-4e07-aa2f-4893467f41c2',
|
||||
'604dd8b8-175a-4a74-93d2-28760f1d1835',
|
||||
'26c5277c-440a-4dea-b625-beb986cff673',
|
||||
'8e33adf0-5932-4535-90c7-10fa04e97201',
|
||||
'1ef34494-4d48-4b69-9819-a22c5870fc24',
|
||||
'b2b8d7aa-06e8-4ed5-bc9b-cb9ce0e81309',
|
||||
'e4017ee0-6141-4145-816f-ed68ee6931bc',
|
||||
'84d32175-8cb8-4fb0-95cc-6ae13d40aaaa',
|
||||
'27489e34-b04c-410e-99a2-0d93e2e42fbf',
|
||||
'65cff7cb-0a29-4c0c-9280-76af55d1432d',
|
||||
'e5e8565f-80e2-4462-b687-56f6d64f95e4',
|
||||
'27accc37-c3fd-465f-99cd-3e131081aeca',
|
||||
'32e112bd-5495-4399-85dd-1925e1ccbba5',
|
||||
'dc50ca43-5071-45b3-bf42-e1e64416ffd0',
|
||||
'950a6345-5a13-4931-8d82-eac6adef03e3',
|
||||
'700640e7-0de3-49dc-b441-4efff8ad33ba',
|
||||
'5f35e542-a8cf-4422-8e87-466cdca62864',
|
||||
'f50cb362-2f86-44eb-89e6-bea6ecbaf89f',
|
||||
'31a7cbe0-6aa6-403b-a561-6bc4fa81c0b1',
|
||||
'd694804c-ae1a-4db0-b5fc-2497e43abb6f',
|
||||
'a008a4e6-e026-4a1c-8aef-eea78c41b029',
|
||||
'4575114c-1e63-41b1-8953-67d3ce3ed3e6',
|
||||
'853de4bd-6f6a-4d1d-980a-b67eb1b0e876',
|
||||
'cd0fa4e0-2d24-4b35-918a-33baa736015e',
|
||||
'933baf03-3664-4c33-bd97-208a9f7ab78b',
|
||||
'55bae3db-5f62-4be3-823a-bcb429b8a2b2',
|
||||
'4754b85b-e7a6-41a8-b0e9-5e02c58ebc38',
|
||||
'33f4fc73-102d-492e-9b0a-383d0b0f68b0',
|
||||
'fa8914be-0986-460c-884d-9973a9622045',
|
||||
'b9f734fa-de0d-4a0b-9ce2-c092126e1d8d',
|
||||
'448f3335-cf11-4e7a-9939-c734861d16e3',
|
||||
'106775db-a00d-4956-bf27-97ea269bb001',
|
||||
'594cd6c0-17db-4241-be56-ad28a8db4f7b',
|
||||
'95f7b67d-3ba8-4d18-bcbb-3e02f7bfaf7a',
|
||||
]
|
||||
|
||||
for row in df.itertuples():
|
||||
domain = row[1]
|
||||
groups = row[2:]
|
||||
# groups = list(groups)
|
||||
tmplist = []
|
||||
for group in groups:
|
||||
group = str(group)
|
||||
if "nan" not in group:
|
||||
# Grab Group UUIDs
|
||||
url = f"https://api.northpass.com/v2/groups?filter[name][eq]={group}"
|
||||
response = requests.get(url, headers=HEADERS)
|
||||
response = response.json()
|
||||
data = response["data"]
|
||||
for name in data:
|
||||
id = name["id"]
|
||||
tmplist.append(id)
|
||||
rowdict = {domain: tmplist}
|
||||
|
||||
# Grab all people
|
||||
personlist = []
|
||||
COUNT += 1
|
||||
url = BASEURL + f"?filter[email][cont]={domain}&limit=100"
|
||||
response = requests.get(url, headers=HEADERS)
|
||||
response = response.json()
|
||||
nextlink = response["links"]
|
||||
|
||||
for data in response["data"]:
|
||||
person = data["id"]
|
||||
personlist.append(person)
|
||||
|
||||
# if "next" not in nextlink:
|
||||
# break
|
||||
|
||||
# Construct Payload for Bulk API
|
||||
payload = {"payload": {"person_ids": personlist, "group_ids": tmplist}}
|
||||
print(payload)
|
||||
@ -0,0 +1,275 @@
|
||||
import requests
|
||||
import csv
|
||||
import pandas as pd
|
||||
import time
|
||||
import Apikeys
|
||||
from termcolor import colored, cprint
|
||||
|
||||
|
||||
KNOWLEDGEGROUPS = [
|
||||
'289f8d54-e487-48a0-ac43-5c51c1d0b151',
|
||||
'a71e6ca9-aaa5-45a6-9e23-3b4c2a707c3d',
|
||||
'b69916db-59e3-4b06-a5f1-d358338ed7d7',
|
||||
'3875a210-f86d-4b4a-a86a-980022374936',
|
||||
'c482c095-4d67-4673-a175-ab27a5bd959b',
|
||||
'4992b00e-0453-4060-9451-fa963f56150e',
|
||||
'3f8dc68e-1458-4199-9641-6781960e085e',
|
||||
'8585fe89-a050-4dbb-beb8-6ebd7358a970',
|
||||
'd2542667-0dbf-4680-a5af-042d70f24a55',
|
||||
'7395831e-4325-4b16-85bb-36c94f68aec0',
|
||||
'180571e8-f943-4980-8997-b3eed2a0c141',
|
||||
'2b69f2f8-d567-48c3-8bb3-22e0dc8819bd',
|
||||
'2b5267b2-ce87-4e77-ad88-5cfec80496b9',
|
||||
'483c3416-ddfb-43fe-983b-08abb6b50c62',
|
||||
'df9855d7-12ae-4170-acf6-a05cd4f52515',
|
||||
'1582d056-55fb-403b-8a65-f3b641c96b69',
|
||||
'be95bdcc-e72a-4132-8a67-9dde9bad5e2a',
|
||||
'299dd454-076d-4580-8cb9-4301997e86cd',
|
||||
'0a3412da-5f73-4738-8364-15d5919750f3',
|
||||
'197da27d-0497-40b5-b2f8-cec4124d32f6',
|
||||
'a031d9a8-e433-45cf-826a-8881644f8eac',
|
||||
'02702bf3-261c-41e0-a22d-26d3e90493a3',
|
||||
'a013fa2c-5b84-49d3-a3b4-fb80a768f37c',
|
||||
'c5ea5c83-9535-4d52-a2d0-12c101e3aee9',
|
||||
'672a0dd4-a5a0-43c1-bd40-f66cdb241ec7',
|
||||
'3b149bfe-31c5-4991-bd6c-ba4c760089d4',
|
||||
'b6ae5e37-db6a-4b79-949f-be73b216f677',
|
||||
'2f787b42-e43a-4cea-9c12-19a647e21eeb',
|
||||
'bfb708e4-18eb-47b5-afde-737f16721e9a',
|
||||
'f02032d3-3d60-4cb1-acac-855c229646c3',
|
||||
'96b24666-85f2-4f70-ae59-f5a924cc045f',
|
||||
'f7701275-cebc-482b-ac31-9cfcd93937c3',
|
||||
'fcfe4ee2-b247-4244-8cfc-f3d98d219fea',
|
||||
'c6b6d415-323e-46c1-859e-be86fd36ec48',
|
||||
'e53216bf-9815-42c7-89c1-953a7b1289a3',
|
||||
'5eeef2ff-1616-43bb-a0c1-aa84ad551824',
|
||||
'c78fffea-32b8-477e-81e9-7133119d9207',
|
||||
'59ccfdeb-8a8a-4693-b4fa-27034192071c',
|
||||
'849f1551-604a-4b5c-9b5d-e2771eed488c',
|
||||
'cf5d1920-9618-43f3-8dac-53954d19a956',
|
||||
'4d0bf08e-3dda-4a2e-8213-72a020873a03',
|
||||
'e48c8995-6a64-45c1-ae62-ba96fcc01542',
|
||||
'0ef5fdd2-718c-47d2-88bc-2d0193b18530',
|
||||
'8302b674-c728-42d2-9ba3-908b4d970436',
|
||||
'ab461de6-1137-4548-87bf-f9dd78905417',
|
||||
'0b26d479-d9a7-4e07-aa2f-4893467f41c2',
|
||||
'604dd8b8-175a-4a74-93d2-28760f1d1835',
|
||||
'26c5277c-440a-4dea-b625-beb986cff673',
|
||||
'8e33adf0-5932-4535-90c7-10fa04e97201',
|
||||
'1ef34494-4d48-4b69-9819-a22c5870fc24',
|
||||
'b2b8d7aa-06e8-4ed5-bc9b-cb9ce0e81309',
|
||||
'e4017ee0-6141-4145-816f-ed68ee6931bc',
|
||||
'84d32175-8cb8-4fb0-95cc-6ae13d40aaaa',
|
||||
'27489e34-b04c-410e-99a2-0d93e2e42fbf',
|
||||
'65cff7cb-0a29-4c0c-9280-76af55d1432d',
|
||||
'e5e8565f-80e2-4462-b687-56f6d64f95e4',
|
||||
'27accc37-c3fd-465f-99cd-3e131081aeca',
|
||||
'32e112bd-5495-4399-85dd-1925e1ccbba5',
|
||||
'dc50ca43-5071-45b3-bf42-e1e64416ffd0',
|
||||
'950a6345-5a13-4931-8d82-eac6adef03e3',
|
||||
'700640e7-0de3-49dc-b441-4efff8ad33ba',
|
||||
'5f35e542-a8cf-4422-8e87-466cdca62864',
|
||||
'f50cb362-2f86-44eb-89e6-bea6ecbaf89f',
|
||||
'31a7cbe0-6aa6-403b-a561-6bc4fa81c0b1',
|
||||
'd694804c-ae1a-4db0-b5fc-2497e43abb6f',
|
||||
'a008a4e6-e026-4a1c-8aef-eea78c41b029',
|
||||
'4575114c-1e63-41b1-8953-67d3ce3ed3e6',
|
||||
'853de4bd-6f6a-4d1d-980a-b67eb1b0e876',
|
||||
'cd0fa4e0-2d24-4b35-918a-33baa736015e',
|
||||
'933baf03-3664-4c33-bd97-208a9f7ab78b',
|
||||
'55bae3db-5f62-4be3-823a-bcb429b8a2b2',
|
||||
'4754b85b-e7a6-41a8-b0e9-5e02c58ebc38',
|
||||
'33f4fc73-102d-492e-9b0a-383d0b0f68b0',
|
||||
'fa8914be-0986-460c-884d-9973a9622045',
|
||||
'b9f734fa-de0d-4a0b-9ce2-c092126e1d8d',
|
||||
'448f3335-cf11-4e7a-9939-c734861d16e3',
|
||||
'106775db-a00d-4956-bf27-97ea269bb001',
|
||||
'594cd6c0-17db-4241-be56-ad28a8db4f7b',
|
||||
'95f7b67d-3ba8-4d18-bcbb-3e02f7bfaf7a',
|
||||
]
|
||||
|
||||
PERSON_IDS = [
|
||||
"f44363ca-eff8-4cc9-b67f-d49fcbd1f20d",
|
||||
"07fd80f8-3fe8-4386-84dc-280dade1ed5f",
|
||||
"8bffdf96-3947-4f14-8041-c25e4a488b80",
|
||||
"a68a6120-067e-477d-89d5-d1da1a96d09f",
|
||||
"03c65c74-2cb8-4c65-a712-6f0f48939d8b",
|
||||
"56919b58-7be1-4c1b-912f-54887303eefb",
|
||||
"b7e51667-d26f-4851-8878-d54bb4ce8a51",
|
||||
"45fb5c92-2c3d-4c49-9f3e-949ab66b06e5",
|
||||
"ea3706d8-c312-4830-8c18-0b7dcc0285d8",
|
||||
"10edf9db-3bec-4beb-9047-44da8e3047ab",
|
||||
"3c976bca-3f07-438b-9b8c-953782236666",
|
||||
"b36d7d59-fc3c-480a-8d6a-9025e6ee4cbb",
|
||||
"5718e19a-82d4-4855-af92-45c5cf8e670f",
|
||||
"a3cdfd66-76dc-4e11-89ca-8a7fa32d2a47",
|
||||
"123ef7cc-9a29-4a70-9e2c-86567ca02ab8",
|
||||
"55498b66-5616-4f7c-a29c-9506e3d537cf",
|
||||
"781d706e-3a9f-44dd-acca-2d0570b41544",
|
||||
"58028ff3-4fb3-453b-8cc3-14c831977da4",
|
||||
"56d52d1f-7eee-4f32-ac89-7bbf6c668cdd",
|
||||
"baf1c792-3a87-4357-a93b-871eaabc0ab0",
|
||||
"00969b3e-de91-4133-aa05-421a75651508",
|
||||
"87c4fed6-166e-447a-b542-fb0403188fba",
|
||||
"c84a13e9-950f-4109-a7e4-a2412fb6889b",
|
||||
"fd6bc3ff-5416-418f-928c-4d1a5e96c651",
|
||||
"43a20d23-69bd-4307-ad60-d2832ab81b39",
|
||||
"1d579f1e-cae7-4866-9669-19074dfe8793",
|
||||
"7723fe1b-bd33-4b89-84fc-7218303e2bad",
|
||||
"3a8a77c0-eb96-4148-bdb8-6854c4b55129",
|
||||
"f8410b69-f5e7-4fbe-b89c-a405173570ac",
|
||||
"82adc395-7141-4de2-9b5f-a9c128bdd00f",
|
||||
"8522f536-b77a-4c4b-8025-d6a10410f20a",
|
||||
"eb857569-7fde-47f0-b404-db1a3ace1a19",
|
||||
"daf7691c-5391-4f79-9da6-3ec383f955f0",
|
||||
"242df255-14d0-41b8-ad57-afa4e788bdcf",
|
||||
"1d8ffc86-80f5-4d42-8d3f-c705ee2e1482",
|
||||
"23da9e58-b7fc-40cc-bacb-5ec98b9da3df",
|
||||
"f4da7725-9c24-4d63-ba9b-fd1962f1fd4e",
|
||||
"e6954ff8-2fcb-4044-bc8f-423de5b0911d",
|
||||
"f7ec7cf5-bf70-4af6-b4bb-09891362df3f",
|
||||
"d0648191-211e-4800-8526-91b2e8019b49",
|
||||
"e4c08d0e-df51-432a-bc6a-648e0cfcb31f",
|
||||
"415515be-c141-4002-83b1-6a6466507278",
|
||||
"998508ee-fc6e-4770-a7b7-19b34eab3f0b",
|
||||
"d790b773-2ceb-4cc7-8011-05d1f3a83b1f",
|
||||
"33921abd-474a-469b-a114-a8f5bfec8a1a",
|
||||
"4b7f75e4-d708-45d6-82e8-17e6ab98ba69",
|
||||
"07f30e75-5a77-4b29-897b-caf9833b526b",
|
||||
"303fccc3-cf87-4890-987a-4c246514a4cb",
|
||||
"e0c85f8e-e03d-43b0-94dc-1aaf573a09b0",
|
||||
"2197fdea-28c7-40f2-80d3-067617511c7f",
|
||||
"cd844391-f786-4ea1-bccb-80b1b3a88eba",
|
||||
"9206f9d4-6a43-4418-bfa4-fdc2e80cb601",
|
||||
"222f8edc-cdca-4638-b93b-57b62cca9bc9",
|
||||
"2ee1c1d9-d332-49c0-b186-50dbdffcc5da",
|
||||
"a30b533d-c1b6-44ce-a67f-31a1f20a2bf6",
|
||||
"603be042-5434-4482-a1a5-ba3f4f351b0b",
|
||||
"53a70521-9bab-4177-9ec7-21d38ec52da3",
|
||||
"8aa5d835-2a94-437e-9482-8cefbc7f73c5",
|
||||
"5f8c5f02-722c-46a6-b6cd-7fc991ba91fe",
|
||||
"9a69f913-d065-4bd1-8c8f-306b99253077",
|
||||
"6eeacf18-15c7-46c4-98c9-e4cc38d4d927",
|
||||
"f8e2668e-da42-426d-bfd7-7302958acaa8",
|
||||
"575ba093-7bf8-4702-a46d-27a3783310ea",
|
||||
"f6f2f233-24db-4541-ab55-813c547b3132",
|
||||
"05e5d881-3896-4ba1-9a78-7eac2518d89c",
|
||||
"3d73474f-5b7e-443a-9a9e-be33333d4a82",
|
||||
"c2bae366-64c9-4bd0-a7d1-251971b65c61",
|
||||
"32db9bd3-30aa-4b7f-add3-27adc42db1be",
|
||||
"01514376-77b2-4432-8ee4-6f303969318d",
|
||||
"3f3e16ac-28da-4d5d-803a-97f3bc4cda8f",
|
||||
"d56bbe1d-2d58-4fea-a84e-3eab4d30f665",
|
||||
"044fb66b-2232-415d-bc47-1c309419ff4a",
|
||||
"f528c291-d2e6-4fd3-9253-24fd9a2a04b3",
|
||||
"117f2aaf-30bb-4b92-b9b2-42a8ae0d72e9",
|
||||
"d334a708-4512-4550-ac1e-0d0b1d4020b9",
|
||||
"ee18a795-4c0e-4e3a-accf-9018035a0195",
|
||||
"5acff021-3b6e-4313-a07c-6a000791a093",
|
||||
"71ce9d84-ebd2-4a4c-a074-78ec9070fd22",
|
||||
"38a5c677-4443-4d84-8e2d-3cdae3aa0648",
|
||||
"cff1bfd8-ebbf-4f63-9b9b-95ffea97fbbc",
|
||||
"cfedb93c-e5f9-48d8-9759-bbfed6b80c36",
|
||||
"c2a40abd-ccc2-47af-86a0-2fdd616e5612",
|
||||
"5b12d62b-47f1-461b-88c7-022f50430e77",
|
||||
"a83219ba-1124-4dae-a0f1-73ec6e06bf0a",
|
||||
"9367ee67-05e5-4663-a394-2cd3e91655e3",
|
||||
"0633bb08-c971-4fd2-9849-99b20ae1a25c",
|
||||
]
|
||||
|
||||
APIKEY = Apikeys.ANTHOLOGY
|
||||
BASEURL = "https://api.northpass.com/v2/"
|
||||
HEADERS = {"accept": "application/json", "X-Api-Key": APIKEY}
|
||||
GROUPS = []
|
||||
BASEFILE = "/Users/normrasmussen/Downloads/Anthology_master_backup.csv"
|
||||
|
||||
|
||||
def grab_person_group_ids():
|
||||
rowdict = {"knowledgestate.edu": KNOWLEDGEGROUPS}
|
||||
grab_ppl_ids(rowdict)
|
||||
|
||||
|
||||
def grab_ppl_ids(rowdict):
|
||||
cprint(f"The dictionary is grabbing all the people. Here's the dict: {rowdict}", 'green')
|
||||
page_count = 0
|
||||
for domain, group_list in rowdict.items():
|
||||
# Grab all people
|
||||
person_list = []
|
||||
page_count += 1
|
||||
url = (
|
||||
BASEURL
|
||||
+ f"people/?filter[email][cont]=@knowledgestate.edu&limit=100&page={page_count}"
|
||||
)
|
||||
response = requests.get(url, headers=HEADERS)
|
||||
response = response.json()
|
||||
nextlink = response["links"]
|
||||
|
||||
for data in response["data"]:
|
||||
person = data["id"]
|
||||
person_list.append(person)
|
||||
|
||||
if "next" not in nextlink:
|
||||
break
|
||||
|
||||
if len(person_list) > 0:
|
||||
cprint(f"Person list for knowledgestate.edu has {len(person_list)} people.", 'blue')
|
||||
bulk_remove_and_enroll(person_list, group_list)
|
||||
else:
|
||||
cprint(f"Person list for knowledgestate.edu has {len(person_list)} people.", 'blue')
|
||||
cprint(f"Skipping the bulk function.", 'yellow')
|
||||
|
||||
|
||||
def bulk_remove_and_enroll(person_list, group_list):
|
||||
cprint("Moving people and groups into bulk function.", 'green')
|
||||
COUNT = 0
|
||||
FINISH_SIGNAL = len(person_list)
|
||||
# Get people with groups and remove them from those groups
|
||||
for person in person_list:
|
||||
COUNT += 1
|
||||
url = BASEURL + f"people/{person}"
|
||||
response = requests.get(url, headers=HEADERS)
|
||||
data = response.json()
|
||||
groups = data["data"]["relationships"]["groups"]
|
||||
name = data["data"]["attributes"]["full_name"]
|
||||
del_group_list = []
|
||||
for group in groups["data"]:
|
||||
del_payload_var = {"id": group["id"], "type": "membership-groups"}
|
||||
del_group_list.append(del_payload_var)
|
||||
del_payload_base = {"data": del_group_list}
|
||||
if not del_payload_base["data"]:
|
||||
pass
|
||||
else:
|
||||
url = BASEURL + f"people/{person}/relationships/groups"
|
||||
response = requests.delete(url, headers=HEADERS, json=del_payload_base)
|
||||
good_status_codes = [202, 204, 200, 203]
|
||||
if response.status_code in good_status_codes:
|
||||
pass
|
||||
else:
|
||||
cprint(f"Error: {response.status_code} with {name}", 'red')
|
||||
|
||||
if COUNT == FINISH_SIGNAL:
|
||||
# Since we're de-enrolling one by one, let's sleep and wait.
|
||||
|
||||
cprint("Sleeping for 2 seconds.", 'yellow')
|
||||
time.sleep(2)
|
||||
cprint("Sleep Complete. Hold on to your butts!", 'yellow')
|
||||
|
||||
# Re-enroll everyone back into all the groups
|
||||
payload = {"payload": {"person_ids": person_list, "group_ids": group_list}}
|
||||
url = BASEURL + "bulk/people/membership/"
|
||||
try:
|
||||
response = requests.post(url, headers=HEADERS, json=payload)
|
||||
response.raise_for_status()
|
||||
except requests.exceptions.HTTPError as err:
|
||||
cprint(f"Error: {response.status_code}. Exception: {err}", 'red')
|
||||
except requests.exceptions.Timeout:
|
||||
cprint("Timeout Error", 'red')
|
||||
except requests.exceptions.TooManyRedirects:
|
||||
cprint("Too Many Redirects Error", 'red')
|
||||
finally:
|
||||
cprint(response.status_code, 'yellow')
|
||||
cprint("Okay, let's see how that went.", 'red')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
grab_person_group_ids()
|
||||
@ -7,60 +7,85 @@ from termcolor import colored
|
||||
|
||||
|
||||
KNOWLEDGEGROUPS = [
|
||||
"289f8d54-e487-48a0-ac43-5c51c1d0b151",
|
||||
"a71e6ca9-aaa5-45a6-9e23-3b4c2a707c3d",
|
||||
"3875a210-f86d-4b4a-a86a-980022374936",
|
||||
"c482c095-4d67-4673-a175-ab27a5bd959b",
|
||||
"3f8dc68e-1458-4199-9641-6781960e085e",
|
||||
"8585fe89-a050-4dbb-beb8-6ebd7358a970",
|
||||
"7395831e-4325-4b16-85bb-36c94f68aec0",
|
||||
"180571e8-f943-4980-8997-b3eed2a0c141",
|
||||
"2b5267b2-ce87-4e77-ad88-5cfec80496b9",
|
||||
"483c3416-ddfb-43fe-983b-08abb6b50c62",
|
||||
"df9855d7-12ae-4170-acf6-a05cd4f52515",
|
||||
"be95bdcc-e72a-4132-8a67-9dde9bad5e2a",
|
||||
"299dd454-076d-4580-8cb9-4301997e86cd",
|
||||
"197da27d-0497-40b5-b2f8-cec4124d32f6",
|
||||
"a031d9a8-e433-45cf-826a-8881644f8eac",
|
||||
"a013fa2c-5b84-49d3-a3b4-fb80a768f37c",
|
||||
"c5ea5c83-9535-4d52-a2d0-12c101e3aee9",
|
||||
"3b149bfe-31c5-4991-bd6c-ba4c760089d4",
|
||||
"b6ae5e37-db6a-4b79-949f-be73b216f677",
|
||||
"bfb708e4-18eb-47b5-afde-737f16721e9a",
|
||||
"f02032d3-3d60-4cb1-acac-855c229646c3",
|
||||
"f7701275-cebc-482b-ac31-9cfcd93937c3",
|
||||
"fcfe4ee2-b247-4244-8cfc-f3d98d219fea",
|
||||
"e53216bf-9815-42c7-89c1-953a7b1289a3",
|
||||
"5eeef2ff-1616-43bb-a0c1-aa84ad551824",
|
||||
"59ccfdeb-8a8a-4693-b4fa-27034192071c",
|
||||
"849f1551-604a-4b5c-9b5d-e2771eed488c",
|
||||
"0a5c0100-9500-46a5-a7be-40d03fc5dfe9",
|
||||
"4d0bf08e-3dda-4a2e-8213-72a020873a03",
|
||||
"e48c8995-6a64-45c1-ae62-ba96fcc01542",
|
||||
"8302b674-c728-42d2-9ba3-908b4d970436",
|
||||
"ab461de6-1137-4548-87bf-f9dd78905417",
|
||||
"604dd8b8-175a-4a74-93d2-28760f1d1835",
|
||||
"26c5277c-440a-4dea-b625-beb986cff673",
|
||||
"1ef34494-4d48-4b69-9819-a22c5870fc24",
|
||||
"b2b8d7aa-06e8-4ed5-bc9b-cb9ce0e81309",
|
||||
"84d32175-8cb8-4fb0-95cc-6ae13d40aaaa",
|
||||
"27489e34-b04c-410e-99a2-0d93e2e42fbf",
|
||||
"e5e8565f-80e2-4462-b687-56f6d64f95e4",
|
||||
"27accc37-c3fd-465f-99cd-3e131081aeca",
|
||||
"dc50ca43-5071-45b3-bf42-e1e64416ffd0",
|
||||
"950a6345-5a13-4931-8d82-eac6adef03e3",
|
||||
"5f35e542-a8cf-4422-8e87-466cdca62864",
|
||||
"f50cb362-2f86-44eb-89e6-bea6ecbaf89f",
|
||||
"d694804c-ae1a-4db0-b5fc-2497e43abb6f",
|
||||
"a008a4e6-e026-4a1c-8aef-eea78c41b029",
|
||||
"853de4bd-6f6a-4d1d-980a-b67eb1b0e876",
|
||||
"cd0fa4e0-2d24-4b35-918a-33baa736015e",
|
||||
"55bae3db-5f62-4be3-823a-bcb429b8a2b2",
|
||||
"4754b85b-e7a6-41a8-b0e9-5e02c58ebc38",
|
||||
"fa8914be-0986-460c-884d-9973a9622045",
|
||||
"b9f734fa-de0d-4a0b-9ce2-c092126e1d8d",
|
||||
"106775db-a00d-4956-bf27-97ea269bb001",
|
||||
"594cd6c0-17db-4241-be56-ad28a8db4f7b",
|
||||
'289f8d54-e487-48a0-ac43-5c51c1d0b151',
|
||||
'a71e6ca9-aaa5-45a6-9e23-3b4c2a707c3d',
|
||||
'b69916db-59e3-4b06-a5f1-d358338ed7d7',
|
||||
'3875a210-f86d-4b4a-a86a-980022374936',
|
||||
'c482c095-4d67-4673-a175-ab27a5bd959b',
|
||||
'4992b00e-0453-4060-9451-fa963f56150e',
|
||||
'3f8dc68e-1458-4199-9641-6781960e085e',
|
||||
'8585fe89-a050-4dbb-beb8-6ebd7358a970',
|
||||
'd2542667-0dbf-4680-a5af-042d70f24a55',
|
||||
'7395831e-4325-4b16-85bb-36c94f68aec0',
|
||||
'180571e8-f943-4980-8997-b3eed2a0c141',
|
||||
'2b69f2f8-d567-48c3-8bb3-22e0dc8819bd',
|
||||
'2b5267b2-ce87-4e77-ad88-5cfec80496b9',
|
||||
'483c3416-ddfb-43fe-983b-08abb6b50c62',
|
||||
'df9855d7-12ae-4170-acf6-a05cd4f52515',
|
||||
'1582d056-55fb-403b-8a65-f3b641c96b69',
|
||||
'be95bdcc-e72a-4132-8a67-9dde9bad5e2a',
|
||||
'299dd454-076d-4580-8cb9-4301997e86cd',
|
||||
'0a3412da-5f73-4738-8364-15d5919750f3',
|
||||
'197da27d-0497-40b5-b2f8-cec4124d32f6',
|
||||
'a031d9a8-e433-45cf-826a-8881644f8eac',
|
||||
'02702bf3-261c-41e0-a22d-26d3e90493a3',
|
||||
'a013fa2c-5b84-49d3-a3b4-fb80a768f37c',
|
||||
'c5ea5c83-9535-4d52-a2d0-12c101e3aee9',
|
||||
'672a0dd4-a5a0-43c1-bd40-f66cdb241ec7',
|
||||
'3b149bfe-31c5-4991-bd6c-ba4c760089d4',
|
||||
'b6ae5e37-db6a-4b79-949f-be73b216f677',
|
||||
'2f787b42-e43a-4cea-9c12-19a647e21eeb',
|
||||
'bfb708e4-18eb-47b5-afde-737f16721e9a',
|
||||
'f02032d3-3d60-4cb1-acac-855c229646c3',
|
||||
'96b24666-85f2-4f70-ae59-f5a924cc045f',
|
||||
'f7701275-cebc-482b-ac31-9cfcd93937c3',
|
||||
'fcfe4ee2-b247-4244-8cfc-f3d98d219fea',
|
||||
'c6b6d415-323e-46c1-859e-be86fd36ec48',
|
||||
'e53216bf-9815-42c7-89c1-953a7b1289a3',
|
||||
'5eeef2ff-1616-43bb-a0c1-aa84ad551824',
|
||||
'c78fffea-32b8-477e-81e9-7133119d9207',
|
||||
'59ccfdeb-8a8a-4693-b4fa-27034192071c',
|
||||
'849f1551-604a-4b5c-9b5d-e2771eed488c',
|
||||
'cf5d1920-9618-43f3-8dac-53954d19a956',
|
||||
'4d0bf08e-3dda-4a2e-8213-72a020873a03',
|
||||
'e48c8995-6a64-45c1-ae62-ba96fcc01542',
|
||||
'0ef5fdd2-718c-47d2-88bc-2d0193b18530',
|
||||
'8302b674-c728-42d2-9ba3-908b4d970436',
|
||||
'ab461de6-1137-4548-87bf-f9dd78905417',
|
||||
'0b26d479-d9a7-4e07-aa2f-4893467f41c2',
|
||||
'604dd8b8-175a-4a74-93d2-28760f1d1835',
|
||||
'26c5277c-440a-4dea-b625-beb986cff673',
|
||||
'8e33adf0-5932-4535-90c7-10fa04e97201',
|
||||
'1ef34494-4d48-4b69-9819-a22c5870fc24',
|
||||
'b2b8d7aa-06e8-4ed5-bc9b-cb9ce0e81309',
|
||||
'e4017ee0-6141-4145-816f-ed68ee6931bc',
|
||||
'84d32175-8cb8-4fb0-95cc-6ae13d40aaaa',
|
||||
'27489e34-b04c-410e-99a2-0d93e2e42fbf',
|
||||
'65cff7cb-0a29-4c0c-9280-76af55d1432d',
|
||||
'e5e8565f-80e2-4462-b687-56f6d64f95e4',
|
||||
'27accc37-c3fd-465f-99cd-3e131081aeca',
|
||||
'32e112bd-5495-4399-85dd-1925e1ccbba5',
|
||||
'dc50ca43-5071-45b3-bf42-e1e64416ffd0',
|
||||
'950a6345-5a13-4931-8d82-eac6adef03e3',
|
||||
'700640e7-0de3-49dc-b441-4efff8ad33ba',
|
||||
'5f35e542-a8cf-4422-8e87-466cdca62864',
|
||||
'f50cb362-2f86-44eb-89e6-bea6ecbaf89f',
|
||||
'31a7cbe0-6aa6-403b-a561-6bc4fa81c0b1',
|
||||
'd694804c-ae1a-4db0-b5fc-2497e43abb6f',
|
||||
'a008a4e6-e026-4a1c-8aef-eea78c41b029',
|
||||
'4575114c-1e63-41b1-8953-67d3ce3ed3e6',
|
||||
'853de4bd-6f6a-4d1d-980a-b67eb1b0e876',
|
||||
'cd0fa4e0-2d24-4b35-918a-33baa736015e',
|
||||
'933baf03-3664-4c33-bd97-208a9f7ab78b',
|
||||
'55bae3db-5f62-4be3-823a-bcb429b8a2b2',
|
||||
'4754b85b-e7a6-41a8-b0e9-5e02c58ebc38',
|
||||
'33f4fc73-102d-492e-9b0a-383d0b0f68b0',
|
||||
'fa8914be-0986-460c-884d-9973a9622045',
|
||||
'b9f734fa-de0d-4a0b-9ce2-c092126e1d8d',
|
||||
'448f3335-cf11-4e7a-9939-c734861d16e3',
|
||||
'106775db-a00d-4956-bf27-97ea269bb001',
|
||||
'594cd6c0-17db-4241-be56-ad28a8db4f7b',
|
||||
'95f7b67d-3ba8-4d18-bcbb-3e02f7bfaf7a',
|
||||
]
|
||||
|
||||
PERSON_IDS = [
|
||||
|
||||
87
Todos.md
87
Todos.md
@ -1,81 +1,12 @@
|
||||
* [ ] ([KeystoneRV](2022-11-22_keystonerv.md)) [10/27/2022] Are learners enrolled in Learning Paths, enrolled in all courses in the LP? Or just the first one? When does Enrollment start?
|
||||
* [X] (Talkspace) [10/27/2022] Update 2022 to 2023 on the main dashboard page - Update now
|
||||
* [ ] (Talkspace) [10/27/2022] Setup Workflow Notifications
|
||||
* [X] (Talkspace) [10/27/2022] Turn on Workflows for Talkspace BBHR
|
||||
* [ ] (Talkspace) [10/27/2022] Get designs for Learning Path Customization & we can talk about categories
|
||||
* [ ] (Talkspace) [10/27/2022] Password protection for a course when prompted.
|
||||
* [X] (Talkspace) [10/27/2022] See if in NPP school we can remove/delete not activated people.
|
||||
* [X] (Talkspace) [10/27/2022] Pull report of all users in NPP with activated/deactived status
|
||||
* [X] (Wildhealth) [10/31/2022] Pass PTO information onto Brian so he knows about the support tickets from Baeleigh & WildHealth.
|
||||
* [X] (Wildhealth) [10/31/2022] Update Branding on WPG - Abby to send new logo and Norm to figure out colors/branding for styling.
|
||||
* [X] (Aiim) [11/08/2022] Send DV Accredible Interface with Badging and Certs. Aiim uses accredible.
|
||||
* [ ] (Aiim) [11/08/2022] Create a QBR report for next month's meeting. Analytics, product info. Review usage, etc.
|
||||
* [ ] (Amyris) [11/08/2022] Setup Quarterly Looker Pull of MCA to be sent to Nicole. Year to Date, MCA. Next one in January.
|
||||
* [X] (SwiftMedical) [11/08/2022] Create Tabs & categories on catalog page - deciding on design.
|
||||
* [ ] (Talkspace) [11/08/2022] If a course a is at 100% and is a 1099 course, remove from dashboard
|
||||
* [X] (Talkspace) [11/08/2022] Remove Footer Completely no Dash no LPs
|
||||
* [X] (Talkspace) [11/08/2022] Add Training@talkspace.com to footer
|
||||
* [X] (Northpass) [11/09/2022] Start GrowthPass #6
|
||||
* [X] (Northpass) [11/09/2022] Complete SOC 2 Training in Northpass University for employees.
|
||||
* [X] (PUK) [11/09/2022] Check if we need to amend and re-send the Psychiatry-UK Agreement based on the hold until end of February.
|
||||
* [X] (Northpass) [11/09/2022] Talk to prouct about updating the default admin invitation email content with support links, northpass academy, etc
|
||||
* [X] (SPSCommerce) [11/09/2022] Create some HTML design updates for under the normal cards on the training events page.
|
||||
* [X] (Skuid) [11/11/2022] Send Jessica questions about who is the super admin in Hubspot and ask her to setup a private or public app for our integrations.
|
||||
* [X] (Skuid) [11/11/2022] Send Alexa the WildHealth Style report for each Learning Path as a test.
|
||||
* [X] (Skuid) [11/11/2022] Ask Chris to help with Learning Paths and Skuid Reports.
|
||||
* [ ] (Zenjob) [11/11/2022] Ask if we can do a custom integration with Salesforce to send assignment submission pictures
|
||||
* [ ] (Zenjob) [11/11/2022] Can we pass information INTO a Typeform survey so that a learner doesn't have to enter their name?
|
||||
* [X] (Zenjob) [11/11/2022] Change Back to my courses to the correct german ([see notes](Zenjob.md)) and remove `/app/dashboards` link, it should go to `/app/courses`
|
||||
* [ ] (Zenjob) [11/11/2022] Ask Sophie about Shopify integration details and what they want to accomplish with selling courses.
|
||||
* [ ] (Northpass) [11/11/2022] Submit ticket for a custom page creation in Northpass Academy that ONLY shows Admin Onboarding Courses.
|
||||
* [X] (JJSV) [11/14/2022] Contact us should go to a FORM not an email - remove link all together for now make it inactive
|
||||
* [X] (JJSV) [11/14/2022] Opt out for emails - Comms Changes
|
||||
* [X] (JJSV) [11/14/2022] Upload the second video to the properties for us to test for playability.If it works, Melinda can feel confident about future videos.
|
||||
* [ ] (JJSV) [11/14/2022] Update Registration Privacy Policy with Vision Pro Legal notice at "jnjvisionpro.com/legal-notice"
|
||||
* [X] (JJSV) [11/14/2022] MAKE SURE YOU UPLOAD THE AUDIO STUFF TODAY! Upload podcasts to AWS and upload the SCORM so she has examples of both.
|
||||
* [ ] (TripleSeat) [11/15/2022] Get Brian ChurnZero information
|
||||
* [ ] (TripleSeat) [11/15/2022] Screenshots of AppCues Examples
|
||||
* [X] (TripleSeat) [11/15/2022] Send Holly/Katie details of what needs to be done for embedding.
|
||||
* [X] (Talkspace) [11/15/2022] Create video showing how to setup a Webhook in Fountain for Molly and Taylor to talk to Gracie about. The goal is for a webhook to fire when someone completes a stage in Fountain that attests that they are seeing clients and that would enroll them in their appropriate group and courses.
|
||||
# Random Tasks
|
||||
*Date is the date the task as assigned.*
|
||||
|
||||
## Meeting with Travis
|
||||
## 2/20/2023
|
||||
|
||||
Figure out:How to offload implementation, support, and analytics from CSM
|
||||
We should NOT be doing those three things
|
||||
Figure out with Rob how to allow analytics team to create custom dashboards
|
||||
* [ ] Send exec-check in for Kat/Emily
|
||||
* [ ] Get understanding of Netradyne Enterprise pricing from Erica/Charles
|
||||
* [ ] Complete Lila’s courses review
|
||||
* [ ] Get better understanding from Travis what was discussed in previous HackerRank meetings
|
||||
* [ ] Slack with Lila & Kat about remaining courses for review
|
||||
* [ ] Confirm with Mohammed the common requests
|
||||
|
||||
Goal for Norm and Travis is to reduce variables and having CSMs create workflows on their own. They should start using a workflow we set out for them.
|
||||
|
||||
Support=0%
|
||||
Implementation = 20% (content and strategy)
|
||||
Analytics = 10% (delivery and showcase only)
|
||||
|
||||
Each CSM should have a visualization tool of their customer's hierarchy and structure
|
||||
DONE: Create skeleton mind map for CSMs to use.
|
||||
DONE: Create structure of daily workflows and how to be efficient at their job
|
||||
|
||||
Golden rules:
|
||||
|
||||
* Maintain a minimum of x points of contact (if you have 2, make 3.)
|
||||
* On demand be able to articulate use case and what their client is trying to accomplish
|
||||
* Short and long term goals for the client
|
||||
* Renewal date and estimated amount
|
||||
* Recent usage and changes over the last 2 months (weekly changes)
|
||||
* Biggest pain point with Northpass
|
||||
* Biggest satisfaction with Northpass
|
||||
|
||||
Travis is going to pull together an account health meeting for the team that looks at:
|
||||
|
||||
* Renewals within 6 months. We will go line-by-line.
|
||||
* Norm and Travis to
|
||||
|
||||
### CSM Assignments and Territories
|
||||
|
||||
Google Slides of each quarter for CSMs to go through.
|
||||
|
||||
## 01/04/2023
|
||||
|
||||
### Safic-Alcan, Urgent Catch up
|
||||
|
||||
Use case: users must login
|
||||
Can one of the fields be a list of groups?
|
||||
|
||||
Reference in New Issue
Block a user