cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Find out how Tiffany, a Customer Experience superstar uses Dropbox to keep her family in the loop when it comes to her new baby here!

Discuss Dropbox Developer & API

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

Get list of files token expiration

Get list of files token expiration

mauro99
Explorer | Level 4

Hi,

I'm struggling to obtain a list of files from a given folder (of my own dropbox account). I see many discussion here in this forum and in stackoverflow on this issue.

The situation is this: if I use a dropbox endpoint file explorer with 1) list_folder and after retrieve the cursor 2) lisf_folder/continue I can without problem retrieve my list of files. The bad conditions is that my token expires after 4 hours. 

 

So I tried to follow the GREG-DB to get the complete access token via Dropbox app console (here the answer). But it seems not working (I receive this error: Exception: Address unavailable: https://api.dropboxapi.com/2/files/list_folder/continue

 

So for a better understanding of the situation I put here the 2 CURLS flows (I just masked with XXX my token and cursor) one from ENDPOINT EXPLORER and the other one from FULL DOCUMENTATION 

 

I kindly ask to dropbox team to give me a detailed help. I'm sure that they can help not only me but many members of this community!

 

Thanks

Mauro

 

// EXPLORER ENDPOINT
// LIST_FOLDERS
// CURL
curl -X POST https://api.dropboxapi.com/2/files/list_folder \
--header 'Authorization: Bearer XXXX' \
--header 'Content-Type: application/json' \
--data '{"path":"/Agrotecnica"}'

// LIST_FOLDERS_CONTINUE

// HTTP REQUEST
POST /2/files/list_folder/continue
Host: https://api.dropboxapi.com
User-Agent: api-explorer-client
Authorization: Bearer XXXX
Content-Type: application/json

{
"cursor": "XXXX"
}

// CURL
curl -X POST https://api.dropboxapi.com/2/files/list_folder/continue \
--header 'Authorization: Bearer XXXX' \
--header 'Content-Type: application/json' \
--data '{"cursor":"XXXX"}'

 

//FULL API DOCUMENTATION
// LIST_FOLDERS
//CURL
curl -X POST https://api.dropboxapi.com/2/files/list_folder \
--header "Authorization: Bearer XXXXXXXXXXXXXXXXXX" \
--header "Content-Type: application/json" \
--data "{\"path\": \"/Homework/math\",\"recursive\": false,\"include_media_info\": false,\"include_deleted\": false,\"include_has_explicit_shared_members\": false,\"include_mounted_folders\": true,\"include_non_downloadable_files\": true}"


//LIST_FOLDER/CONTINUE
//CURL

curl -X POST https://api.dropboxapi.com/2/sharing/list_folders/continue \
--header "Authorization: Bearer XXXXXXXXXXXXX" \
--header "Content-Type: application/json" \
--data "{\"cursor\": \"XXXXXXXXXXX"}"
1 Reply 1

Re: Get list of files token expiration

Greg-DB
Dropboxer

Is that the full error/output? If there's any other error/output, please share that for reference. You may also be able to enable more verbose output by using curl's "-v" option.

 

From what you shared here though, I see you're getting "Address unavailable", which may indicate a DNS issue. The 'api.dropboxapi.com' domain is currently resolving correctly for me though, so you may need to check your DNS setup/server.

Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?