Hello,
I am trying to use the HubSpot API to create a new call activity log for an existing contact. This is the code that I am using:
import requests
url = "https://api.hubapi.com/crm/v3/objects/calls"
id = 'XXXXXXXXXX'
HAPI_KEY = 'XXXXXXXXXX'
querystring = {"hapikey": HAPI_KEY}
payload = "{\"properties\":{\"hs_timestamp\":\"2021-03-17T01:32:44.872Z\",\"hs_call_title\":\"Discovery call\",\"hubspot_owner_id\":" + id + ",\"hs_call_body\":\" Decision maker out, will call back tomorrow\",\"hs_call_duration\":\"3800\",\"hs_call_from_number\":\"(857) 829 5489\",\"hs_call_to_number\":\"(509) 999 9999\",\"hs_call_recording_url\":\"https://api.twilio.com/2010-04-01/Accounts/AC890b8e6fbe0d989bb9158e26046a8dde/Recordings/RE3079ac919116b2d22\",\"hs_call_status\":\"COMPLETED\"}}"
headers = {
'accept': "application/json",
'content-type': "application/json"
}
response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
print(response.text)
‘response’ has the value ‘<Response [200]>’ and what is printed out is:
{"id":"XXXXXXXX","properties":{"hs_all_owner_ids":"XXXXXXXX","hs_body_preview":"Decision maker out, will call back tomorrow","hs_body_preview_html":"<html>\n <head></head>\n <body>\n Decision maker out, will call back tomorrow\n </body>\n</html>","hs_body_preview_is_truncated":"false","hs_call_body":" Decision maker out, will call back tomorrow","hs_call_duration":"3800","hs_call_from_number":"(857) 829 5489","hs_call_recording_url":"https://api.twilio.com/2010-04-01/Accounts/AC890b8e6fbe0d989bb9158e26046a8dde/Recordings/RE3079ac919116b2d22","hs_call_status":"COMPLETED","hs_call_title":"Discovery call","hs_call_to_number":"(509) 999 9999","hs_createdate":"2022-01-29T03:10:49.927Z","hs_lastmodifieddate":"2022-01-29T03:10:49.927Z","hs_object_id":"XXXXXXXXX","hs_timestamp":"2021-03-17T01:32:44.872Z","hubspot_owner_assigneddate":"2022-01-29T03:10:49.927Z","hubspot_owner_id":"XXXXXXXXX"},"createdAt":"2022-01-29T03:10:49.927Z","updatedAt":"2022-01-29T03:10:49.927Z","archived":false}
However, when I check the contact on HubSpot, I do not see the call log. Does anyone know why this is happening and how to correctly create a call log? Thank you in advance!