<?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: The redirect_uri does not match the client registered redirect_uri - what is it? in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/The-redirect-uri-does-not-match-the-client-registered-redirect/m-p/425565#M42284</link>
    <description>&lt;P&gt;DCrowe, did you ever find a workaround for this?&lt;BR /&gt;I'm having a similar problem.&lt;BR /&gt;I believe it is because Heroku constantly change the PORT being used and I don't think there is anyway to avoid this.&lt;BR /&gt;&lt;BR /&gt;Danny.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Apr 2021 15:37:46 GMT</pubDate>
    <dc:creator>DRG</dc:creator>
    <dc:date>2021-04-07T15:37:46Z</dc:date>
    <item>
      <title>The redirect_uri does not match the client registered redirect_uri - what is it?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/The-redirect-uri-does-not-match-the-client-registered-redirect/m-p/276805#M25238</link>
      <description>&lt;P&gt;Im trying to make my first app to get webhooks and getting this message when im trying to integrate my app:&amp;nbsp;"&lt;SPAN&gt;The redirect_uri does not match the client registered redirect_uri. Please contact the integrator". My redirect uri now is&amp;nbsp;&lt;FONT color="#000000"&gt;https&lt;SPAN class="token punctuation"&gt;:&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;www&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;example&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;com&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="token operator"&gt;&lt;BR /&gt;&lt;/SPAN&gt;Please tell me whats Im doing wrong?&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 12:53:19 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/The-redirect-uri-does-not-match-the-client-registered-redirect/m-p/276805#M25238</guid>
      <dc:creator>andrew_salman</dc:creator>
      <dc:date>2019-06-24T12:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: The redirect_uri does not match the client registered redirect_uri - what is it?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/The-redirect-uri-does-not-match-the-client-registered-redirect/m-p/277083#M25273</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/97843"&gt;@andrew_salman&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The redirect URI you specify when initiating the Oauth connection must exactly match the redirect URI you included in the request to get access/refresh tokens. Using the example from the docs, if you initiate the connection with this URL:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;A href="https://app.hubspot.com/oauth/authorize?client_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&amp;amp;scope=contacts%20automation&amp;amp;redirect_uri=https://www.example.com/" target="_blank"&gt;https://app.hubspot.com/oauth/authorize?client_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&amp;amp;scope=contacts%20automation&amp;amp;redirect_uri=https://www.example.com/&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;You have to include the exact redirect URI in your request to get access/refresh tokens:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;A href="https://api.hubapi.com/oauth/v1/token" target="_blank"&gt;https://api.hubapi.com/oauth/v1/token&lt;/A&gt; 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;&lt;/CODE&gt;&lt;STRONG&gt;redirect_uri=&lt;A href="https://www.example.com/" target="_blank"&gt;https://www.example.com/&lt;/A&gt;&lt;/STRONG&gt;&lt;CODE&gt;&amp;amp;code=zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you’ve done that and you’re still seeing the error, make sure to check if you have a trailing &lt;STRONG&gt;/ &lt;/STRONG&gt;at the end, this can cause problems. If you continue to see the error,&amp;nbsp;can you send me the URL you’re using to initiate the connection, as well as the full request you’re sending to get access/refresh tokens (sans code/client secret/etc.)?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 15:06:58 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/The-redirect-uri-does-not-match-the-client-registered-redirect/m-p/277083#M25273</guid>
      <dc:creator>cbarley</dc:creator>
      <dc:date>2019-06-25T15:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: The redirect_uri does not match the client registered redirect_uri - what is it?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/The-redirect-uri-does-not-match-the-client-registered-redirect/m-p/277987#M25406</link>
      <description>&lt;P&gt;Hellow cbarley&lt;BR /&gt;Thank you for reply.&lt;BR /&gt;Im receiving the code on my side and Im trying to use 3 conthructions on php:&lt;BR /&gt;1)&amp;nbsp;&lt;/P&gt;&lt;P&gt;$header = "Content-Type: application/x-www-form-urlencoded;charset=utf-8 Data: grant_type=authorization_code&amp;amp;client_id=".HUBSPOT_CLIENT_ID."&amp;amp;client_secret=".HUBSPOT_CLIENT_SECRET."&amp;amp;redirect_uri=" . urlencode(SITE_API_URL . "/hubspot/") . "&amp;amp;code=".$_REQUEST['code'];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$curl = curl_init();&lt;/P&gt;&lt;P&gt;curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);&lt;BR /&gt;curl_setopt($curl,CURLOPT_URL,'&lt;A href="https://api.hubapi.com/oauth/v1/token" target="_blank" rel="noopener"&gt;https://api.hubapi.com/oauth/v1/token&lt;/A&gt;');&lt;BR /&gt;curl_setopt($curl,CURLOPT_CUSTOMREQUEST,'POST');&lt;BR /&gt;curl_setopt($curl,CURLOPT_HTTPHEADER,array($header));&lt;BR /&gt;curl_setopt($curl,CURLOPT_HEADER,false);&lt;BR /&gt;$result = curl_exec($curl);&lt;BR /&gt;curl_close($curl);&lt;BR /&gt;$result = json_decode($result,true);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This construction returns nothing&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;P&gt;$header = "Content-Type: application/x-www-form-urlencoded;charset=utf-8 Data: grant_type=authorization_code&amp;amp;client_id=".HUBSPOT_CLIENT_ID."&amp;amp;client_secret=".HUBSPOT_CLIENT_SECRET."&amp;amp;redirect_uri=" . urlencode(SITE_API_URL . "/hubspot/") . "&amp;amp;code=".$_REQUEST['code'];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$curl = curl_init();&lt;/P&gt;&lt;P&gt;curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);&lt;BR /&gt;curl_setopt($curl,CURLOPT_URL,'&lt;A href="https://api.hubapi.com/oauth/v1/token" target="_blank" rel="noopener"&gt;https://api.hubapi.com/oauth/v1/token&lt;/A&gt;');&lt;BR /&gt;curl_setopt($curl,CURLOPT_HTTPHEADER,array($header));&lt;BR /&gt;curl_setopt($curl,CURLOPT_HEADER,false);&lt;BR /&gt;$result = curl_exec($curl);&lt;BR /&gt;curl_close($curl);&lt;BR /&gt;$result = json_decode($result,true);&lt;/P&gt;&lt;P&gt;Its GET request and it returns nothing&lt;BR /&gt;3)&lt;/P&gt;&lt;P&gt;$data = array(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; 'grant_type' =&amp;gt; 'authorization_code',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; 'client_id' =&amp;gt; HUBSPOT_CLIENT_ID,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; 'client_secret' =&amp;gt; HUBSPOT_CLIENT_SECRET,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; 'redirect_uri' =&amp;gt; SITE_API_URL . '/hubspot/',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; 'code' =&amp;gt; $_REQUEST['code']&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;$curl = curl_init();&lt;/P&gt;&lt;P&gt;curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);&lt;BR /&gt;curl_setopt($curl,CURLOPT_URL,'&lt;A href="https://api.hubapi.com/oauth/v1/token" target="_blank" rel="noopener"&gt;https://api.hubapi.com/oauth/v1/token&lt;/A&gt;');&lt;BR /&gt;curl_setopt($curl,CURLOPT_CUSTOMREQUEST,'POST');&lt;BR /&gt;curl_setopt($curl,CURLOPT_POSTFIELDS,json_encode($data));&lt;BR /&gt;curl_setopt($curl,CURLOPT_HEADER,false);&lt;/P&gt;&lt;P&gt;$result = curl_exec($curl);&lt;BR /&gt;curl_close($curl);&lt;BR /&gt;Is a classic POST request with standart HEADERS. It returns&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Array
(
    [status] =&amp;gt; BAD_GRANT_TYPE
    [message] =&amp;gt; missing or unknown grant type
    [correlationId] =&amp;gt; 4e98ae31-8b63-45ec-b7e5-60dd92f7899d
    [requestId] =&amp;gt; be2c9bb339f51cc81347070edbe87086
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Please tell me what im doing wrong.&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jun 2019 06:29:24 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/The-redirect-uri-does-not-match-the-client-registered-redirect/m-p/277987#M25406</guid>
      <dc:creator>andrew_salman</dc:creator>
      <dc:date>2019-06-29T06:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: The redirect_uri does not match the client registered redirect_uri - what is it?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/The-redirect-uri-does-not-match-the-client-registered-redirect/m-p/398226#M39362</link>
      <description>&lt;P&gt;I am having a similar problem. My redirect uri was a http://localhost:3000/oauth-callback. I was able to deploy it live on heroku but now I cant. I also can't make it a https://. I have tried using the heroku app as a redirect but that doesn't do the trick either.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jan 2021 00:27:17 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/The-redirect-uri-does-not-match-the-client-registered-redirect/m-p/398226#M39362</guid>
      <dc:creator>DCrowe</dc:creator>
      <dc:date>2021-01-10T00:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: The redirect_uri does not match the client registered redirect_uri - what is it?</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/The-redirect-uri-does-not-match-the-client-registered-redirect/m-p/425565#M42284</link>
      <description>&lt;P&gt;DCrowe, did you ever find a workaround for this?&lt;BR /&gt;I'm having a similar problem.&lt;BR /&gt;I believe it is because Heroku constantly change the PORT being used and I don't think there is anyway to avoid this.&lt;BR /&gt;&lt;BR /&gt;Danny.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 15:37:46 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/The-redirect-uri-does-not-match-the-client-registered-redirect/m-p/425565#M42284</guid>
      <dc:creator>DRG</dc:creator>
      <dc:date>2021-04-07T15:37:46Z</dc:date>
    </item>
  </channel>
</rss>

