<?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: Associate Ticket to contact in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/398778#M39424</link>
    <description>&lt;P&gt;Hi, I don't have the documentation of the node sdk , you should check first the parameter of the method. If the expected first parameter of the method is the ticket id you should check if createTicketResponse.body contain the id, please check doc, dump the value and post here the value of this variable&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jan 2021 17:28:59 GMT</pubDate>
    <dc:creator>quentin_lamamy</dc:creator>
    <dc:date>2021-01-21T17:28:59Z</dc:date>
    <item>
      <title>Associate Ticket to contact</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/398533#M39390</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am trying to associate between a ticket to a contact using the hubspot api&amp;nbsp; - node.js but having trouble would apreciate for an example on how to do it.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 17:07:28 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/398533#M39390</guid>
      <dc:creator>TYona</dc:creator>
      <dc:date>2021-01-11T17:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Associate Ticket to contact</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/398747#M39421</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/158047"&gt;@TYona&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Can you post your code (inside a code bloc, the &amp;lt;/&amp;gt; icon in the formatting toolbar) so that i can help you.&lt;BR /&gt;- What's is your issue ? An error messsage as api response ? If yes which one&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 17:28:48 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/398747#M39421</guid>
      <dc:creator>quentin_lamamy</dc:creator>
      <dc:date>2021-01-21T17:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Associate Ticket to contact</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/398772#M39423</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/148828"&gt;@quentin_lamamy&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;Below you may find the code and the error&lt;/P&gt;&lt;P&gt;the error is:&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;UnhandledPromiseRejectionWarning: Error: Required parameter ticketId was null or undefined when calling create.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;at AssociationsApi.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const hubspot = require('@hubspot/api-client')
const hubspotClient = new hubspot.Client({apiKey: 'MYAPIKEY'})

const contactObj = {
    properties: {
        firstname: 'T',
        lastname: 'Test',
        email: 'ty@example.com',
        company: 'Texample'
    },
}
const ticketObj = {
    properties: {
        "hs_pipeline": "0",
        "hs_pipeline_stage": "1",
        "hs_ticket_priority": "HIGH",
        "hubspot_owner_id": "5555555",
        "subject": "test association"
    }
};
// create ticket
const createTicketResponse = hubspotClient.crm.tickets.basicApi.create(ticketObj)
// create contact
const createContactResponse = hubspotClient.crm.contacts.basicApi.create(contactObj)
function addTicket(){
    return hubspotClient.crm.tickets.associationsApi.create(createTicketResponse.body, "tickets", createContactResponse.body, "", undefined, undefined)

}

addTicket()
    .then(console.log('done'))
    .catch(console.log('error'))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 09:05:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/398772#M39423</guid>
      <dc:creator>TYona</dc:creator>
      <dc:date>2021-01-12T09:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Associate Ticket to contact</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/398778#M39424</link>
      <description>&lt;P&gt;Hi, I don't have the documentation of the node sdk , you should check first the parameter of the method. If the expected first parameter of the method is the ticket id you should check if createTicketResponse.body contain the id, please check doc, dump the value and post here the value of this variable&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 17:28:59 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/398778#M39424</guid>
      <dc:creator>quentin_lamamy</dc:creator>
      <dc:date>2021-01-21T17:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Associate Ticket to contact</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/399164#M39452</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;After checking it seems that the id is undefined.&lt;/P&gt;&lt;P&gt;I used this documentation, still no luck with assocation of a contact to a ticket.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd appreciate an example of it using the sdk from someone in the community &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 07:56:39 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/399164#M39452</guid>
      <dc:creator>TYona</dc:creator>
      <dc:date>2021-01-13T07:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Associate Ticket to contact</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/399303#M39466</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you give me the link of the documentation you are following and post the dump of createTicketResponse&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 17:29:11 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/399303#M39466</guid>
      <dc:creator>quentin_lamamy</dc:creator>
      <dc:date>2021-01-21T17:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Associate Ticket to contact</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/399363#M39474</link>
      <description>&lt;P&gt;Actually I managed! The problem was with js rather then the api itself.&lt;/P&gt;&lt;P&gt;Thanks Quentin!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 15:44:01 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/399363#M39474</guid>
      <dc:creator>TYona</dc:creator>
      <dc:date>2021-01-13T15:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Associate Ticket to contact</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/399368#M39475</link>
      <description>&lt;P&gt;If your issue is solved don't forget to flag your post as solved.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 15:53:28 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/399368#M39475</guid>
      <dc:creator>quentin_lamamy</dc:creator>
      <dc:date>2021-01-13T15:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Associate Ticket to contact</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/753960#M61294</link>
      <description>&lt;P&gt;This is an old thread and I'm sure it was solved, yet if someone arrives here with the same issue, you should have supplied the ticketId and the contactId, respectively, wherever you've send the body of the response.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 10:30:17 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Associate-Ticket-to-contact/m-p/753960#M61294</guid>
      <dc:creator>TShma</dc:creator>
      <dc:date>2023-02-09T10:30:17Z</dc:date>
    </item>
  </channel>
</rss>

