<?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: why do I get {&amp;quot;error&amp;quot;: &amp;quot;Invalid OAuth2 token.&amp;quot;} in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-do-I-get-quot-error-quot-quot-Invalid-OAuth2-token-quot/m-p/608445#M28190</link>
    <description>&lt;P&gt;PS: I am actually using in PHP this&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://github.com/spatie/dropbox-api" target="_self"&gt;&lt;FONT face="courier new,courier"&gt;$client = new \Spatie\Dropbox\Client();&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this documentation doesn't really seem to talk about an example of short life tokens, just talks that there is an object (but no example) so it's all but useless to new users: but it was last updated only a few days ago. Whole situation seems very strange&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jul 2022 17:21:10 GMT</pubDate>
    <dc:creator>Conners</dc:creator>
    <dc:date>2022-07-08T17:21:10Z</dc:date>
    <item>
      <title>why do I get {"error": "Invalid OAuth2 token."}</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-do-I-get-quot-error-quot-quot-Invalid-OAuth2-token-quot/m-p/608424#M28186</link>
      <description>&lt;P&gt;I followed this article&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://dropbox.tech/developers/generate-an-access-token-for-your-own-account" target="_self"&gt;https://dropbox.tech/developers/generate-an-access-token-for-your-own-account&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but when I do this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl https://api.dropbox.com/1/account/info -H "Authorization:Bearer sl.BLDmzx7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxsomethinginherexxxxx"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;{"error": "Invalid OAuth2 token."}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="drop.png" style="width: 800px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/30218i37DB80977ACB3886/image-size/large?v=v2&amp;amp;px=999" role="button" title="drop.png" alt="drop.png" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;what am I doing wrong?&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 06:24:21 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-do-I-get-quot-error-quot-quot-Invalid-OAuth2-token-quot/m-p/608424#M28186</guid>
      <dc:creator>Conners</dc:creator>
      <dc:date>2022-07-11T06:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: why do I get {"error": "Invalid OAuth2 token."}</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-do-I-get-quot-error-quot-quot-Invalid-OAuth2-token-quot/m-p/608428#M28188</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1555472"&gt;@Conners&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;what am I doing wrong?&lt;/FONT&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1555472"&gt;@Conners&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;The only wrong thing you are doing is following the outdated article. "long lived token" can't get issued anymore. Newly issued access tokens are always short lived. 🤷 That's it.&lt;/P&gt;&lt;P&gt;If you want long term access you can consider refresh token usage. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add: why don't you use &lt;A title="Get information about the current user's account" href="https://www.dropbox.com/developers/documentation/http/documentation#users-get_current_account" target="_blank" rel="noopener"&gt;/2/users/get_current_account instead&lt;/A&gt;?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 16:24:32 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-do-I-get-quot-error-quot-quot-Invalid-OAuth2-token-quot/m-p/608428#M28188</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-07-08T16:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: why do I get {"error": "Invalid OAuth2 token."}</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-do-I-get-quot-error-quot-quot-Invalid-OAuth2-token-quot/m-p/608443#M28189</link>
      <description>&lt;P&gt;hi, thanks for the reply, i am more than happy to get short life tokens but I cannot find any refernce material out there, why is that?&lt;BR /&gt;&lt;BR /&gt;edit: I see your link is information on an alternate call however when I call it I get&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Error in call to API function "sharing/add_folder_member": Your API app is an "App Folder" app. It is not allowed to access this API function&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;however at the permissions level I already have everything ticked&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="drop2.png" style="width: 800px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/30219i9CE3EEAE08A52239/image-size/large?v=v2&amp;amp;px=999" role="button" title="drop2.png" alt="drop2.png" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 17:16:40 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-do-I-get-quot-error-quot-quot-Invalid-OAuth2-token-quot/m-p/608443#M28189</guid>
      <dc:creator>Conners</dc:creator>
      <dc:date>2022-07-08T17:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: why do I get {"error": "Invalid OAuth2 token."}</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-do-I-get-quot-error-quot-quot-Invalid-OAuth2-token-quot/m-p/608445#M28190</link>
      <description>&lt;P&gt;PS: I am actually using in PHP this&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://github.com/spatie/dropbox-api" target="_self"&gt;&lt;FONT face="courier new,courier"&gt;$client = new \Spatie\Dropbox\Client();&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this documentation doesn't really seem to talk about an example of short life tokens, just talks that there is an object (but no example) so it's all but useless to new users: but it was last updated only a few days ago. Whole situation seems very strange&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 17:21:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-do-I-get-quot-error-quot-quot-Invalid-OAuth2-token-quot/m-p/608445#M28190</guid>
      <dc:creator>Conners</dc:creator>
      <dc:date>2022-07-08T17:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: why do I get {"error": "Invalid OAuth2 token."}</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-do-I-get-quot-error-quot-quot-Invalid-OAuth2-token-quot/m-p/608446#M28191</link>
      <description>&lt;P&gt;You can take a look on &lt;A title="Dropbox API v2" href="https://www.dropbox.com/developers/documentation/http/documentation" target="_blank" rel="noopener"&gt;Dropbox API v2 documentation&lt;/A&gt; for available access points and their use in curl. For guide how you can use long term account access using API look on &lt;A href="https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Issue-in-generating-access-token/td-p/592667" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add: You can't share anything when your restricted your application in an application specific folder. If you need to manage users sharing, you have to recreate the application with proper access type (it's not a matter of preferences and you can't do it there).&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 17:25:40 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-do-I-get-quot-error-quot-quot-Invalid-OAuth2-token-quot/m-p/608446#M28191</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-07-08T17:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: why do I get {"error": "Invalid OAuth2 token."}</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-do-I-get-quot-error-quot-quot-Invalid-OAuth2-token-quot/m-p/608454#M28194</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1555472"&gt;@Conners&lt;/a&gt; The blog post you referred to is very old and now out of date. As Здравко noted, you should now use &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#users-get_current_account" target="_blank"&gt;/2/users/get_current_account&lt;/A&gt; instead of /1/account/info. And as they said, app's with the app folder &lt;A href="https://www.dropbox.com/developers/reference/developer-guide#app-permissions" target="_blank"&gt;access type&lt;/A&gt; cannot use shared folder functionality, such as &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#sharing-add_folder_member" target="_blank"&gt;/2/sharing/add_folder_member&lt;/A&gt;. You would need to &lt;A href="https://www.dropbox.com/developers/apps/create" target="_blank"&gt;register&lt;/A&gt; another app with "full Dropbox" access if you need to use that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And as you found, Dropbox is in the process of switching to only issuing short-lived access tokens (and optional refresh tokens) instead of long-lived access tokens. You can find &lt;A href="https://dropbox.tech/developers/migrating-app-permissions-and-access-tokens#updating-access-token-type" target="_blank" rel="noopener noreferrer"&gt;more information on this migration here&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;Apps can still get long-term access by requesting "offline" access though, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. You can find more information in the &lt;A href="https://developers.dropbox.com/oauth-guide" target="_blank" rel="noopener noreferrer"&gt;OAuth Guide&lt;/A&gt; and &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#authorization" target="_blank" rel="noopener noreferrer"&gt;authorization documentation&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;For reference, while the creation of new long-lived access tokens is now deprecated, we don't currently have a plan to disable existing long-lived access tokens. (If that changes, we will of course announce that ahead of time.) That being the case, you can continue using existing long-lived access token(s) without interruption, if you have any. Also, note though that after the change you won't be able to create new long-lived access tokens.&lt;BR /&gt;&lt;BR /&gt;While the change began on September 30th 2021, we released it gradually, so you may not have seen your app(s) affected until more recently. Once it applies to your app, it would apply regardless of the "Access token expiration" setting for your app, and that setting may no longer be available for your app.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, &lt;A href="https://github.com/spatie/dropbox-api" target="_blank"&gt;the library you linked to&lt;/A&gt; is not made by Dropbox, so we cannot offer support for the library itself, or guarantee that it is up to date with the latest functionality, such as for short-lived access tokens/refresh tokens.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 17:51:52 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/why-do-I-get-quot-error-quot-quot-Invalid-OAuth2-token-quot/m-p/608454#M28194</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-07-08T17:51:52Z</dc:date>
    </item>
  </channel>
</rss>

