<?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 Webhooks for getting deleted deals in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Webhooks-for-getting-deleted-deals/m-p/552144#M49918</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to get notified when a deal is deleted so have set up an app and installed it at last. I have slowly got to the stage where I need to access and refresh tokens to get my new app to appear in Hubspot (and then hopefully my webhook will work). But it looks like I need to run this code:&lt;/P&gt;&lt;PRE&gt;POST URL:
https://api.hubapi.com/oauth/v1/token
Headers:
Content-Type: application/x-www-form-urlencoded;charset=utf-8
Data:
grant_type=authorization_code&amp;amp;client_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&amp;amp;client_secret=yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy&amp;amp;redirect_uri=https://www.example.com/&amp;amp;code=zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz



&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Does anyone know how / what tool to run this code in? Is it Node.Js as I don't know that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help much appreciated.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jan 2022 17:15:38 GMT</pubDate>
    <dc:creator>DVernon</dc:creator>
    <dc:date>2022-01-07T17:15:38Z</dc:date>
    <item>
      <title>Webhooks for getting deleted deals</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Webhooks-for-getting-deleted-deals/m-p/552144#M49918</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to get notified when a deal is deleted so have set up an app and installed it at last. I have slowly got to the stage where I need to access and refresh tokens to get my new app to appear in Hubspot (and then hopefully my webhook will work). But it looks like I need to run this code:&lt;/P&gt;&lt;PRE&gt;POST URL:
https://api.hubapi.com/oauth/v1/token
Headers:
Content-Type: application/x-www-form-urlencoded;charset=utf-8
Data:
grant_type=authorization_code&amp;amp;client_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&amp;amp;client_secret=yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy&amp;amp;redirect_uri=https://www.example.com/&amp;amp;code=zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz



&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Does anyone know how / what tool to run this code in? Is it Node.Js as I don't know that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help much appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jan 2022 17:15:38 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Webhooks-for-getting-deleted-deals/m-p/552144#M49918</guid>
      <dc:creator>DVernon</dc:creator>
      <dc:date>2022-01-07T17:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Webhooks for getting deleted deals</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Webhooks-for-getting-deleted-deals/m-p/553361#M49964</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/152955"&gt;@zaklein&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you have&amp;nbsp; working example to share on your OAuth setup?&lt;/P&gt;
&lt;P&gt;On a side note, I did a quick search for a HubSpot specific example on this and didn't find one &lt;span class="lia-unicode-emoji" title=":sad_but_relieved_face:"&gt;😥&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Might be time to create a tutorial.&amp;nbsp; What do you say &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/152955"&gt;@zaklein&lt;/a&gt; !&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 17:09:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Webhooks-for-getting-deleted-deals/m-p/553361#M49964</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2022-01-10T17:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Webhooks for getting deleted deals</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Webhooks-for-getting-deleted-deals/m-p/553951#M49988</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/211657"&gt;@DVernon&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are a number of guides to working with OAuth offered by HubSpot.&lt;/P&gt;
&lt;P&gt;I recommend following along with the example outlined in the &lt;A href="https://developers.hubspot.com/docs/api/oauth-quickstart-guide" target="_blank" rel="noopener"&gt;"OAuth Quickstart Guide".&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It sounds like you might be up to &lt;STRONG&gt;"Step 4: Exchange authorization code for tokens"&amp;nbsp;&lt;/STRONG&gt;with your app, but I'd recommend going through the entire guide from start to finish, to make sure you understand the ins and outs of OAuth for HubSpot.&lt;/P&gt;
&lt;P&gt;Addressing your question directly, the API function you are describing is exchanging an &lt;STRONG&gt;authorization code&lt;/STRONG&gt;&amp;nbsp;(appended as a query parameter by HubSpot to your app's installation redirect URL) for an &lt;STRONG&gt;access token&lt;/STRONG&gt; and a &lt;STRONG&gt;refresh token&lt;/STRONG&gt; (POST&amp;nbsp;/oauth/v1/token, where documentation can be found under "Tokens" heading within "Endpoints" tab on &lt;A href="https://developers.hubspot.com/docs/api/oauth/tokens" target="_blank" rel="noopener"&gt;this page&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;The actual mechanism that makes this call is completely up to you, and likely will depend on the tech stack you are using to build your app (might be Node.js, or maybe Python's Flask -- HubSpot's API documentation has examples in languages/frameworks such as cURL, Node.js, PHP, Ruby, Python, C#). It is possible (though not recommended outside of initial testing) to simply make these OAuth API calls yourself &lt;STRONG&gt;manually&lt;/STRONG&gt; using an API testing tool like &lt;A href="https://www.postman.com/" target="_blank" rel="noopener"&gt;Postman&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;I hope that proves helpful. I know OAuth can a tricky nut to crack the first time around. Stick with it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Let me know if you have any follow up questions.&lt;/P&gt;
&lt;P&gt;Thanks and all the best,&lt;/P&gt;
&lt;P&gt;Zach&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 15:04:45 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Webhooks-for-getting-deleted-deals/m-p/553951#M49988</guid>
      <dc:creator>zaklein</dc:creator>
      <dc:date>2022-01-11T15:04:45Z</dc:date>
    </item>
  </channel>
</rss>

