<?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 can I automate retrieval of a refresh token using the Python API? in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-automate-retrieval-of-a-refresh-token-using-the-Python/m-p/705146#M31377</link>
    <description>&lt;P&gt;Here is what I see:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-08-09 121746.png" style="width: 800px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/39642i76B764B5B52B7AE9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-08-09 121746.png" alt="Screenshot 2023-08-09 121746.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the useful links!&lt;/P&gt;</description>
    <pubDate>Wed, 09 Aug 2023 17:20:02 GMT</pubDate>
    <dc:creator>igor-plotnikov</dc:creator>
    <dc:date>2023-08-09T17:20:02Z</dc:date>
    <item>
      <title>How can I automate retrieval of a refresh token using the Python API?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-automate-retrieval-of-a-refresh-token-using-the-Python/m-p/592434#M27542</link>
      <description>&lt;P&gt;I have a Python app that is intended to run as a scheduled job to save files to Dropbox at regular intervals.&amp;nbsp; When I have a refresh token, this works fine:&lt;BR /&gt;&lt;BR /&gt;dbx = dropbox.Dropbox(app_key='xxx', app_secret='yyy', oauth2_refresh_token='zzz')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But of course, the token only lasts for four hours. Every example I've found (&lt;A href="https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Oauth2-refresh-token-question-what-happens-when-the-refresh/td-p/486241" target="_blank" rel="noopener"&gt;here&lt;/A&gt; and &lt;A href="https://stackoverflow.com/questions/70641660/how-do-you-get-and-use-a-refresh-token-for-the-dropbox-api-python-3-x?noredirect=1&amp;amp;lq=1" target="_blank" rel="noopener"&gt;here&lt;/A&gt;) all lead to answers that require a manual login to retrieve a refresh token. That will not help me to automate this job.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What can I do to get some sort of "long running" token or to be able to automatically generate refresh tokens without having to log in manually?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 12:49:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-automate-retrieval-of-a-refresh-token-using-the-Python/m-p/592434#M27542</guid>
      <dc:creator>jgriffo1</dc:creator>
      <dc:date>2022-04-26T12:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: How can I automate retrieval of a refresh token using the Python API?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-automate-retrieval-of-a-refresh-token-using-the-Python/m-p/592449#M27545</link>
      <description>&lt;P&gt;[Cross-linking for reference: &lt;A href="https://stackoverflow.com/questions/71955472/how-do-i-automate-retrieval-of-a-refresh-token-using-the-dropbox-python-3-x-api" target="_blank"&gt;https://stackoverflow.com/questions/71955472/how-do-i-automate-retrieval-of-a-refresh-token-using-the-dropbox-python-3-x-api&lt;/A&gt; ]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dropbox API refresh tokens &lt;EM&gt;do not&lt;/EM&gt; expire after four hours. They can be revoked on demand, but they do not expire automatically, and can be stored and re-used repeatedly. (The short-lived access tokens themselves do expire, but the refresh token can be used to get new short-lived access tokens whenever needed. The official Dropbox SDKs will do that process for you automatically.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, while you do need to manually process the app authorization flow once to get a refresh token, once you have it, you can store and re-use it for long-term access without further manual interaction.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 14:05:28 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-automate-retrieval-of-a-refresh-token-using-the-Python/m-p/592449#M27545</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-04-21T14:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I automate retrieval of a refresh token using the Python API?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-automate-retrieval-of-a-refresh-token-using-the-Python/m-p/592474#M27548</link>
      <description>&lt;P&gt;Thank you for your response.&amp;nbsp; I think my confusion came from the JSON that had an expiry field on it:&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;"access_token": "www",&lt;BR /&gt;"token_type": "bearer",&lt;BR /&gt;&lt;STRONG&gt;"expires_in": 14400,&lt;/STRONG&gt;&lt;BR /&gt;"refresh_token": "xxx",&lt;BR /&gt;"scope": "account_info.read files.content.write files.metadata.read files.metadata.write",&lt;BR /&gt;"uid": "yyy",&lt;BR /&gt;"account_id": "zzz"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 16:07:47 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-automate-retrieval-of-a-refresh-token-using-the-Python/m-p/592474#M27548</guid>
      <dc:creator>jgriffo1</dc:creator>
      <dc:date>2022-04-21T16:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I automate retrieval of a refresh token using the Python API?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-automate-retrieval-of-a-refresh-token-using-the-Python/m-p/592501#M27553</link>
      <description>&lt;P&gt;I see, thanks for the context. That expiration only applies to the access token. You can find more information on each field in &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#oauth2-token" target="_self"&gt;the documentation here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 17:54:38 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-automate-retrieval-of-a-refresh-token-using-the-Python/m-p/592501#M27553</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-04-21T17:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I automate retrieval of a refresh token using the Python API?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-automate-retrieval-of-a-refresh-token-using-the-Python/m-p/705120#M31374</link>
      <description>&lt;P&gt;The page you referenced here won't open. Could you please share the snippet of how to get an access token having a refresh token and using the official Python SDK?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 15:53:38 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-automate-retrieval-of-a-refresh-token-using-the-Python/m-p/705120#M31374</guid>
      <dc:creator>igor-plotnikov</dc:creator>
      <dc:date>2023-08-09T15:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I automate retrieval of a refresh token using the Python API?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-automate-retrieval-of-a-refresh-token-using-the-Python/m-p/705135#M31376</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1734401"&gt;@igor-plotnikov&lt;/a&gt; Can you clarify what you mean when you say the page won't open? Are you getting some error? That link is working for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In any case, for &lt;A href="https://github.com/dropbox/dropbox-sdk-python" rel="noopener noreferrer" target="_blank"&gt;the official Dropbox Python SDK&lt;/A&gt;, you can find examples of getting and using a refresh token at the following links:&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL dir="auto"&gt;
&lt;LI&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-python/blob/main/example/oauth/commandline-oauth-scopes.py" rel="noopener noreferrer" target="_blank"&gt;https://github.com/dropbox/dropbox-sdk-python/blob/main/example/oauth/commandline-oauth-scopes.py&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-python/blob/main/example/oauth/commandline-oauth-pkce.py" rel="noopener noreferrer" target="_blank"&gt;https://github.com/dropbox/dropbox-sdk-python/blob/main/example/oauth/commandline-oauth-pkce.py&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 09 Aug 2023 16:56:00 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-automate-retrieval-of-a-refresh-token-using-the-Python/m-p/705135#M31376</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2023-08-09T16:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can I automate retrieval of a refresh token using the Python API?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-automate-retrieval-of-a-refresh-token-using-the-Python/m-p/705146#M31377</link>
      <description>&lt;P&gt;Here is what I see:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-08-09 121746.png" style="width: 800px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/39642i76B764B5B52B7AE9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-08-09 121746.png" alt="Screenshot 2023-08-09 121746.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the useful links!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 17:20:02 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-can-I-automate-retrieval-of-a-refresh-token-using-the-Python/m-p/705146#M31377</guid>
      <dc:creator>igor-plotnikov</dc:creator>
      <dc:date>2023-08-09T17:20:02Z</dc:date>
    </item>
  </channel>
</rss>

