Discuss Dropbox Developer & API
Hello,
I am trying to get sharing_info from /search api response by passing query string for search using user_access_token.
api:
https://api.dropboxapi.com/2/files/search_v2
Response should contain "Sharing_info" field as per the document. https://www.dropbox.com/developers/documentation/http/documentation#files-search
But I am not able to see "Sharing_info" field inside response which I received.
Response:
{ "has_more": false, "matches": [ { "match_type": { ".tag": "filename" }, "metadata": { ".tag": "metadata", "metadata": { ".tag": "file", "client_modified": "2021-05-05T07:49:41Z", "content_hash": "bc7f0447e809e1c278dca5092f6b7d14ab8ebfc72e182147a8b722471857acb8", "id": "id:K0967Nm-QfUAAAAAAAAAHg", "is_downloadable": true, "name": "untitled.h", "path_display": "/docs/untitled.h", "path_lower": "/docs/untitled.h", "rev": "015c1906ff650310000000233586740", "server_modified": "2021-05-05T07:49:41Z", "size": 783 } } } ] }
As per document its shows that this field is an optional filed.
What is meaning of that optional?
In which case I will get this data and in which case I will not get this data?
Is there any other alternative to find owner_detail of file which are shared to me (received files).
The sharing_info field is optional, meaning that it will not always be returned. The sharing_info field is documented as:
sharing_info FileSharingInfo? Set if this file is contained in a shared folder. This field is optional.
So, since there is no sharing_info in this result, that indicates that this file is not in a shared folder (and so there is no sharing information to return).
For your received file question, please refer to your thread on that topic.
Thanks for your response.
For below file, It is file is present in shared folder, Still I am not getting sharing_info.
{ "has_more": false, "matches": [ { "match_type": { ".tag": "filename" }, "metadata": { ".tag": "metadata", "metadata": { ".tag": "file", "client_modified": "2021-05-05T07:51:18Z", "id": "id:Ke9OphgV2zsAAAAAAAAAHw", "is_downloadable": true, "name": "Screenshot 2021-04-09 at 11.54.18 AM.png", "rev": "015c19075c155150000000233388450", "server_modified": "2021-05-05T07:51:18Z", "size": 4253 } } } ] }
As you said, Sharing info is optional, if it is inside shared folder then only "sharing_info" will be available.
That file is not inside a shared folder. It is only individually shared. That's a different kind of sharing, and so sharing_info won't be returned for it.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!