Skip to main content
Question

API call that returns list of files in shared folder with associated Direct URLs

  • May 22, 2025
  • 1 reply
  • 41 views

Forum|alt.badge.img

Is there an API that will give me the FULL list of files in the shared folder including their Direct URL?

I can find an API that gives me the Direct URL for A file and I can find an API that gives me the list of files in a folder, but I have not been able to find an API that gives me a list of all of the DIRECT URLs to each of the files in a shared Box folder.

Thanks!

p.s. I have an account plan that supports Direct URLs to files.

1 reply

Forum|alt.badge.img

Hi Rick

You should be able to do this by specifying the correct fields in the API call - see https://developer.box.com/reference/get-folders-id-items/

https://api.box.com/2.0/folders/123456789/items?fields=id,name,shared_link

Should give this for files without shared link set
{
"type": "file",
"id": "6951523312941",
"name": "IMG_20200707_144120.jpg",
"shared_link": null
}

and this for files with shared link set
{
"type": "file",
"id": "69514710819812",
"name": "pdf3.pdf",
"shared_link": {
"url": "https://app.box.com/s/w12llch7d9gnxa29m1115mpoiuzn47pkh6",
"download_url": "https://app.box.com/shared/static/wllch7d91xa2vu9m11poiuz17pkh6.pdf",
"vanity_url": null,
"vanity_name": null,
"effective_access": "open",
"effective_permission": "can_download",
"is_password_enabled": false,
"unshared_at": null,
"download_count": 0,
"preview_count": 0,
"access": "open",
"permissions": {
"can_preview": true,
"can_download": true
}
}
}

 

you can then access the JSON and retrieve the direct link to the content. 

Hope that helps

Best Regards,
Peter Christensen, Platform Solutions Engineer, Box