<?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>thread Getting &amp;quot;not authorized&amp;quot; error when trying to exchange code for access token in Archived Discussions (Read Only)</title>
    <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Getting-quot-not-authorized-quot-error-when-trying-to-exchange/m-p/26951#M94842</link>
    <description>&lt;P&gt;Hi all -&lt;/P&gt;
&lt;P&gt;Hoping someone can help with this.&lt;/P&gt;
&lt;P&gt;I can successfully generate the URL to prompt for permissions form.&lt;/P&gt;
&lt;P&gt;However, after the user accepts, we are trying to exchange the code returned for a token.&lt;/P&gt;
&lt;P&gt;However, when we attempt to use the code provided, we get an error response for the access token saying:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;{"message"=&amp;gt;"Not Authorized", "type"=&amp;gt;"service.not_authorized"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any assistance is appreciated. Agian, this is AFTER the permission link has been clicked and approved.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Dec 2016 18:53:00 GMT</pubDate>
    <dc:creator>RT-Michael</dc:creator>
    <dc:date>2016-12-22T18:53:00Z</dc:date>
    <item>
      <title>Getting "not authorized" error when trying to exchange code for access token</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Getting-quot-not-authorized-quot-error-when-trying-to-exchange/m-p/26951#M94842</link>
      <description>&lt;P&gt;Hi all -&lt;/P&gt;
&lt;P&gt;Hoping someone can help with this.&lt;/P&gt;
&lt;P&gt;I can successfully generate the URL to prompt for permissions form.&lt;/P&gt;
&lt;P&gt;However, after the user accepts, we are trying to exchange the code returned for a token.&lt;/P&gt;
&lt;P&gt;However, when we attempt to use the code provided, we get an error response for the access token saying:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;{"message"=&amp;gt;"Not Authorized", "type"=&amp;gt;"service.not_authorized"}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any assistance is appreciated. Agian, this is AFTER the permission link has been clicked and approved.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 18:53:00 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Getting-quot-not-authorized-quot-error-when-trying-to-exchange/m-p/26951#M94842</guid>
      <dc:creator>RT-Michael</dc:creator>
      <dc:date>2016-12-22T18:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "not authorized" error when trying to exchange code for access token</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Getting-quot-not-authorized-quot-error-when-trying-to-exchange/m-p/27801#M94843</link>
      <description>&lt;P&gt;Hi!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry that you are having troubles, (and I hope your hoiday season was nice!) but I'll see if I can help.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is your application id? And which programming language are you using? It sounds like you might be malforming, or mixing up your request to the endpiont, so any code you could share, would be helpful as well!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 17:39:35 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Getting-quot-not-authorized-quot-error-when-trying-to-exchange/m-p/27801#M94843</guid>
      <dc:creator>tristansokol</dc:creator>
      <dc:date>2017-01-05T17:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "not authorized" error when trying to exchange code for access token</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Getting-quot-not-authorized-quot-error-when-trying-to-exchange/m-p/41053#M94844</link>
      <description>&lt;P&gt;Hi, I am also getting the error.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;{
    "message": "Not Authorized",
    "type": "service.not_authorized"
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get the code and redirect as I was supposed to, but when I try to send cliend_id, client_secret and code to&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://connect.squareup.com/oauth2/token" target="_blank"&gt;https://connect.squareup.com/oauth2/token&lt;/A&gt; I am getting the error above.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;App id:&amp;nbsp;sandbox-sq0idp-TZyrZ3dg61kqmEp0ZakxVQ&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PHP is being used.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Alek&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2017 15:21:15 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Getting-quot-not-authorized-quot-error-when-trying-to-exchange/m-p/41053#M94844</guid>
      <dc:creator>alekBelgrade</dc:creator>
      <dc:date>2017-06-21T15:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "not authorized" error when trying to exchange code for access token</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Getting-quot-not-authorized-quot-error-when-trying-to-exchange/m-p/85348#M94845</link>
      <description>&lt;P&gt;I am also having the same problem. I am using the java oauth connect-examples code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;App ID:&amp;nbsp;sq0idp-udjQPpkVMEOa6QIiFf8Cpw&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jun 2018 04:58:14 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Getting-quot-not-authorized-quot-error-when-trying-to-exchange/m-p/85348#M94845</guid>
      <dc:creator>vuusa2000</dc:creator>
      <dc:date>2018-06-25T04:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "not authorized" error when trying to exchange code for access token</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Getting-quot-not-authorized-quot-error-when-trying-to-exchange/m-p/85525#M94846</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.squareup.com/t5/user/viewprofilepage/user-id/116782"&gt;@vuusa2000&lt;/a&gt;! If you're still experiencing this issue please &lt;A href="https://squareup.com/help/us/en/contact?panel=BF53A9C8EF68 " target="_blank"&gt;start a case with our API CS team&lt;/A&gt;&amp;nbsp;and they'll be able to investigate this further. Thanks for your patience!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 21:00:50 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Getting-quot-not-authorized-quot-error-when-trying-to-exchange/m-p/85525#M94846</guid>
      <dc:creator>Helen</dc:creator>
      <dc:date>2018-06-26T21:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "not authorized" error when trying to exchange code for access token</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Getting-quot-not-authorized-quot-error-when-trying-to-exchange/m-p/172698#M94847</link>
      <description>&lt;P&gt;I'm also getting this error.&lt;BR /&gt;&lt;BR /&gt;From php code, javascript code and their example wen page they have to test it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developer.squareup.com/explorer/square_2019-12-17/oauth-api/obtain-token" target="_blank"&gt;https://developer.squareup.com/explorer/square_2019-12-17/oauth-api/obtain-token&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I follow the link, it returns me to a page with the code in the querystring,&lt;BR /&gt;I come here and put that code along with my id key and&amp;nbsp;&lt;SPAN&gt;authorization_code for the type.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Press run request. and&amp;nbsp; &amp;nbsp;error 401&amp;nbsp;&lt;/P&gt;
&lt;PRE class="code-block code--json" tabindex="0" data-test-code-block-content=""&gt;&lt;CODE&gt;{
  &lt;SPAN class="hljs-attr"&gt;"message"&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;"Not Authorized"&lt;/SPAN&gt;,
  &lt;SPAN class="hljs-attr"&gt;"type"&lt;/SPAN&gt;: &lt;SPAN class="hljs-string"&gt;"service.not_authorized"&lt;/SPAN&gt;
}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 May 2020 23:13:20 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Getting-quot-not-authorized-quot-error-when-trying-to-exchange/m-p/172698#M94847</guid>
      <dc:creator>werdemup</dc:creator>
      <dc:date>2020-05-16T23:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "not authorized" error when trying to exchange code for access token</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Getting-quot-not-authorized-quot-error-when-trying-to-exchange/m-p/173076#M94848</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.squareup.com/t5/user/viewprofilepage/user-id/284642"&gt;@werdemup&lt;/a&gt;,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I'd recommend contacting our API team with the link Helen provided in the comment above yours to take a closer look.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;We don't have the API training here on the Community team to be able to assist with this directly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 19:12:15 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Getting-quot-not-authorized-quot-error-when-trying-to-exchange/m-p/173076#M94848</guid>
      <dc:creator>ashc</dc:creator>
      <dc:date>2020-05-18T19:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "not authorized" error when trying to exchange code for access token</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Getting-quot-not-authorized-quot-error-when-trying-to-exchange/m-p/196106#M94849</link>
      <description>&lt;P&gt;Check that you are using correct url endpoint. I have used "&lt;A href="https://connect.squareup.com/oauth2/token" target="_blank"&gt;https://connect.squareup.com/oauth2/token&lt;/A&gt;" in sandbox, but should use&amp;nbsp;"&lt;A href="https://connect.squareupsandbox.com" target="_blank"&gt;https://connect.squareupsandbox.com&lt;/A&gt;"&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 15:08:06 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Getting-quot-not-authorized-quot-error-when-trying-to-exchange/m-p/196106#M94849</guid>
      <dc:creator>AndreyFanyagin</dc:creator>
      <dc:date>2020-08-18T15:08:06Z</dc:date>
    </item>
  </channel>
</rss>

