<?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: Create a ticket from API in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Create-a-ticket-from-API/m-p/861293#M68034</link>
    <description>&lt;P&gt;Thank you. i Got exactly what i want KaBoom&lt;/P&gt;</description>
    <pubDate>Sun, 08 Oct 2023 04:43:57 GMT</pubDate>
    <dc:creator>Rkc</dc:creator>
    <dc:date>2023-10-08T04:43:57Z</dc:date>
    <item>
      <title>Create a ticket from API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Create-a-ticket-from-API/m-p/841087#M66898</link>
      <description>&lt;P&gt;I am using API to create a ticket by posting the following JSON to&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://api.hubapi.com/crm/v3/objects/tickets" target="_blank" rel="noopener"&gt;https://api.hubapi.com/crm/v3/objects/tickets&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"properties"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"hs_pipeline"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"0"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"hs_pipeline_stage"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"1"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"hs_ticket_priority"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"HIGH"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"subject"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"troubleshoot report"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"content"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"test email content τεστ"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"project"&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;"TEST POSTMAN"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;How can I pass in JSON the creator email to automatically create the assosiation with contact?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 28 Aug 2023 12:37:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Create-a-ticket-from-API/m-p/841087#M66898</guid>
      <dc:creator>karkaletsis</dc:creator>
      <dc:date>2023-08-28T12:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create a ticket from API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Create-a-ticket-from-API/m-p/841244#M66901</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/561181"&gt;@karkaletsis&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to include an association array in your request. This contains the ID of the CRM object that you'd like to associate to the ticket. For instance if I had a contact with ID "951" I could create the ticket and associate using the following request:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;POST https://api.hubapi.com/crm/v3/objects/tickets
HEADER AUTHORIZATION: BEARER TOKEN
BODY
{
    "properties": {
        "hs_pipeline": "0",
        "hs_pipeline_stage": "1",
        "hs_ticket_priority": "HIGH",
        "subject": "troubleshoot report"
    },
    "associations": [
        {
            "to": {
                "id": 951
            },
            "types": [
                {
                    "associationCategory": "HUBSPOT_DEFINED",
                    "associationTypeId": 16
                }
            ]
        }
    ]
}
RESPONSE
{
    "id": "1685582803",
    "properties": {
        "createdate": "2023-08-28T15:48:35.312Z",
        "hs_helpdesk_sort_timestamp": "2023-08-28T15:48:35.312Z",
        "hs_last_message_from_visitor": "false",
        "hs_lastmodifieddate": "2023-08-28T15:48:35.312Z",
        "hs_object_id": "1685582803",
        "hs_object_source": "INTEGRATION",
        "hs_object_source_id": "1914406",
        "hs_pipeline": "0",
        "hs_pipeline_stage": "1",
        "hs_ticket_id": "1685582803",
        "hs_ticket_priority": "HIGH",
        "subject": "troubleshoot report"
    },
    "createdAt": "2023-08-28T15:48:35.312Z",
    "updatedAt": "2023-08-28T15:48:35.312Z",
    "archived": false
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the &lt;A href="https://developers.hubspot.com/docs/api/crm/search" target="_blank" rel="noopener"&gt;CRM Search API&lt;/A&gt; to check to see if the contact exists in the CRM prior to making the above request. If they do their ID will be returned which you can use for the association. If they do not you can &lt;A href="https://developers.hubspot.com/docs/api/crm/contacts" target="_blank" rel="noopener"&gt;create a contact&lt;/A&gt; and use the returned ID to create the association.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck with the project!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 15:51:22 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Create-a-ticket-from-API/m-p/841244#M66901</guid>
      <dc:creator>coldrickjack</dc:creator>
      <dc:date>2023-08-28T15:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Create a ticket from API</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Create-a-ticket-from-API/m-p/861293#M68034</link>
      <description>&lt;P&gt;Thank you. i Got exactly what i want KaBoom&lt;/P&gt;</description>
      <pubDate>Sun, 08 Oct 2023 04:43:57 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Create-a-ticket-from-API/m-p/861293#M68034</guid>
      <dc:creator>Rkc</dc:creator>
      <dc:date>2023-10-08T04:43:57Z</dc:date>
    </item>
  </channel>
</rss>

