# API - Logging a call activity for a deal

**URL:** <https://community.hubspot.com/t/api-logging-a-call-activity-for-a-deal/69155>\
**Category:** APIs & Integrations\
**Tags:** object\
**Created:** [November 13, 2022, 3:58pm UTC](https://community.hubspot.com/t/api-logging-a-call-activity-for-a-deal/69155 "2022-11-13T15:58:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AKumar915](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@AKumar915](https://community.hubspot.com/u/AKumar915)\
**Post date:** [November 13, 2022, 3:58pm UTC](https://community.hubspot.com/t/api-logging-a-call-activity-for-a-deal/69155/1 "2022-11-13T15:58:56Z")

</div>

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](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](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/](https://api.hubapi.com/crm/v4/objects/calls/27821072128/associations)27821624900[/associations](https://api.hubapi.com/crm/v4/objects/calls/27821072128/associations)/contact/251  
Payload:

[

{

“associationCategory”: “HUBSPOT\_DEFINED”,

“associationTypeId”: 10

}

]  
PUT [https://api.hubapi.com/crm/v4/objects/deal/10877547666/associations/call/27821624900](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:

> **[Accounts Dashboard | HubSpot](https://app.hubspot.com/myaccounts?next=developerdocs&redirect=%2Fguides%2Fapi%2Fcrm%2Fassociations)**

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

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [November 18, 2022, 8:40pm UTC](https://community.hubspot.com/t/api-logging-a-call-activity-for-a-deal/69155/2 "2022-11-18T20:40:31Z")

</div>

Hey, @AKumar915 👋 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.

- 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
