<?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: Generating Refresh Token using example code in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generating-Refresh-Token-using-example-code/m-p/599392#M27837</link>
    <description>&lt;P&gt;Hi Greg,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see! I have now run the file from the command line and output "successfully set up client!"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the next step to actually generating a refresh token?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Laura&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 May 2022 08:20:39 GMT</pubDate>
    <dc:creator>lsteel11</dc:creator>
    <dc:date>2022-05-25T08:20:39Z</dc:date>
    <item>
      <title>Generating Refresh Token using example code</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generating-Refresh-Token-using-example-code/m-p/599247#M27827</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to generate a refresh token following the example code (&lt;A href="https://github.com/dropbox/dropbox-sdk-python/blob/main/example/oauth/commandline-oauth-pkce.py" target="_blank" rel="noopener"&gt;https://github.com/dropbox/dropbox-sdk-python/blob/main/example/oauth/commandline-oauth-pkce.py&lt;/A&gt;) (but with my app key etc).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am able to successfully implement it up until line 19. When I run the next section python just shuts down. Any help would be much appreciated! Thank you!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Laura&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 05:14:32 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generating-Refresh-Token-using-example-code/m-p/599247#M27827</guid>
      <dc:creator>lsteel11</dc:creator>
      <dc:date>2022-05-25T05:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Refresh Token using example code</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generating-Refresh-Token-using-example-code/m-p/599259#M27828</link>
      <description>&lt;P&gt;Can you elaborate on what you mean when you say "python just shuts down"? Is there any error/output?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After line 19, you should either get an error printed via line 22, or execution should continue and perform the users_get_current_account call (though this minimal example doesn't actually do anything with the result) and then print &lt;SPAN class="pl-s"&gt;"Successfully set up client!&lt;/SPAN&gt;".&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 17:20:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generating-Refresh-Token-using-example-code/m-p/599259#M27828</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-05-24T17:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Refresh Token using example code</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generating-Refresh-Token-using-example-code/m-p/599310#M27835</link>
      <description>&lt;P&gt;Hi Greg,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your response. I have taken a screenshot (below). When I click return at this point (so that I can then run the next section of code) the python window closes immediately. I presume this is something to do with the exit(1) command? Many thanks.&amp;nbsp;&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="python..png" style="width: 800px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/29483i88FC02494EA2039B/image-size/large?v=v2&amp;amp;px=999" role="button" title="python..png" alt="python..png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 20:53:05 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generating-Refresh-Token-using-example-code/m-p/599310#M27835</guid>
      <dc:creator>lsteel11</dc:creator>
      <dc:date>2022-05-24T20:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Refresh Token using example code</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generating-Refresh-Token-using-example-code/m-p/599318#M27836</link>
      <description>&lt;P&gt;It looks like you're running your python3.10.exe directly, and the window is closing automatically when the program completes (such as from the exit call, as you mentioned). I can't really offer support for your development environment itself as that's not made by Dropbox, but there are other ways to set this up so that you get to see the output even once execution completes, e.g., you may want to save the code as a file and run that from the command line.&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 21:10:41 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generating-Refresh-Token-using-example-code/m-p/599318#M27836</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-05-24T21:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Refresh Token using example code</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generating-Refresh-Token-using-example-code/m-p/599392#M27837</link>
      <description>&lt;P&gt;Hi Greg,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see! I have now run the file from the command line and output "successfully set up client!"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the next step to actually generating a refresh token?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Laura&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 08:20:39 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generating-Refresh-Token-using-example-code/m-p/599392#M27837</guid>
      <dc:creator>lsteel11</dc:creator>
      <dc:date>2022-05-25T08:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Refresh Token using example code</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generating-Refresh-Token-using-example-code/m-p/599427#M27838</link>
      <description>&lt;P&gt;If you've reached &lt;SPAN class="pl-s"&gt;"Successfully set up client!"&lt;/SPAN&gt; in that sample, you've already successfully processed the app authorization flow and retrieved a refresh token. The refresh token is in '&lt;SPAN class="pl-s1"&gt;oauth_result&lt;/SPAN&gt;.&lt;SPAN class="pl-s1"&gt;refresh_token&lt;/SPAN&gt;' in that sample, e.g., as used in &lt;A href="https://github.com/dropbox/dropbox-sdk-python/blob/main/example/oauth/commandline-oauth-pkce.py#L25" target="_self"&gt;line 25&lt;/A&gt;. For your actual app, you can store and re-use that.&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 12:34:51 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generating-Refresh-Token-using-example-code/m-p/599427#M27838</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-05-25T12:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Refresh Token using example code</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generating-Refresh-Token-using-example-code/m-p/599466#M27842</link>
      <description>&lt;P&gt;Hi Greg,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry - still having trouble. I have retrieved (what I think is) the refresh token - I added "print (oauth_result.refresh_token) to the end of the script and ran it from the command line etc, and it output what looked like a token.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I put this token in the NodeRed dropbox node, it says that the access token is invalid.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you had any further thoughts on this it would be much appreciated.&amp;nbsp;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 14:51:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generating-Refresh-Token-using-example-code/m-p/599466#M27842</guid>
      <dc:creator>lsteel11</dc:creator>
      <dc:date>2022-05-25T14:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Refresh Token using example code</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generating-Refresh-Token-using-example-code/m-p/599486#M27844</link>
      <description>&lt;P&gt;Refresh tokens and access tokens are not interchangeable. Refresh tokens cannot be used as access tokens. Refresh tokens are instead used to programmatically retrieve new short-lived access tokens whenever needed (without manual user interaction).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The official Dropbox SDKs will do that for you automatically, e.g., if you create the client as shown in &lt;A href="https://github.com/dropbox/dropbox-sdk-python/blob/main/example/oauth/commandline-oauth-pkce.py#L25" target="_self"&gt;line 25 of the example&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't provide support for "the NodeRed dropbox node" as that's not made by Dropbox though, so you may need to refer to the documentation or support resources for that for information on configuring that.&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 15:47:50 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Generating-Refresh-Token-using-example-code/m-p/599486#M27844</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-05-25T15:47:50Z</dc:date>
    </item>
  </channel>
</rss>

