<?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 Creating ticket using API with contact and company attached in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Creating-ticket-using-API-with-contact-and-company-attached/m-p/333182#M32306</link>
    <description>&lt;P&gt;So my company is beginning to use HubSpot and we want to have contact and customer information to be included in the ticket.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My thought process is that we'd pass the user back to our website from our Hubspot help/faq stuff, to have them fill out a ticket from our website post that through the api into Hubspot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The other way is that we could pass in the contact information into hubspot or company information into hubspot ahead of time, but I'm not sure if that'd be possible. Please let me know, as that'd be the more elegant solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if we do create the ticket from out website, how would pass in the user information / company / custom fields, into the API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working with&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/methods/tickets/create-ticket" target="_blank" rel="noopener"&gt;https://developers.hubspot.com/docs/methods/tickets/create-ticket&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I was able to create a basic ticket with a subject/content, but am not able to figure out how to add in more information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I assume in order to create contact, I'd first need to see if the contact already exist inside of HubSpot, if not then create a contact. Then do the same with the Company info.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;How would I then attach that information to the ticket being created?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, how would I attach any custom fields info to the ticket?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 21 Apr 2020 21:25:01 GMT</pubDate>
    <dc:creator>DerekHub</dc:creator>
    <dc:date>2020-04-21T21:25:01Z</dc:date>
    <item>
      <title>Creating ticket using API with contact and company attached</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Creating-ticket-using-API-with-contact-and-company-attached/m-p/333182#M32306</link>
      <description>&lt;P&gt;So my company is beginning to use HubSpot and we want to have contact and customer information to be included in the ticket.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My thought process is that we'd pass the user back to our website from our Hubspot help/faq stuff, to have them fill out a ticket from our website post that through the api into Hubspot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The other way is that we could pass in the contact information into hubspot or company information into hubspot ahead of time, but I'm not sure if that'd be possible. Please let me know, as that'd be the more elegant solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if we do create the ticket from out website, how would pass in the user information / company / custom fields, into the API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working with&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/methods/tickets/create-ticket" target="_blank" rel="noopener"&gt;https://developers.hubspot.com/docs/methods/tickets/create-ticket&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I was able to create a basic ticket with a subject/content, but am not able to figure out how to add in more information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I assume in order to create contact, I'd first need to see if the contact already exist inside of HubSpot, if not then create a contact. Then do the same with the Company info.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;How would I then attach that information to the ticket being created?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, how would I attach any custom fields info to the ticket?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 21:25:01 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Creating-ticket-using-API-with-contact-and-company-attached/m-p/333182#M32306</guid>
      <dc:creator>DerekHub</dc:creator>
      <dc:date>2020-04-21T21:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Creating ticket using API with contact and company attached</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Creating-ticket-using-API-with-contact-and-company-attached/m-p/333279#M32329</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/128273"&gt;@DerekHub&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When looking to attach contact/company with a ticket, you can use the&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/api/crm/associations" target="_blank"&gt;CRM API | Associations&lt;/A&gt;. e.g. if I'd like to associate contact&amp;nbsp;123 to ticket 456&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;POST&amp;nbsp;crm/v3/associations/contact/ticket/batch/create?hapikey=hapikey&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;POST Body&lt;/P&gt;
&lt;PRE&gt;{
  "inputs": [
    {
      "from": {
        "id": "123"
      },
      "to": {
        "id": "456"
      },
      "type": "contact_to_ticket"
    }
  ]
}&lt;/PRE&gt;
&lt;P&gt;To your second query, if you're looking to include custom fields on a ticket record, you would first need to create a custom ticket property, either via &lt;A href="https://knowledge.hubspot.com/crm-setup/manage-your-properties#create-custom-properties" target="_self"&gt;in-app&lt;/A&gt; or&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/api/crm/properties" target="_blank"&gt;CRM API | Properties&lt;/A&gt; and assign value to the custom property when creating ticket via the&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/api/crm/tickets" target="_blank"&gt;CRM API | Tickets&lt;/A&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 07:33:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Creating-ticket-using-API-with-contact-and-company-attached/m-p/333279#M32329</guid>
      <dc:creator>WendyGoh</dc:creator>
      <dc:date>2020-04-22T07:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Creating ticket using API with contact and company attached</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Creating-ticket-using-API-with-contact-and-company-attached/m-p/444888#M44073</link>
      <description>&lt;P&gt;I getting this error.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"status"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"error"&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;&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;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"Unable&amp;nbsp;to&amp;nbsp;infer&amp;nbsp;object&amp;nbsp;type&amp;nbsp;from:&amp;nbsp;fromObjectType"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"correlationId"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"d860c050-0547-4df1-87a0-ff47014a17d2"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 08 Jun 2021 04:40:05 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Creating-ticket-using-API-with-contact-and-company-attached/m-p/444888#M44073</guid>
      <dc:creator>KGarimbao</dc:creator>
      <dc:date>2021-06-08T04:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: Creating ticket using API with contact and company attached</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Creating-ticket-using-API-with-contact-and-company-attached/m-p/444891#M44074</link>
      <description>&lt;P&gt;&lt;STRONG&gt;I need help, I think theirs something wrong with the API. so I have a contact with a vid of&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;6901&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and the ticket id was&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;441618771&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and set the type to&lt;/STRONG&gt; `contact_to_ticket`&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;I used the endpoint&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;?php&lt;BR /&gt;/* &lt;A href="https://packagist.org/packages/hubspot/api-client" target="_blank"&gt;https://packagist.org/packages/hubspot/api-client&lt;/A&gt; */&lt;/P&gt;&lt;P&gt;$curl = curl_init();&lt;/P&gt;&lt;P&gt;curl_setopt_array($curl, array(&lt;BR /&gt;CURLOPT_URL =&amp;gt; "&lt;A href="https://api.hubapi.com/crm/v3/associations/fromObjectType/toObjectType/batch/create?hapikey=" target="_blank"&gt;https://api.hubapi.com/crm/v3/associations/fromObjectType/toObjectType/batch/create?hapikey=&lt;/A&gt;&amp;lt;already added my key here&amp;gt;",&lt;BR /&gt;CURLOPT_RETURNTRANSFER =&amp;gt; true,&lt;BR /&gt;CURLOPT_ENCODING =&amp;gt; "",&lt;BR /&gt;CURLOPT_MAXREDIRS =&amp;gt; 10,&lt;BR /&gt;CURLOPT_TIMEOUT =&amp;gt; 30,&lt;BR /&gt;CURLOPT_HTTP_VERSION =&amp;gt; CURL_HTTP_VERSION_1_1,&lt;BR /&gt;CURLOPT_CUSTOMREQUEST =&amp;gt; "POST",&lt;BR /&gt;CURLOPT_POSTFIELDS =&amp;gt; "{\"inputs\":[{\"from\":{\"id\":\"6901 \"},\"to\":{\"id\":\"441618771 \"},\"type\":\"contact_to_ticket\"}]}",&lt;BR /&gt;CURLOPT_HTTPHEADER =&amp;gt; array(&lt;BR /&gt;"accept: application/json",&lt;BR /&gt;"content-type: application/json"&lt;BR /&gt;),&lt;BR /&gt;));&lt;/P&gt;&lt;P&gt;$response = curl_exec($curl);&lt;BR /&gt;$err = curl_error($curl);&lt;/P&gt;&lt;P&gt;curl_close($curl);&lt;/P&gt;&lt;P&gt;if ($err) {&lt;BR /&gt;echo "cURL Error #:" . $err;&lt;BR /&gt;} else {&lt;BR /&gt;echo $response;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;but this is showing error in my end&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;"status": "error",&lt;BR /&gt;"message": "Unable to infer object type from: fromObjectType",&lt;BR /&gt;"correlationId": "98363cdc-76ae-4d60-97de-071423a93923"&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 05:00:12 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Creating-ticket-using-API-with-contact-and-company-attached/m-p/444891#M44074</guid>
      <dc:creator>JGanawed</dc:creator>
      <dc:date>2021-06-08T05:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Creating ticket using API with contact and company attached</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Creating-ticket-using-API-with-contact-and-company-attached/m-p/762341#M61789</link>
      <description>&lt;P&gt;The ticket isn't created yet. how do we know its ID?&lt;BR /&gt;We want to create a ticket with an associated contact&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 22:15:15 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Creating-ticket-using-API-with-contact-and-company-attached/m-p/762341#M61789</guid>
      <dc:creator>DLu-ang</dc:creator>
      <dc:date>2023-02-28T22:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Creating ticket using API with contact and company attached</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Creating-ticket-using-API-with-contact-and-company-attached/m-p/764012#M61903</link>
      <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/529053"&gt;@DLu-ang&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; The Tickets API includes an example on how to create a Ticket and associate it to existing Objects, like a Contact or Deal, in the same call —&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/api/crm/tickets#associations" target="_blank" rel="noopener"&gt;Associations&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to walk through it together using the above example, create a new post and tag me in it (as this one is old now) and I'll add an example I created for another post.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Jaycee&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 18:57:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Creating-ticket-using-API-with-contact-and-company-attached/m-p/764012#M61903</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2023-03-03T18:57:16Z</dc:date>
    </item>
  </channel>
</rss>

