<?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: in Java how do I read the files located in a shared folder? in Discuss Dropbox Developer &amp; API</title>
    <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626202#M2911</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1578399"&gt;@novotny&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;ListFolderResult result &lt;/SPAN&gt;= &lt;SPAN&gt;client&lt;/SPAN&gt;.files().listFolder(&lt;SPAN&gt;""&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;And see the folders in my own home directory. However, my partner shared a folder with me that I wish to see the files in but I don't see it listed. ...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1578399"&gt;@novotny&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You have pointed your account's home only, as a member, in the account (the string "" &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;). If the shared folder appear there as a subfolder (let say named "SharedThings"), you need to put this name (properly formatted) as a parameter (i.e. "/SharedThings", not empty string). You might need to set recursive enumeration if the shared folder contains subfolder and you need to enumerate all of them in one cycle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1578399"&gt;@novotny&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;... That prompted me to update the team scope permissions in my dropbox app (Is that needed here?). Once I did that I went down another rabbit hole where I could no longer get my authorization code from the link provided in the AuthorizeExample as I needed admin access based on adding these extra permissions. ...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;"Is that needed here?" &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; Good question! If the shared folder is in your home (as a subfolder there), you definitely don't need to make your life complicated. Otherwise you need it. You have&amp;nbsp; to set your id as a user and the space (team folder) where your target folder reside in (aside of exact path - properly formatted).&lt;/P&gt;&lt;P&gt;Hope this gives direction.&lt;/P&gt;</description>
    <pubDate>Fri, 30 Sep 2022 14:53:35 GMT</pubDate>
    <dc:creator>Здравко</dc:creator>
    <dc:date>2022-09-30T14:53:35Z</dc:date>
    <item>
      <title>backend Java process to read a shared folder</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626162#M2909</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We need a java workflow to scan the contents of a shared folder on a daily basis. I have downloaded the examples and looked at AuthorizeExample which I ran with the parameters "test.app test.auth short_live_token". This code appears to requires clicking a dropbox link&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dropbox.com/oauth2/authorize?token_access_type=offline&amp;amp;response_type=code&amp;amp;client_id=XXXXX" target="_blank" rel="noopener"&gt;https://www.dropbox.com/oauth2/authorize?token_access_type=offline&amp;amp;response_type=code&amp;amp;client_id=XXXXX&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to get an authorization code which is then used to generate a token and then the token can be used to list files in a folder. How can this all be done on the backend without human intervention? Are there any examples I can look at? With AWS S3 it's easily done with an access key and a secret key, I was hoping it would be similar.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks, Jason&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 13:25:20 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626162#M2909</guid>
      <dc:creator>novotny</dc:creator>
      <dc:date>2022-09-30T13:25:20Z</dc:date>
    </item>
    <item>
      <title>in Java how do I read the files located in a shared folder?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626190#M2910</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks to the Java TutorialExample, I am able to execute&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;ListFolderResult result &lt;/SPAN&gt;= &lt;SPAN&gt;client&lt;/SPAN&gt;.files().listFolder(&lt;SPAN&gt;""&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;And see the folders in my own home directory. However, my partner shared a folder with me that I wish to see the files in but I don't see it listed. That prompted me to update the team scope permissions in my dropbox app (Is that needed here?). Once I did that I went down another rabbit hole where I could no longer get my authorization code from the link provided in the AuthorizeExample as I needed admin access based on adding these extra permissions. After my partner modified me to be an admin, I was able to get an updated access token and now when I try to do the following:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;ListSharedLinksResult res &lt;/SPAN&gt;= &lt;SPAN&gt;client&lt;/SPAN&gt;.sharing().listSharedLinks();&lt;/PRE&gt;&lt;P&gt;I get an error&lt;/P&gt;&lt;P&gt;com.dropbox.core.BadRequestException: Error in call to API function "sharing/list_shared_links": This API function operates on a single Dropbox account, but the OAuth 2 access token you provided is for an entire Dropbox Business team. Since your API app key has team member file access permissions, you can operate on a team member's Dropbox by providing the "Dropbox-API-Select-User" HTTP header or "select_user" URL parameter to specify the exact user&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I on the right path?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Really, all I want to do is to be able to read the files from a shared folder. Any code snippets would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, Jason&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 14:26:12 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626190#M2910</guid>
      <dc:creator>novotny</dc:creator>
      <dc:date>2022-09-30T14:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: in Java how do I read the files located in a shared folder?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626202#M2911</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1578399"&gt;@novotny&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;ListFolderResult result &lt;/SPAN&gt;= &lt;SPAN&gt;client&lt;/SPAN&gt;.files().listFolder(&lt;SPAN&gt;""&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;And see the folders in my own home directory. However, my partner shared a folder with me that I wish to see the files in but I don't see it listed. ...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1578399"&gt;@novotny&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You have pointed your account's home only, as a member, in the account (the string "" &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;). If the shared folder appear there as a subfolder (let say named "SharedThings"), you need to put this name (properly formatted) as a parameter (i.e. "/SharedThings", not empty string). You might need to set recursive enumeration if the shared folder contains subfolder and you need to enumerate all of them in one cycle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1578399"&gt;@novotny&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;... That prompted me to update the team scope permissions in my dropbox app (Is that needed here?). Once I did that I went down another rabbit hole where I could no longer get my authorization code from the link provided in the AuthorizeExample as I needed admin access based on adding these extra permissions. ...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;"Is that needed here?" &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; Good question! If the shared folder is in your home (as a subfolder there), you definitely don't need to make your life complicated. Otherwise you need it. You have&amp;nbsp; to set your id as a user and the space (team folder) where your target folder reside in (aside of exact path - properly formatted).&lt;/P&gt;&lt;P&gt;Hope this gives direction.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 14:53:35 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626202#M2911</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-09-30T14:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: in Java how do I read the files located in a shared folder?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626205#M2912</link>
      <description>&lt;P&gt;Thanks for the information. Below is a screenshot&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-09-30 at 4.55.47 PM.png" style="width: 800px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/32066i84C6B31D8AD94374/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-09-30 at 4.55.47 PM.png" alt="Screenshot 2022-09-30 at 4.55.47 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The existing code:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;ListFolderResult result &lt;/SPAN&gt;= &lt;SPAN&gt;client&lt;/SPAN&gt;.files().listFolder(&lt;SPAN&gt;""&lt;/SPAN&gt;);&lt;BR /&gt;    &lt;SPAN&gt;while &lt;/SPAN&gt;(&lt;SPAN&gt;true&lt;/SPAN&gt;) {&lt;BR /&gt;        &lt;SPAN&gt;for &lt;/SPAN&gt;(&lt;SPAN&gt;Metadata metadata &lt;/SPAN&gt;: &lt;SPAN&gt;result&lt;/SPAN&gt;.getEntries()) {&lt;BR /&gt;            &lt;SPAN&gt;System&lt;/SPAN&gt;.&lt;SPAN&gt;out&lt;/SPAN&gt;.println(&lt;SPAN&gt;metadata&lt;/SPAN&gt;.getName());&lt;BR /&gt;        }&lt;BR /&gt;&lt;BR /&gt;        &lt;SPAN&gt;if &lt;/SPAN&gt;(!&lt;SPAN&gt;result&lt;/SPAN&gt;.getHasMore()) {&lt;BR /&gt;            &lt;SPAN&gt;break&lt;/SPAN&gt;;&lt;BR /&gt;        }&lt;BR /&gt;&lt;BR /&gt;        &lt;SPAN&gt;result &lt;/SPAN&gt;= &lt;SPAN&gt;client&lt;/SPAN&gt;.files().listFolderContinue(&lt;SPAN&gt;result&lt;/SPAN&gt;.getCursor());&lt;BR /&gt;    &lt;/PRE&gt;&lt;P&gt;will write:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jason Novotny&lt;BR /&gt;MPS&lt;BR /&gt;JasonNovotnyFingage&lt;BR /&gt;jason.novotny@fingage.com’s files&lt;BR /&gt;Get Started with Dropbox.pdf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I wish to get access to the folder "AffinityInvestment". Can you please help me with the steps I need to do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In particular how do I "set your id as a user and the space (team folder) where your target folder reside in (aside of exact path - properly formatted)." do this in Java?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, Jason&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 15:00:51 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626205#M2912</guid>
      <dc:creator>novotny</dc:creator>
      <dc:date>2022-09-30T15:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: in Java how do I read the files located in a shared folder?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626213#M2913</link>
      <description>&lt;P&gt;Bad "news" - your folder is out of your home. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@EA4D5AD6084EAC95CB4E739348E74CC6/emoticons/1f615.png" alt=":confused_face:" title=":confused_face:" /&gt; You need to use team features.&lt;/P&gt;&lt;P&gt;First make sure you have selected yourself in the client object using &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/main/dropbox-sdk-java/src/main/java/com/dropbox/core/v2/DbxTeamClientV2.java#L139" target="_blank" rel="noopener"&gt;asMember&lt;/A&gt;. Next select proper root (your team folder) using &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/main/dropbox-sdk-java/src/main/java/com/dropbox/core/v2/DbxClientV2.java#L136" target="_blank" rel="noopener"&gt;withPathRoot&lt;/A&gt;. Next you can list it using empty string (the folder appears to be the root, not a subfloder there). For more basic info take a look &lt;A title="DBX Team Files Guide" href="https://developers.dropbox.com/dbx-team-files-guide" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 15:13:26 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626213#M2913</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-09-30T15:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: backend Java process to read a shared folder</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626221#M2914</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1578399"&gt;@novotny&lt;/a&gt; Regarding your initial authorization question, it is not possible to fully automate the OAuth process where the user chooses to authorize the app and the app then receives the resulting access token and optional refresh token. This needs to be done manually by the user at least once. If your app needs to maintain long-term access without the user manually re-authorizing it repeatedly, the app should request "offline" access so that it gets a refresh token. The refresh token doesn't expire and can be stored and used repeatedly to get new short-lived access tokens whenever needed, without the user manually reauthorizing the app. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Java SDK can actually handle the refresh process for you automatically, as long as you supply the necessary credentials, e.g., as shown retrieved in &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/main/examples/examples/src/main/java/com/dropbox/core/examples/authorize/AuthorizeExample.kt" target="_self" rel="noreferrer"&gt;this example&lt;/A&gt; (meant for server-side Java apps), or &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/main/examples/examples/src/main/java/com/dropbox/core/examples/authorize/PkceAuthorize.java" target="_self" rel="noreferrer"&gt;this example&lt;/A&gt; (meant for client-side Java apps), and then used as shown in &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/main/examples/examples/src/main/java/com/dropbox/core/examples/account_info/AccountInfoExample.kt" target="_self" rel="noreferrer"&gt;this example&lt;/A&gt;. (For Android, see &lt;A href="https://github.com/dropbox/dropbox-sdk-java/tree/main/examples/android" rel="noopener noreferrer" target="_blank"&gt;this example&lt;/A&gt; instead.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And as Здравко noted, to access that "AffinityInvestment" folder, which is in your "team space", you should use &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/main/dropbox-sdk-java/src/main/java/com/dropbox/core/v2/DbxClientV2.java#L136" target="_blank" rel="noopener nofollow noreferrer"&gt;withPathRoot&lt;/A&gt;, to set the "Dropbox-API-Path-Root" header as covered in &lt;A href="https://developers.dropbox.com/dbx-team-files-guide" target="_blank"&gt;the Team Files Guide&lt;/A&gt;. Note that you don't actually need any team scopes (be an admin) and use asMember to do that. Using listFolder/listFolderContinue, whether using &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/main/dropbox-sdk-java/src/main/java/com/dropbox/core/v2/DbxClientV2.java#L136" target="_blank" rel="noopener nofollow noreferrer"&gt;withPathRoot&lt;/A&gt; or not, just requires the "files.metadata.read" scope.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 15:42:29 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626221#M2914</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-09-30T15:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: backend Java process to read a shared folder</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626234#M2915</link>
      <description>&lt;P&gt;Thanks, I am getting a little farther.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding authorization, let me describe what I am doing:&lt;/P&gt;&lt;P&gt;1. I executed the Authorize example you pointed me to with the parameters "test.app test.auth short_live_token" such that my test.app contains my appKey and secretKey. It then produces the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Go to &lt;A href="https://www.dropbox.com/oauth2/authorize?token_access_type=offline&amp;amp;response_type=code&amp;amp;client_id=XYZ" target="_blank" rel="noopener"&gt;https://www.dropbox.com/oauth2/authorize?token_access_type=offline&amp;amp;response_type=code&amp;amp;client_id=XYZ&lt;/A&gt;&lt;BR /&gt;2. Click "Allow" (you might have to log in first).&lt;BR /&gt;3. Copy the authorization code.&lt;BR /&gt;Enter the authorization code here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After step 1, I get my code and enter it. It now displays:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Authorization complete.&lt;BR /&gt;- User ID:&lt;BR /&gt;- Account ID: null&lt;BR /&gt;- Access Token: &amp;lt;&lt;STRONG&gt;ACCESS_TOKEN&amp;gt;&lt;/STRONG&gt;&lt;BR /&gt;- Expires At: 1664569280436&lt;BR /&gt;- Refresh Token: &lt;STRONG&gt;&amp;lt;REFRESH_TOKEN&amp;gt;&lt;/STRONG&gt;&lt;BR /&gt;- Scope: account_info.read contacts.read file_requests.read files.metadata.read members.read sharing.read team_data.content.read team_data.content.write team_data.governance.read team_data.governance.write team_data.member team_data.team_space team_info.read&lt;BR /&gt;Saved authorization information to "/Users/novotny/IdeaProjects/dropbox-sdk-java/test.auth"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. In my own code I hardcode the values I received from the example and create a credential object which allows me to create a client&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;DbxCredential dbxCredential &lt;/SPAN&gt;= &lt;SPAN&gt;new &lt;/SPAN&gt;DbxCredential(&lt;SPAN&gt;ACCESS_TOKEN&lt;/SPAN&gt;, &lt;SPAN&gt;EXPIRES_AT&lt;/SPAN&gt;, &lt;SPAN&gt;REFRESH_TOKEN&lt;/SPAN&gt;, &lt;SPAN&gt;APP_KEY&lt;/SPAN&gt;, &lt;SPAN&gt;APP_SECRET&lt;/SPAN&gt;);&lt;BR /&gt;&lt;SPAN&gt;DbxTeamClientV2 teamClientV2 &lt;/SPAN&gt;= &lt;SPAN&gt;new &lt;/SPAN&gt;DbxTeamClientV2(&lt;SPAN&gt;config&lt;/SPAN&gt;, &lt;SPAN&gt;dbxCredential&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;But now what? I see there is a refreshAccessToken API available, is this something that my backend process should execute once per day?&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;try &lt;/SPAN&gt;{&lt;BR /&gt;    &lt;SPAN&gt;DbxRefreshResult result &lt;/SPAN&gt;= &lt;SPAN&gt;client&lt;/SPAN&gt;.refreshAccessToken();&lt;BR /&gt;    &lt;SPAN&gt;System&lt;/SPAN&gt;.&lt;SPAN&gt;err&lt;/SPAN&gt;.println(&lt;SPAN&gt;result&lt;/SPAN&gt;);&lt;BR /&gt;} &lt;SPAN&gt;catch &lt;/SPAN&gt;(&lt;SPAN&gt;DbxException &lt;/SPAN&gt;e) {&lt;BR /&gt;    &lt;SPAN&gt;throw new &lt;/SPAN&gt;RuntimeException(e);&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;Thanks, Jason&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 16:35:18 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626234#M2915</guid>
      <dc:creator>novotny</dc:creator>
      <dc:date>2022-09-30T16:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: backend Java process to read a shared folder</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626237#M2916</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1578399"&gt;@novotny&lt;/a&gt; You can call refreshAccessToken if you want, but that is actually not necessary. The client will automatically handle this procedure for you whenever needed. (That is, it will automatically perform the refresh to get and use a new short-lived access token when the current one is expired, without you having to call any other methods yourself.)&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 16:40:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626237#M2916</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-09-30T16:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: backend Java process to read a shared folder</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626239#M2917</link>
      <description>&lt;P&gt;Ok thanks, so the code I have should work fine? However what happens when the app restarts and the original hardcoded credentials have expired already? (Since the EXPIRES_AT has been hardcoded) Will that still work?&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 16:43:57 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626239#M2917</guid>
      <dc:creator>novotny</dc:creator>
      <dc:date>2022-09-30T16:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: backend Java process to read a shared folder</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626241#M2918</link>
      <description>&lt;P&gt;It's related to access token only! Refresh token doesn't expire. &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;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 16:45:44 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626241#M2918</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-09-30T16:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: backend Java process to read a shared folder</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626244#M2919</link>
      <description>&lt;P&gt;Let me make this clearer with code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;public &lt;/SPAN&gt;&lt;SPAN&gt;DbxClientV2 &lt;/SPAN&gt;&lt;SPAN&gt;createClient&lt;/SPAN&gt;() &lt;SPAN&gt;throws &lt;/SPAN&gt;&lt;SPAN&gt;DbxException &lt;/SPAN&gt;{&lt;BR /&gt;    &lt;SPAN&gt;DbxRequestConfig config &lt;/SPAN&gt;= &lt;SPAN&gt;DbxRequestConfig&lt;/SPAN&gt;.&lt;SPAN&gt;newBuilder&lt;/SPAN&gt;(&lt;SPAN&gt;"fingage"&lt;/SPAN&gt;).build();&lt;BR /&gt;    &lt;SPAN&gt;DbxCredential dbxCredential &lt;/SPAN&gt;= &lt;SPAN&gt;new &lt;/SPAN&gt;DbxCredential(&lt;SPAN&gt;ACCESS_TOKEN&lt;/SPAN&gt;, &lt;SPAN&gt;EXPIRES_AT&lt;/SPAN&gt;, &lt;SPAN&gt;REFRESH_TOKEN&lt;/SPAN&gt;, &lt;SPAN&gt;APP_KEY&lt;/SPAN&gt;, &lt;SPAN&gt;APP_SECRET&lt;/SPAN&gt;);&lt;BR /&gt;    &lt;SPAN&gt;DbxTeamClientV2 teamClientV2 &lt;/SPAN&gt;= &lt;SPAN&gt;new &lt;/SPAN&gt;DbxTeamClientV2(&lt;SPAN&gt;config&lt;/SPAN&gt;, &lt;SPAN&gt;dbxCredential&lt;/SPAN&gt;);&lt;BR /&gt;    &lt;SPAN&gt;PathRoot pathRoot &lt;/SPAN&gt;= &lt;SPAN&gt;PathRoot&lt;/SPAN&gt;.&lt;SPAN&gt;namespaceId&lt;/SPAN&gt;(&lt;SPAN&gt;"3103421521"&lt;/SPAN&gt;);&lt;BR /&gt;    &lt;SPAN&gt;return &lt;/SPAN&gt;&lt;SPAN&gt;teamClientV2&lt;/SPAN&gt;.asMember(&lt;SPAN&gt;"dbmid:AACV-hRckJZMB5ja-BpNuhN0PRjZod6__94"&lt;/SPAN&gt;).withPathRoot(&lt;SPAN&gt;pathRoot&lt;/SPAN&gt;);&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;It appears this code will work in creating DbxCredential since the EXPIRES_AT is in the future. However if I run this code in a few days, will it still work? Is it the case that if the supplied expiresAt is in the past will it still be able to refresh the credential? Or can I just provide a value for expiresAt that is far into the future?&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 16:55:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626244#M2919</guid>
      <dc:creator>novotny</dc:creator>
      <dc:date>2022-09-30T16:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: backend Java process to read a shared folder</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626245#M2920</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1578399"&gt;@novotny&lt;/a&gt; Yes, the expiration is only about the access token. The refresh token doesn't expire (though can be revoked on demand). If the expiration has passed, the client will use the refresh token to get a new access token automatically.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 16:56:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626245#M2920</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-09-30T16:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: backend Java process to read a shared folder</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626248#M2921</link>
      <description>&lt;P&gt;Something more: don't try change 'expireAt'. Your code will fail!!! There are ways to optimize your code but you need to keep entire credentials object and serialize and deserialize it. Don't change anything by hands there.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 16:59:18 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626248#M2921</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-09-30T16:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: backend Java process to read a shared folder</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626252#M2922</link>
      <description>&lt;P&gt;Ok so just to confirm even if the hardcoded credential I pass in to create DBTeamClientV2 has expired already (i.e. I run this code next week), it will simply use the refresh token to obtain a new one and everything should work.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 17:17:44 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626252#M2922</guid>
      <dc:creator>novotny</dc:creator>
      <dc:date>2022-09-30T17:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: backend Java process to read a shared folder</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626254#M2923</link>
      <description>&lt;P&gt;Yes... &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>Fri, 30 Sep 2022 17:22:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/backend-Java-process-to-read-a-shared-folder/m-p/626254#M2923</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-09-30T17:22:13Z</dc:date>
    </item>
  </channel>
</rss>

