cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Discuss Dropbox Developer & API

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

Re: Get List of files

Get List of files

adolfochairez
Explorer | Level 3
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

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].

adolfochairez
Explorer | Level 3
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

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.

adolfochairez
Explorer | Level 3
Go to solution

SOLVED:

The problem was this:

Say Contet change this and works fineError3.jpg

 

Work.jpg

Need more support?