1
votes

I'm trying to query basic folder metadata with the new Dropbox API v2, through an HTTP request. I can use the endpoints files/list_folder and files/get_metadata with no problem, but my calls to sharing/get_folder_metadata are returning this:

{"error_summary": "invalid_id/", "error": {".tag": "invalid_id"}, "user_message": {"locale": "unknown", "text": "Invalid shared folder ID."}}

I have tried this with a few different folder IDs—the numerical ID that was used in the v1 API, and also the hash-like ID returned by, e.g., files/list_folder (which are all prefixed with id:). All of these produce the same result:

{"shared_folder_id":"976667947","include_membership":true}
{"shared_folder_id":"id:976667947","include_membership":true}
{"shared_folder_id":"2PUz957E_toAAAAAAAAAkQ","include_membership":true}
{"shared_folder_id":"id:2PUz957E_toAAAAAAAAAkQ","include_membership":true}

(I've scrambled some numbers/letters above, but in my test code I am copying and pasting the IDs returned by the API itself.)

How am I to indicate the shared_folder_id?

(I should note that this endpoint is marked in the docs as being in beta. It may also be significant that none of the endpoints in the API Explorer take shared_folder_id as an input.)

1

1 Answers

2
votes

The shared folder IDs that should be used here are available in a few places in Dropbox API v2, e.g., from /sharing/list_folders, where the response contains an entries field, which is a list of SharedFolderMetadata, each of which has an id.

The id would look something like:

dbsfid:AAAhfghd_efhgfgeJfgwUm-SOyhgffgY