<?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: PHP: Error in call to API function &amp;quot;files/upload&amp;quot;: The given OAuth 2 access token is m in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-Error-in-call-to-API-function-quot-files-upload-quot-The/m-p/588287#M27385</link>
    <description>&lt;P&gt;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" 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;/P&gt;</description>
    <pubDate>Mon, 04 Apr 2022 16:47:40 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2022-04-04T16:47:40Z</dc:date>
    <item>
      <title>PHP: Error in call to API function "files/upload": The given OAuth 2 access token is malformed.</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-Error-in-call-to-API-function-quot-files-upload-quot-The/m-p/585620#M27265</link>
      <description>&lt;P&gt;How do I fix this? The code is:&lt;/P&gt;&lt;P&gt;&amp;lt;?php$path = '(full path to file)';&lt;/P&gt;&lt;P&gt;$fp = fopen($path, 'rb');&lt;BR /&gt;$size = filesize($path);&lt;/P&gt;&lt;P&gt;$cheaders = array('Authorization: Bearer &amp;lt;API&amp;gt;',&lt;BR /&gt;'Content-Type: application/octet-stream',&lt;BR /&gt;'Dropbox-API-Arg: {"path":"/test/'.$path.'", "mode":"add"}');&lt;/P&gt;&lt;P&gt;$ch = curl_init('&lt;A href="https://content.dropboxapi.com/2/files/upload" target="_blank"&gt;https://content.dropboxapi.com/2/files/upload&lt;/A&gt;');&lt;BR /&gt;curl_setopt($ch, CURLOPT_HTTPHEADER, $cheaders);&lt;BR /&gt;curl_setopt($ch, CURLOPT_PUT, true);&lt;BR /&gt;curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');&lt;BR /&gt;curl_setopt($ch, CURLOPT_INFILE, $fp);&lt;BR /&gt;curl_setopt($ch, CURLOPT_INFILESIZE, $size);&lt;BR /&gt;curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);&lt;BR /&gt;$response = curl_exec($ch);&lt;/P&gt;&lt;P&gt;echo $response;&lt;BR /&gt;curl_close($ch);&lt;BR /&gt;fclose($fp);&lt;/P&gt;&lt;P&gt;?&amp;gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 10:29:26 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-Error-in-call-to-API-function-quot-files-upload-quot-The/m-p/585620#M27265</guid>
      <dc:creator>Inke</dc:creator>
      <dc:date>2022-03-23T10:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: PHP: Error in call to API function "files/upload": The given OAuth 2 access token is m</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-Error-in-call-to-API-function-quot-files-upload-quot-The/m-p/585675#M27268</link>
      <description>&lt;P&gt;A "The given OAuth 2 access token is malformed" error should indicate that the string you're passing as the Bearer access token in your request, shown as "&amp;lt;API&amp;gt;" in the code you shared, is not a valid Dropbox API access token. Make sure you're passing in the exact access token as you received it from Dropbox, without any modifications or extra characters/whitespace, etc. You can find more information on the authorization flow and access tokens 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;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 14:30:37 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-Error-in-call-to-API-function-quot-files-upload-quot-The/m-p/585675#M27268</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-03-23T14:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: PHP: Error in call to API function "files/upload": The given OAuth 2 access token is m</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-Error-in-call-to-API-function-quot-files-upload-quot-The/m-p/588086#M27372</link>
      <description>&lt;P&gt;The token is short living. How do I change it so refresh token from that?&lt;/P&gt;</description>
      <pubDate>Sun, 03 Apr 2022 19:07:34 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-Error-in-call-to-API-function-quot-files-upload-quot-The/m-p/588086#M27372</guid>
      <dc:creator>Inke</dc:creator>
      <dc:date>2022-04-03T19:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: PHP: Error in call to API function "files/upload": The given OAuth 2 access token is m</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-Error-in-call-to-API-function-quot-files-upload-quot-The/m-p/588287#M27385</link>
      <description>&lt;P&gt;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" 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;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 16:47:40 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/PHP-Error-in-call-to-API-function-quot-files-upload-quot-The/m-p/588287#M27385</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-04-04T16:47:40Z</dc:date>
    </item>
  </channel>
</rss>

