# Custom code and Company deduplication

**URL:** <https://community.hubspot.com/t/custom-code-and-company-deduplication/94500>\
**Category:** APIs & Integrations\
**Tags:** companies, workflows\
**Created:** [November 21, 2023, 4:35pm UTC](https://community.hubspot.com/t/custom-code-and-company-deduplication/94500 "2023-11-21T16:35:29Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![GJakobTriad](https://avatars.discourse-cdn.com/v4/letter/g/3e96dc/32.png) [@GJakobTriad](https://community.hubspot.com/u/GJakobTriad)\
**Post date:** [November 22, 2023, 3:14pm UTC](https://community.hubspot.com/t/custom-code-and-company-deduplication/94500/3 "2023-11-22T15:14:22Z")

</div>

After a bunch of troubleshooting, I found the two issues which were breaking the code:

1. I was calling the wrong APIs, which should be **basicApi** and **searchApi** instead of DefaultApi. The [Company Endpoints documentation](https://developers.hubspot.com/docs/api/crm/companies) was misleading in this regard.
2. The [sample code](https://github.com/HubSpot/sample-workflow-custom-code/blob/main/samples/dedupe_contact.js) refers to “body.properties” when trying to look into the _properties_ clause of a response, and “body” throws it off, so that’s inaccurate too. The reference should only be “properties”, as in **companyResult.properties[DEDUPE\_PROPERTY]**.

---

_[View the full topic](https://community.hubspot.com/t/custom-code-and-company-deduplication/94500)._
