You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

maxior1234's avatar
maxior1234
Explorer | Level 3
3 years ago

/list_folder/get_latest_cursor -> shared_link

Hello, I noticed that for get_latest_cursor you can add a shared_link parameter. If I understand the documentation correctly, this parameter allows you to get the cursor for a file whose name is contained in the url. However, I have a problem with creating json with parameters in which there is a shared_link parameter. How such json should look like? is this right?

{

"path": "/ SZOtestowe",

"shared_link": {"url": "https://www.dropbox.com/s/t7a0cbikc4s318i/orze%C5%82-2.jpg?dl=0", "password": ""}

}

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    I see you're referring to using the /2/files/list_folder/get_latest_cursor endpoint. That endpoint allows you to get a cursor for listing a folder. That allows you to specify either a path in the connected account, or a shared link for a folder and optionally a path relative to that folder.

     

    The structure of your JSON looks fine for the latter case, but I do see two issues with the values:

    • your shared link appears to be for a file, not a folder; this endpoint is for listing the contents of folders, so supplying a shared link for a file won't work
    • you have an empty "password" field; I don't know if you just redacted it for the sake of posting this, but if there isn't a password for the shared link, you don't need to set the "password" field at all

    By the way, the API v2 Explorer can helpful for constructing and testing calls like this. Click the "Show Code" button to see the constructed code.

    • maxior1234's avatar
      maxior1234
      Explorer | Level 3

      I would need a cursor to be able to get the next files in the folder. For example, I have downloaded information (file name, etc.) about some of the files in the Dropbox folder. Information about files is downloaded to a file named x.jpg. I miss the cursor value. How can I get information about the next files in the Dropbox folder, but not from the beginning?

       
       

       

       

      • Здравко's avatar
        Здравко
        Legendary | Level 20

        Hi maxior1234,

        As far as you are correctly describing what you want, it's a cursor actually. As I mentioned cursor describe current enumeration state, nothing else. If the added files (past the last cursor) are not too much, you can add them to your sheet by hand and use the /2/files/list_folder/get_latest_cursor call (applied to containing folder, not to a file) to get the actual (latest in this case) cursor and continue further. Otherwise you have to start listing from beginning. To avoid such "incidents", review why you have lost your cursor and take measures (if changes in the file is the reason, keep/backup the cursor in alternative file for instance - don't rely on insecure storage).

        Good luck.


  • maxior1234 wrote:

    ... If I understand the documentation correctly, this parameter allows you to get the cursor for a file whose name is contained in the url. ...


    Hi maxior1234,

    No, 🙂 You don't understand correctly. Such cursors, received from wherever (including from /2/files/list_folder/get_latest_cursor), target to a folder, not a file!!! They represent current enumeration state. How you "understand" particular single file enumeration (file pointed by a link in your case)? 😉

    The "path" here means a subfolder path within a folder tree pointed by a provided link eventually (when your target is not the entire tree, but some subpart). A file can't have a subfolder, as it, by self, is not a folder!

    Hope this clarifies matter.

    • maxior1234's avatar
      maxior1234
      Explorer | Level 3

      I have an automation that gets information about newly added files to a Google sheet. The current cursor Dropbox is also saved in the sheet. The problem arises when the automation somehow loses its cursor. Then I get the information about the files from the beginning into cursor. I would like to improve it. Is it possible to read from Dropbox cursor from a specific position? For example, in sheet, I have a file name and a link to this file. Can I get a cursor on the basis of this information, thanks to which I will be able to retrieve information about subsequent files?

       
       

       

       

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 12 months ago
325 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!