<?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: Error in files_list_folder method in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-files-list-folder-method/m-p/548979#M26138</link>
    <description>&lt;P&gt;This "The given OAuth 2 access token is malformed" error is referring to the oauth2_access_token parameter value you're passing to &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.Dropbox" target="_self"&gt;the Dropbox constructor&lt;/A&gt;. It means that the value you're passing in is not a valid Dropbox access token. You'll need to correct that to make sure you're passing in a valid access token for that parameter, and make sure there are no stray characters, e.g., extra whitespace, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the code you shared here, you have "[appl id]" as the value for that parameter, which I presume is just a placeholder you used to redact the actual value. The actual value should be either a short-lived access token (which starts with "sl.") or a long-lived access token (which doesn't start with "sl.", and would generally be 64 characters long). You can find more information on how to get an access token in &lt;A href="https://developers.dropbox.com/oauth-guide" target="_self"&gt;the OAuth Guide&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given the term "appl id" it sounds like it's possible that you're actually passing in your "app key", not an access token. Note that your "app key" just identifies an app, and does not enable access to an account. App keys are generally just around 15 characters long.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Oct 2021 18:10:31 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2021-10-05T18:10:31Z</dc:date>
    <item>
      <title>Error in files_list_folder method</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-files-list-folder-method/m-p/548960#M26136</link>
      <description>&lt;P&gt;I am still trying to get over the initial "hump" writing my first Python Dropbox API. Eventually I would like to iterate through all the folders in a Dropbox account, then for each of those folders, iterate through all the image (JPG) files, writing any comments the user entered to a flat (text) file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But baby steps first. I can't even get the &lt;STRONG&gt;files_list_folder&lt;/STRONG&gt; method to work! Help, please!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;My code:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;print("Initializing Dropbox API...")&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;from dropbox import Dropbox&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;dbx = Dropbox("[appl id]")&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;result = dbx.files_list_folder('')&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;U&gt;&lt;STRONG&gt;Output:&lt;/STRONG&gt;&lt;/U&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#666699"&gt;Initializing Dropbox API...&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#666699"&gt;Traceback (most recent call last):&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#666699"&gt;File "G:\pythonProject1\main.py", line 10, in &amp;lt;module&amp;gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#666699"&gt;result = dbx.files_list_folder('')&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#666699"&gt;File "C:\Users\camorgan_2\AppData\Local\Programs\Python\Python39\lib\site-packages\dropbox\base.py", line 1952, in files_list_folder&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#666699"&gt;r = self.request(&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#666699"&gt;File "C:\Users\camorgan_2\AppData\Local\Programs\Python\Python39\lib\site-packages\dropbox\dropbox_client.py", line 323, in request&amp;nbsp;res = self.request_json_string_with_retry(host,&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#666699"&gt;File "C:\Users\camorgan_2\AppData\Local\Programs\Python\Python39\lib\site-packages\dropbox\dropbox_client.py", line 479, in request&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#666699"&gt;_json_string_with_retry&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#666699"&gt;return self.request_json_string(host,&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#666699"&gt;File "C:\Users\camorgan_2\AppData\Local\Programs\Python\Python39\lib\site-packages\dropbox\dropbox_client.py", line 604, in request&amp;nbsp;_json_string&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#666699"&gt;raise BadInputError(request_id, r.text)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#666699"&gt;dropbox.exceptions.BadInputError: BadInputError('553b370bfef7427db853a0aa8b1b9bae', 'Error in call to API function "files/list_folder&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#666699"&gt;": The given OAuth 2 access token is malformed.')&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 16:39:40 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-files-list-folder-method/m-p/548960#M26136</guid>
      <dc:creator>Phoggbank</dc:creator>
      <dc:date>2021-10-05T16:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: Error in files_list_folder method</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-files-list-folder-method/m-p/548975#M26137</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1479782"&gt;@Phoggbank&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;...&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;dbx = Dropbox("[appl id]")&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;...&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#666699"&gt;": The given OAuth 2 access token is malformed.')&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@9AD39CA637682E9616FBE31CDAF1B6C4/emoticons/1f914.png" alt=":thinking_face:" title=":thinking_face:" /&gt; Did you provide OAuth 2 access token (or refresh token) within the Dropbox object instantiation? 🤷&lt;/P&gt;&lt;P&gt;Application code and secret are not any kind of access token! I think it's self explanatory. &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; For easy start copy corresponding code out from some example and use within your application.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 17:58:28 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-files-list-folder-method/m-p/548975#M26137</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2021-10-05T17:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error in files_list_folder method</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-files-list-folder-method/m-p/548979#M26138</link>
      <description>&lt;P&gt;This "The given OAuth 2 access token is malformed" error is referring to the oauth2_access_token parameter value you're passing to &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.Dropbox" target="_self"&gt;the Dropbox constructor&lt;/A&gt;. It means that the value you're passing in is not a valid Dropbox access token. You'll need to correct that to make sure you're passing in a valid access token for that parameter, and make sure there are no stray characters, e.g., extra whitespace, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the code you shared here, you have "[appl id]" as the value for that parameter, which I presume is just a placeholder you used to redact the actual value. The actual value should be either a short-lived access token (which starts with "sl.") or a long-lived access token (which doesn't start with "sl.", and would generally be 64 characters long). You can find more information on how to get an access token in &lt;A href="https://developers.dropbox.com/oauth-guide" target="_self"&gt;the OAuth Guide&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given the term "appl id" it sounds like it's possible that you're actually passing in your "app key", not an access token. Note that your "app key" just identifies an app, and does not enable access to an account. App keys are generally just around 15 characters long.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 18:10:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-in-files-list-folder-method/m-p/548979#M26138</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-10-05T18:10:31Z</dc:date>
    </item>
  </channel>
</rss>

