Changes?
This commit is contained in:
@ -38,7 +38,7 @@ def getfromEmail(emails, baseUrlemail, apiKey, data):
|
||||
print("Another Error!")
|
||||
|
||||
data["uuid"] = data["email"].map(email_ids)
|
||||
data.dropna(how='any', inplace=True)
|
||||
data.dropna(how="any", inplace=True)
|
||||
assignProps(data, apiKey)
|
||||
errorstoCsv(errors)
|
||||
|
||||
@ -46,9 +46,9 @@ def getfromEmail(emails, baseUrlemail, apiKey, data):
|
||||
def errorstoCsv(errors):
|
||||
errorcsv = pd.DataFrame(errors)
|
||||
errorcsv.to_csv(
|
||||
path_or_buf="/Users/normrasmussen/Downloads/Emails_Not_Northpass.csv",
|
||||
index=False
|
||||
)
|
||||
path_or_buf="/Users/normrasmussen/Downloads/Emails_Not_Northpass.csv",
|
||||
index=False,
|
||||
)
|
||||
|
||||
|
||||
def assignProps(data, apiKey):
|
||||
@ -59,14 +59,16 @@ def assignProps(data, apiKey):
|
||||
uuid = row[4]
|
||||
url = "https://api.northpass.com/v2/properties/people/bulk"
|
||||
payload = {
|
||||
"data": [{
|
||||
"data": [
|
||||
{
|
||||
"type": "person_properties",
|
||||
"attributes": {"properties": {
|
||||
"user_id": ts_id,
|
||||
"role_type": ts_role
|
||||
}},
|
||||
"attributes": {
|
||||
"properties": {"user_id": ts_id, "role_type": ts_role}
|
||||
},
|
||||
"id": uuid,
|
||||
}]}
|
||||
}
|
||||
]
|
||||
}
|
||||
headers = {
|
||||
"accept": "application/json",
|
||||
"content-type": "application/json",
|
||||
|
||||
Reference in New Issue
Block a user