Chubb changes for their access agents push.
This commit is contained in:
@ -35,3 +35,4 @@ LUMAFINTECH = "oDFA7XSmjEKjEwIDIKLm0rxs1"
|
||||
SUPPLIERPROD = "DtRH9m4r0zMbJEx1yWBGKlObi"
|
||||
DEEPL = "fo5uOoG9FNNGQ6lZkenmZVIzq"
|
||||
CECSINTERNAL = "r8KINCJRgkkQnrzzKitOJfsVw"
|
||||
EMPLOYINC = "qcNggCm4SBtC0gTqLGv30vX8l"
|
||||
|
||||
Binary file not shown.
@ -13,13 +13,34 @@ def parse_csv():
|
||||
unique_group_name = df['group_name'].unique().tolist()
|
||||
groups = df.groupby('group_uuid')
|
||||
for key,item in groups:
|
||||
pass
|
||||
# print(groups.get_group(key), "\n\n")
|
||||
group_course_payload = []
|
||||
# print(f"Group UUID is: {key}")
|
||||
# print(item)
|
||||
for courses, other in item.iterrows():
|
||||
# print("Course uuid is: ", other['course_uuid'])
|
||||
minipayload = { "type": "courses", "id": other['course_uuid']}
|
||||
group_course_payload.append(minipayload)
|
||||
final_payload = { "data": group_course_payload }
|
||||
group_url = f"https://api2.northpass.com/v2/groups/{key}/relationships/courses"
|
||||
gcourse_req = requests.post(group_url, headers=HEADERS, json=final_payload)
|
||||
print(gcourse_req.status_code)
|
||||
print(gcourse_req.text)
|
||||
|
||||
print(f"Total Number of courses: {df['course_name'].nunique()}")
|
||||
print(unique_group_name, unique_groups)
|
||||
# print(f"Number of Unique Groups: {unique_groups}")
|
||||
remove_group_courses(unique_groups)
|
||||
"""
|
||||
Sample Payload = { "data": [
|
||||
{
|
||||
"type": "courses",
|
||||
"id": "123123"
|
||||
},
|
||||
{
|
||||
"type": "courses",
|
||||
"id": "4567"
|
||||
}
|
||||
] }
|
||||
"""
|
||||
|
||||
# print(f"Total Number of courses: {df['course_name'].nunique()}")
|
||||
# print(unique_group_name, unique_groups)
|
||||
|
||||
def remove_group_courses(unique_groups):
|
||||
"""
|
||||
|
||||
25
Scripts/API_Tests/get_people_and_props.py
Normal file
25
Scripts/API_Tests/get_people_and_props.py
Normal file
@ -0,0 +1,25 @@
|
||||
import requests
|
||||
import Apikeys
|
||||
|
||||
APIKEY = Apikeys.EMPLOYINC
|
||||
BASEURL = "https://api.northpass.com/v2/people/"
|
||||
|
||||
HEADERS = {
|
||||
"accept": "application/json",
|
||||
"X-Api-Key": APIKEY
|
||||
}
|
||||
|
||||
def people():
|
||||
count = 0
|
||||
url = f"https://api.northpass.com/v2/people?page={count}"
|
||||
count += 1
|
||||
response = requests.get(url, header=HEADERS)
|
||||
respon = response.json()['data']
|
||||
|
||||
person_uuid = respon['id']
|
||||
person_status = respon['attributes']['registration_status']
|
||||
person_tuple = (person_uuid, person_status, '')
|
||||
|
||||
propurl = "https://api.northpass.com/v2/properties/people"
|
||||
prop_payload = { }
|
||||
|
||||
Reference in New Issue
Block a user