MadKudu / node-hubspot

Node wrapper for the HubSpot API
MIT License
193 stars 158 forks source link

Plans to add CRM Associations? #158

Open Zephyrrus opened 5 years ago

Zephyrrus commented 5 years ago

Hello,

I was wondering if there are any plans to implement the new CRM APIs in the future?

The old API used to go from a company to associated deals is being deprecated and replaced by a more generic association API described here https://developers.hubspot.com/docs/methods/crm-associations/get-associations

Thank you.

pcothenet commented 5 years ago

@Zephyrrus can you tell me a bit more about what would be needed to support this endpoint? What would the methods look like?

dangub commented 5 years ago

Not OP, but wanted to follow up.

The associate deal (and remove association) API is being deprecated (https://developers.hubspot.com/docs/methods/deals/associate_deal) in favour of a more generic CRM associations API (https://developers.hubspot.com/docs/methods/crm-associations/get-associations).

hubspot.deals.associate and hubspot.deals.removeAssociation (and I think some others) are using the deprecated APIs.

Also wondering if you have any plans to update. Thanks you.

dobesv commented 4 years ago
const assocations = await hubspot.apiRequest({
      method: 'GET',
      path: `/crm-associations/v1/associations/${fromObjectId}/HUBSPOT_DEFINED/${definitionId}`,
    });

As a workaround you can use apiRequest to fetch associations from the URL by hand, until that is added to this library.

Also a side note, looks like a whole new version 3 of the api is coming which will be doing things differently again.