[ISSUE-REVERT]: Support for Hubspot associations API
Describe the feature Currently there is no way to access associations between different hubspot data objects.
For example given a deal entity identify all contacts associated with that deal.
Accessing associations in bulk (batches) would also be useful as it is a common use case to get associations of multiple objects in one API call.
Additional context Hubspot Associations API documentation - https://developers.hubspot.com/docs/api/crm/associations
A functionality that will be really useful would be coupling the associations api with the CRM GET apis. For example, while using the /crm/deals GET endpoint, being able to pass another query param called associations containing string of comma separated objects to be associated with the primary object.
curl -G https://api.revert.dev/crm/deals \
-H "x-revert-api-token: string" \
-H "x-revert-t-id: string" \
-H "x-api-version: string" \
-d fields=string \
-d associations="contacts" \
-d pageSize=string
which will give a response like below,
{
"status": "ok",
"results": [
{
"amount": 0,
"createdTimestamp": {},
"expectedCloseDate": {},
"id": "string",
"isWon": true,
"name": "string",
"probability": 0,
"remoteId": "string",
"stage": "string",
"updatedTimestamp": {},
"additional": {},
"priority": "string"
"contacts": [...list of contacts associated with deal]
}
],
"next": "string",
"previous": "string"
}
~~## 💎 $40 bounty • Revert~~
~~### Steps to solve:~~
~~1. Start working: Comment /attempt #540 with your implementation plan~~
~~2. Submit work: Create a pull request including /claim #540 in the PR body to claim the bounty~~
~~3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts~~
~~Thank you for contributing to revertinc/revert!~~
~~Add a bounty • Share on socials~~
| Attempt | Started (GMT+0) | Solution |
|---|---|---|
| 🟢 @majjikishore007 | Apr 27, 2024, 5:29:27 AM | WIP |
| 🟢 @ashutoshdhande | Apr 30, 2024, 2:22:26 AM | WIP |
| 🟢 @bibhuty-did-this | May 6, 2024, 11:32:28 AM | WIP |
| 🟢 @manish-singh-bisht | #548 |
@majjikishore007
Here the request can contain the association parameter with a comma seperated set of fields such as contacts,companies or only one contacts.
The API response should have the associated contacts or companies or another association data in the additional block like this:
{
"additional" : {
"associations" : {
"contacts: '{...}'
}
}
}
For multiple associations requested the response should look like this:
{
"additional" : {
"associations" : {
"contacts": '{...}',
"companies: '{...}',
}
}
}
If the request does not have associations in the request query the response should look like this:
{
"additional" : {}
}
Please follow this request & response structure for the PR, thanks!
got it @jatinsandilya will update the pr accordingly thanks
this bounty awarded is not for this issue, it was for different issue.
the bounty for this issue is still valid.
🎉🎈 @manish-singh-bisht has been awarded $40! 🎈🎊
* [Share on socials](https://console.algora.io/awards/clvurv8iy0002me09kpvkl1yy) * [Give feedback](https://console.algora.io/claims/clvurv8iy0002me09kpvkl1yy)
@jatinsandilya here is the sample response given in the docs for a batch read request
{
"completedAt": "2024-05-10T14:16:40.773Z",
"requestedAt": "2024-05-10T14:16:40.773Z",
"startedAt": "2024-05-10T14:16:40.773Z",
"links": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"results": [
{
"from": {
"id": "37295"
},
"to": {
"id": "37295"
},
"type": "contact_to_company"
}
],
"status": "PENDING"
}
could you please specify how the final response should look, as you mentioned you need the actual data of contacts and companies