<?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: How to get a refresh token in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-a-refresh-token/m-p/524524#M25495</link>
    <description>&lt;P&gt;If you're using a long-lived access token (e.g., as you described, by setting the "Access token expiration" setting in the App Console to "No Expiration" and then using the "Generate" button to generate an access token for your account and app), then you don't also need a refresh token. (Refresh tokens are for use with short-lived access tokens, not long-lived access tokens. Please note that &lt;A href="https://dropbox.tech/developers/migrating-app-permissions-and-access-tokens" target="_blank"&gt;long-lived access tokens are considered deprecated&lt;/A&gt; though. )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The particular error you're getting here is indicating that you did not pass a non-empty value for either the oauth2_access_token parameter (for a long-lived or short-lived access token) or oauth2_refresh_token (for a refresh token) when &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.Dropbox" target="_blank"&gt;building your client&lt;/A&gt;. At least one of these parameters is needed to make API calls.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How are you passing your access token in and constructing that &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.Dropbox" target="_blank"&gt;Dropbox object&lt;/A&gt;? It sounds like something about your environment isn't successfully retrieving your access token when running from the cron job.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Jun 2021 15:27:20 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2021-06-03T15:27:20Z</dc:date>
    <item>
      <title>How to get a refresh token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-a-refresh-token/m-p/524433#M25489</link>
      <description>&lt;P&gt;I have an app written in Python to upload files which I set up in the &lt;A href="http://www.dropbox.com/developers/apps" target="_blank" rel="noopener"&gt;www.dropbox.com/developers/apps&lt;/A&gt; section. I generated an access token and chose the expiration to be "No Expiration". When I run it manually with "python app_name.py" it works. But when I setup a cron job (with the same python interpreter etc.) I receive the error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;raise BadInputException('OAuth2 access token or refresh token must be set')
  dropbox.dropbox_client.BadInputException: OAuth2 access token or refresh token must be set&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to look for instructions about how to get this refresher token but didn't find anything. What's going on? How it works when I do it manually? Please assist.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jun 2021 12:00:27 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-a-refresh-token/m-p/524433#M25489</guid>
      <dc:creator>oen124</dc:creator>
      <dc:date>2021-06-07T12:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a refresh token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-a-refresh-token/m-p/524524#M25495</link>
      <description>&lt;P&gt;If you're using a long-lived access token (e.g., as you described, by setting the "Access token expiration" setting in the App Console to "No Expiration" and then using the "Generate" button to generate an access token for your account and app), then you don't also need a refresh token. (Refresh tokens are for use with short-lived access tokens, not long-lived access tokens. Please note that &lt;A href="https://dropbox.tech/developers/migrating-app-permissions-and-access-tokens" target="_blank"&gt;long-lived access tokens are considered deprecated&lt;/A&gt; though. )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The particular error you're getting here is indicating that you did not pass a non-empty value for either the oauth2_access_token parameter (for a long-lived or short-lived access token) or oauth2_refresh_token (for a refresh token) when &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.Dropbox" target="_blank"&gt;building your client&lt;/A&gt;. At least one of these parameters is needed to make API calls.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How are you passing your access token in and constructing that &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.Dropbox" target="_blank"&gt;Dropbox object&lt;/A&gt;? It sounds like something about your environment isn't successfully retrieving your access token when running from the cron job.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jun 2021 15:27:20 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-a-refresh-token/m-p/524524#M25495</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-06-03T15:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a refresh token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-a-refresh-token/m-p/524554#M25502</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Yeah my problem was that I did not specify the line correctly in crontab, I had to source my profile file in order for the env vars to be seen by the cron job. Thanks a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You said that long lived tokens are deprecated, does that mean it won't be available soon?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;p.s - you have a bug here in the forums, each time I refresh the page it adds +1 to the views count of the message &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@FBF7D2AB59A0D6E861EBF6A36F93B7E2/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jun 2021 17:32:04 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-a-refresh-token/m-p/524554#M25502</guid>
      <dc:creator>oen124</dc:creator>
      <dc:date>2021-06-03T17:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a refresh token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-a-refresh-token/m-p/524556#M25503</link>
      <description>&lt;P&gt;Long-lived access tokens are now considered deprecated, but 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).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note though that after the change you won't be able to create new long-lived access tokens.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jun 2021 17:42:01 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-a-refresh-token/m-p/524556#M25503</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-06-03T17:42:01Z</dc:date>
    </item>
  </channel>
</rss>

