def create_task(owner_id,
Engagement type = TASK | NOTE | EMAIL | MEETING | CALL
tstampobj = datetime.now() + timedelta(days=time_delay)
tstamp = tstampobj.timestamp() * 1000
"contactIds": asso_contactids,
"companyIds": asso_companyids,
"ownerIds": asso_ownerids,
url = "https://api.hubapi.com/engagements/v1/engagements"
params = {"hapikey": HS_API_TOKEN}
headers = {'Content-Type': "application/json"}
except requests.HTTPError as e:
# Fetch the task id of the current task created
task_id = res_json.get("engagement").get("id")
print("🎆 Task created successfully: ", task_id)