Dropbox has added a /metadata/link endpoint that returns metadata for a shared link, mirroring what the Core API's /metadata provides for files and folders. The endpoint requires no user access token, so a shared URL alone is enough to resolve what it points to. Slack and Trello worked with Dropbox during development to support links pasted into channels and boards.
Trying it out takes a shared link and a registered Dropbox app. The examples below use curl against a folder containing two images: https://www.dropbox.com/sh/748f94925f0gesq/AAAMSoRJyhJFfkupnAU0wXuva?dl=0.
App key and secret
Request
curl -X POST https://api.dropbox.com/1/metadata/link -u <APP_KEY>:<APP_SECRET> \
-d link=https://www.dropbox.com/sh/748f94925f0gesq/AAAMSoRJyhJFfkupnAU0wXuva?dl=0
Response
200 OK
Content-Type: application/json
{
"bytes": 0,
"contents": [
{
"bytes": 228105,
"client_mtime": "Fri, 28 Aug 2015 18:39:12 +0000",
"icon": "page_white_picture",
"is_dir": false,
"mime_type": "image/jpeg",
"modified": "Fri, 28 Aug 2015 18:44:13 +0000",
"path": "/Pusheen.jpg",
"rev": "155114a7004",
"root": "link",
"size": "222.8 KB",
"thumb_exists": true
},
{
"bytes": 550913,
"client_mtime": "Fri, 28 Aug 2015 18:39:58 +0000",
"icon": "page_white_picture",
"is_dir": false,
"mime_type": "image/jpeg",
"modified": "Fri, 28 Aug 2015 18:44:08 +0000",
"path": "/Sausalito.jpg",
"rev": "153114a7004",
"root": "link",
"size": "538 KB",
"thumb_exists": true
}
],
"folder_name": "Shared Link Metadata",
"hash": "f9433abe16be847f75ec8949b3870534",
"icon": "folder",
"in_dropbox": false,
"is_dir": true,
"link": "https://www.dropbox.com/sh/748f94925f0gesq/AAAMSoRJyhJFfkupnAU0wXuva?dl=0",
"modified": "Fri, 10 Jul 2015 01:07:57 +0000",
"path": null,
"rev": "141114a7004",
"root": "link",
"size": "0 bytes",
"thumb_exists": false,
"visibility": "PUBLIC"
}
Authenticated calls and the in_dropbox field
Passing a user's access token changes what the response can tell you. The returned metadata includes an in_dropbox field indicating whether the link resolves to a file or folder inside that user's own Dropbox. When in_dropbox is true, the path field gives the exact path to the item, which the rest of the Core API can then operate on directly. First-time token creation is covered by the OAuth guide.
Request
curl -X POST https://api.dropbox.com/1/metadata/link \
-d link=https://www.dropbox.com/sh/748f94925f0gesq/AAAMSoRJyhJFfkupnAU0wXuva?dl=0 \
-H "Authorization: Bearer <ACCESS_TOKEN>"
Response
200 OK
Content-Type: application/json
{
"bytes": 0,
"contents": [
{
"bytes": 228105,
"client_mtime": "Fri, 28 Aug 2015 18:39:12 +0000",
"icon": "page_white_picture",
"is_dir": false,
"mime_type": "image/jpeg",
"modified": "Fri, 28 Aug 2015 18:44:13 +0000",
"path": "/Pusheen.jpg",
"rev": "155114a7004",
"root": "link",
"size": "222.8 KB",
"thumb_exists": true
},
{
"bytes": 550913,
"client_mtime": "Fri, 28 Aug 2015 18:39:58 +0000",
"icon": "page_white_picture",
"is_dir": false,
"mime_type": "image/jpeg",
"modified": "Fri, 28 Aug 2015 18:44:08 +0000",
"path": "/Sausalito.jpg",
"rev": "153114a7004",
"root": "link",
"size": "538 KB",
"thumb_exists": true
}
],
"folder_name": "Shared Link Metadata",
"hash": "f9433abe16be847f75ec8949b3870534",
"icon": "folder",
"in_dropbox": true,
"is_dir": true,
"link": "https://www.dropbox.com/sh/748f94925f0gesq/AAAMSoRJyhJFfkupnAU0wXuva?dl=0",
"modified": "Fri, 10 Jul 2015 01:07:57 +0000",
"path": "/Blog/Shared Link Metadata",
"rev": "141114a7004",
"root": "dropbox",
"size": "0 bytes",
"thumb_exists": false,
"visibility": "PUBLIC"
}
Drilling into a folder
When a link targets a folder, metadata for individual files or subfolders within it is available by passing the relative path in the path parameter.
Request
curl -X POST https://api.dropbox.com/1/metadata/link \
-d link=https://www.dropbox.com/sh/748f94925f0gesq/AAAMSoRJyhJFfkupnAU0wXuva?dl=0 \
-d path=/Pusheen.jpg -H "Authorization: Bearer <ACCESS_TOKEN>"
Response
200 OK
Content-Type: application/json
{
"bytes": 228105,
"client_mtime": "Fri, 28 Aug 2015 18:39:12 +0000",
"icon": "page_white_picture",
"in_dropbox": false,
"is_dir": false,
"link": "https://www.dropbox.com/sh/748f94925f0gesq/AAACxOBrrlgYrMtZ804XECFQa/Pusheen.jpg?dl=0",
"mime_type": "image/jpeg",
"modified": "Fri, 28 Aug 2015 18:44:13 +0000",
"path": "/Pusheen.jpg",
"rev": "155114a7004",
"root": "link",
"size": "222.8 KB",
"thumb_exists": true,
"visibility": "PUBLIC"
}
Full details live in the Core API documentation.



