cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Whether you are transferring a single drive, a team or an entire organization, Movebot's cloud migration tool has been built to make your Dropbox migration simple - learn all about it here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get List of files

Get List of files

adolfochairez
Explorer | Level 3

I am using the DropBox API to retrieve the list of files in my account.
But it returns the following:

{"file_requests": [], "cursor": "AADerDxM8V_QQRJQgZRYpGTqYBnD8wSl2InNNU0QJnXZgPapKCqPSJIurqgKVUSCSeixo2HSYVRqM-KAs_FrYmeJ8XPOe67op6xH95mDljNf56FIcs-jD1XDYjHi1ARHhAbS6G89E7ir_BrHZIF5rwZIY94cKTR6yMSio1VLx5eqLg", "has_more": false}

This despite having multiple files.

This is the code (I'm using PowerBuilder 2019 R2):

Codigo.jpg

Thanks in advacne

1 Accepted Solution

Accepted Solutions

Re: Get List of files

Greg-DB
Dropboxer

The /2/file_requests/list_v2 endpoint is for listing 'file requests', not actual files. (A "file request" is a way to receive files from other people.)

 

To list files, you should instead use /2/files/list_folder[/continue].

View solution in original post

4 Replies 4

Re: Get List of files

Greg-DB
Dropboxer

The /2/file_requests/list_v2 endpoint is for listing 'file requests', not actual files. (A "file request" is a way to receive files from other people.)

 

To list files, you should instead use /2/files/list_folder[/continue].

Re: Get List of files

adolfochairez
Explorer | Level 3

Maybe I didn't explain myself, I'm trying to retrieve all the file list from my account.
It changes to the instruction files/list_folder but it marks the following error:

Error in call to API function "files/list_folder": This function requires its argument in the HTTP request body, but your request body is empty.

Error2.jpg

Re: Get List of files

Greg-DB
Dropboxer

Yes, using /2/files/list_folder[/continue] is the right way to list the files in an account. To list every file, you would set the 'path' parameter to the empty string "" (not "/"), and set 'recursive' to true.

 

The error you're getting indicates that the call failed because the HTTPS request body was empty, instead of containing the expected parameters. I see from your code that you are attempting to set the body via the 'SetBody' method, but that's apparently not actually getting sent to the server.

 

I can't provide support for the Appeon PowerBuilder environment or OAuthClient/OAuthRequest/ResourceResponse classes themselves as they aren't made by Dropbox though, so I recommend referring to the documentation for those for information on how to configure/debug HTTPS requests like this.

Re: Get List of files

adolfochairez
Explorer | Level 3

SOLVED:

The problem was this:

Say Contet change this and works fineError3.jpg

 

Work.jpg

Who's talking

Top contributors to this post

  • User avatar
    adolfochairez Explorer | Level 3
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?