cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close

Discuss Dropbox Developer & API

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

Get List of files

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
Highlighted

Re: Get List of files

Dropboxer
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
Highlighted

Re: Get List of files

Dropboxer
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

Highlighted

Re: Get List of files

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

Highlighted

Re: Get List of files

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

Highlighted

Re: Get List of files

Explorer | Level 3

SOLVED:

The problem was this:

Say Contet change this and works fineError3.jpg

 

Work.jpg

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Polls
Have you been keeping up good habits while working from home?
We've created a working from home cheat sheet to help keep up on those habits, check it out here.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?