<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Associations v4 basicApi issue in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Associations-v4-basicApi-issue/m-p/1168465#M82805</link>
    <description>&lt;P&gt;Hi &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/957583"&gt;@Oldu&lt;/a&gt;&lt;/SPAN&gt; and welcome, we are so glad to have you here!&lt;BR /&gt;&lt;BR /&gt;Thanks for asking the HubSpot Community!&lt;BR /&gt;&lt;BR /&gt;Here is the documentation about &lt;A href="https://developers.hubspot.com/docs/guides/api/crm/objects/custom-objects" target="_blank"&gt;Custom objects&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;You might want to check these resources, they might give you some ideas:&lt;BR /&gt;&lt;BR /&gt;- The solution from &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/463990"&gt;@cowles123&lt;/a&gt;&lt;/SPAN&gt; on this post "&lt;A href="https://community.hubspot.com/t5/APIs-Integrations/Read-all-data-from-Custom-Object/m-p/493944" target="_blank"&gt;Read all data from Custom Object&lt;/A&gt;"&lt;BR /&gt;- The solution from &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/426475"&gt;@coldrickjack&lt;/a&gt;&lt;/SPAN&gt; on this post "&lt;A href="https://community.hubspot.com/t5/APIs-Integrations/API-endpoint-to-retrieve-a-list-of-all-objects-in-a-HubSpot/m-p/824108" target="_blank"&gt;API endpoint to retrieve a list of all objects in a HubSpot account&lt;/A&gt;"&lt;BR /&gt;&lt;BR /&gt;Also, I'd love to put you in touch with our Top Experts: Hi &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/193060"&gt;@JBeatty&lt;/a&gt;&lt;/SPAN&gt;, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366"&gt;@sylvain_tirreau&lt;/a&gt;&lt;/SPAN&gt; and &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/426475"&gt;@coldrickjack&lt;/a&gt;&lt;/SPAN&gt; do you have any insights you can share with &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/957583"&gt;@Oldu&lt;/a&gt;&lt;/SPAN&gt;, please?&lt;BR /&gt;&lt;BR /&gt;Have a beautiful day and thanks so much for your help!&lt;BR /&gt;Bérangère&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jun 2025 10:29:00 GMT</pubDate>
    <dc:creator>BérangèreL</dc:creator>
    <dc:date>2025-06-24T10:29:00Z</dc:date>
    <item>
      <title>Associations v4 basicApi issue</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Associations-v4-basicApi-issue/m-p/1168215#M82794</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;&lt;BR /&gt;Im new to hubspot crm, but trying to make one simple thing. I have created the extension that just make document files, now i need data for this files. I want to get it from Deal&amp;nbsp;associations. I have custom object - it represents the products&amp;nbsp;associated with the deal. So, everything I want just to fetch the list of the products.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My card use call to serverless function, main data it passes without problem, so I assume I make it works. But I stuck with getting the products. I tried this request right in the sandobx of documenation&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;/crm/v4/objects/{objectType}/{objectId}/associations/{toObjectType}&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;I put my token and&amp;nbsp;objectType,&amp;nbsp;objectId and&amp;nbsp;toObjectType to the sandbox and it works. I see the results in sandbox below. So, I copied the code from it to my serverless function and I can't make a request, because getting&amp;nbsp;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR - TypeError: Cannot read properties of undefined (reading 'basicApi')&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;at exports.main (/var/task/test.js:66:47)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;at exports.hubspot_handler [as handler] (/var/task/hubspotHandler.js:20:34)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1187:29)&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;I google a lot and find that there was a problem with Node.js, but it was in 2023. So, I hope they have fixed it already. I tried to create a simple fetch requests to v3 and v4 api and didn't get results in it. All the times some kind of errors. So, can somebody please share how you guys fetching the&amp;nbsp;&lt;SPAN&gt;associations details with hubspot SDK or without.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;I even tried this:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;async&lt;/SPAN&gt; &lt;SPAN&gt;function&lt;/SPAN&gt; &lt;SPAN&gt;getAssociatedRecords&lt;/SPAN&gt;&lt;SPAN&gt;({&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;objectType&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;S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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;accept&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"application/json"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"content-type"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"application/json"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;authorization&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"Bearer "&lt;/SPAN&gt; &lt;SPAN&gt;+&lt;/SPAN&gt; &lt;SPAN&gt;token&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; };&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;req&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;https&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;request&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;options&lt;/SPAN&gt;&lt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body:"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;body&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;!&lt;/SPAN&gt;&lt;SPAN&gt;body&lt;/SPAN&gt; &lt;SPAN&gt;||&lt;/SPAN&gt; &lt;SPAN&gt;body&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;trim&lt;/SPAN&gt;&lt;SPAN&gt;() &lt;/SPAN&gt;&lt;SPAN&gt;===&lt;/SPAN&gt; &lt;SPAN&gt;""&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;reject&lt;/SPAN&gt;&lt;SPAN&gt;({&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;message&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"Empty response body"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;statusCode&lt;/SPAN&gt;&lt;SP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t;/SPAN&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt; &lt;SPAN&gt;reject&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;err&lt;/SPAN&gt;&lt;SPAN&gt;));&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;req&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;end&lt;/SPAN&gt;&lt;SPAN&gt;();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; });&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;but still no luck&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jun 2025 20:18:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Associations-v4-basicApi-issue/m-p/1168215#M82794</guid>
      <dc:creator>Oldu</dc:creator>
      <dc:date>2025-06-23T20:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: Associations v4 basicApi issue</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Associations-v4-basicApi-issue/m-p/1168465#M82805</link>
      <description>&lt;P&gt;Hi &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/957583"&gt;@Oldu&lt;/a&gt;&lt;/SPAN&gt; and welcome, we are so glad to have you here!&lt;BR /&gt;&lt;BR /&gt;Thanks for asking the HubSpot Community!&lt;BR /&gt;&lt;BR /&gt;Here is the documentation about &lt;A href="https://developers.hubspot.com/docs/guides/api/crm/objects/custom-objects" target="_blank"&gt;Custom objects&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;You might want to check these resources, they might give you some ideas:&lt;BR /&gt;&lt;BR /&gt;- The solution from &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/463990"&gt;@cowles123&lt;/a&gt;&lt;/SPAN&gt; on this post "&lt;A href="https://community.hubspot.com/t5/APIs-Integrations/Read-all-data-from-Custom-Object/m-p/493944" target="_blank"&gt;Read all data from Custom Object&lt;/A&gt;"&lt;BR /&gt;- The solution from &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/426475"&gt;@coldrickjack&lt;/a&gt;&lt;/SPAN&gt; on this post "&lt;A href="https://community.hubspot.com/t5/APIs-Integrations/API-endpoint-to-retrieve-a-list-of-all-objects-in-a-HubSpot/m-p/824108" target="_blank"&gt;API endpoint to retrieve a list of all objects in a HubSpot account&lt;/A&gt;"&lt;BR /&gt;&lt;BR /&gt;Also, I'd love to put you in touch with our Top Experts: Hi &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/193060"&gt;@JBeatty&lt;/a&gt;&lt;/SPAN&gt;, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366"&gt;@sylvain_tirreau&lt;/a&gt;&lt;/SPAN&gt; and &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/426475"&gt;@coldrickjack&lt;/a&gt;&lt;/SPAN&gt; do you have any insights you can share with &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/957583"&gt;@Oldu&lt;/a&gt;&lt;/SPAN&gt;, please?&lt;BR /&gt;&lt;BR /&gt;Have a beautiful day and thanks so much for your help!&lt;BR /&gt;Bérangère&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 10:29:00 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Associations-v4-basicApi-issue/m-p/1168465#M82805</guid>
      <dc:creator>BérangèreL</dc:creator>
      <dc:date>2025-06-24T10:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Associations v4 basicApi issue</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Associations-v4-basicApi-issue/m-p/1168563#M82817</link>
      <description>&lt;P&gt;This is the code I'm using on the CRM Card I'm building (it's a serverless function but the code should be fine anywhere). In general, I prefer to use BatchApi over BasicApi because I can keep the data format consistent across all functions (instead of using one for when I retrieve record and another when I retrieve multiple records). I have no idea if there's a speed benefit for one vs the other.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Media Plans is our custom object which is converted to the p_media_plans object name. So you can see the first function,&amp;nbsp;getTicketAssociationsById, simply prepares the payload (ticket id) and then calls the function to retrieve the data. All the data gets returned to the function that called it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/*****
Retrieve all associations of a ticket that we need
*****/
async function getTicketAssociationsById (ticket_id) {
	const payload = {"inputs": [ { "id": ticket_id }]};
	
	let companies = await getAssociations( "tickets", "company", payload );
	let contacts = await getAssociations( "tickets", "contacts", payload );
	let deals = await getAssociations( "tickets", "deals", payload );
	let media_plans = await getAssociations( "tickets", "p_media_plans", payload );
	
	return ( {"companies": companies, "contacts": contacts, "deals": deals, "media_plans": media_plans } );
}
	
/*****
Associations Call
*****/
async function getAssociations (source, target, data) {
  // API Call
  try {
    const results = await hubspotClient.crm.associations.v4.batchApi.getPage(source, target, data)
    return results.results
  } catch (e) {
    console.log(e)
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since I don't know your code that is returning the error, hard to tell what's wrong. But unknown function usually means there's something wrong in the function you're trying to call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the code that you pulled is not working, which it should, you probably need to verify the data you're presenting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would open up something like Postman and test the API request directly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you run a GET request on:&lt;/P&gt;&lt;P&gt;&lt;A href="https://api.hubapi.com/crm/v4/objects/deals/12345/associations/tickets" target="_blank"&gt;https://api.hubapi.com/crm/v4/objects/deals/12345/associations/tickets&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where 12345 is your deal, you would get tickets associated with the deal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's say your custom object name is Products so your object name should be something like p_products, you would do something like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://api.hubapi.com/crm/v4/objects/deals/12345/associations/p_products" target="_blank"&gt;https://api.hubapi.com/crm/v4/objects/deals/12345/associations/p_products&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which should retrieve all the products associated with the deal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 13:15:57 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Associations-v4-basicApi-issue/m-p/1168563#M82817</guid>
      <dc:creator>MichaelMa</dc:creator>
      <dc:date>2025-06-24T13:15:57Z</dc:date>
    </item>
  </channel>
</rss>

