API - Logging a call activity for a deal

Hi,

I am trying to create a call activity and associate it with a caontact and a deal.
I am using the folllowing APIs:

POST https://api.hubapi.com/crm/v3/objects/calls
Payload:

{

“properties”: {

“hs_timestamp”: “2022-10-30T03:30:17.883Z”,

“hs_call_title”: “ServiceNow test call 2”,

“hubspot_owner_id”: “231229109”,

“hs_call_body”: “The SECOND call to test upload to hubspot”,

“hs_call_duration”: “3800”,

“hs_call_from_number”: “(857)1829 5489”,

“hs_call_to_number”: “(509) 999 9999”,

“hs_call_recording_url”: “https://Zoom.com/1111”,

“hs_call_status”: “COMPLETED”,

“hs_call_disposition”: “f240bbac-87c9-4f6e-bf70-924b57d47db7”,

“hs_call_callee_object_id”: “251”,

“hs_call_direction”: “OUTBOUND”

}

}

PUT https://api.hubapi.com/crm/v4/objects/calls/27821624900/associations/contact/251
Payload:

[

{

“associationCategory”: “HUBSPOT_DEFINED”,

“associationTypeId”: 10

}

]
PUT https://api.hubapi.com/crm/v4/objects/deal/10877547666/associations/call/27821624900
Payload:

[

{

“associationCategory”: “HUBSPOT_DEFINED”,

“associationTypeId”: 11

}

]

I have several question.
1. The call that I create by this method is not the same as the one I create from the Hubspot UI. The Contacted, Date and Time fields missing. How do I populate those fields using the API call. The contacted field should have been populated by the hs_call_callee_object_id in the payload, but looks like it does nothing.
2. For the association APIs where can I find the value for associationTypeId? I found this document but it looks like a legacy doc:

3. Why is the payload for the association APIs like a array of JSONObjects? Difficult to create that in Java. Can you please help me create that payload in Java?
4. I am using v3 and v4 APIs so that they work better. Should I be using legacy v1 API call to create the engagement?
Please help me here. Thank you.
Anupam

Hey, @AKumar915 :waving_hand: I will answer some of these, and we’ll see if the community can assist with the others.

  • Q1 — those are not listed as documented additional parameters that can be added or updated by API. I expected them to be there as well, and it is not part of the documentation.

  • Q2 — you can use the endpoint listed here to get association types — Retrieve association types.

    “make a GET request to /crm/v4/associations/{fromObjectType}/{toObjectType}/labels”

  • Q4 — the v3 and v4 endpoints offer different/additional options from the legacy endpoints. You can use either. It’s really up to your personal needs.

Best,

Jaycee