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: 

Not getting sharing_info in response of /search api

Not getting sharing_info in response of /search api

mukund
Explorer | Level 3

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).

 

3 Replies 3

Re: Not getting sharing_info in response of /search api

Greg-DB
Dropboxer

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.

Re: Not getting sharing_info in response of /search api

mukund
Explorer | Level 3

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
        }
      }
    }
  ]
}

Screenshot 2021-06-17 at 10.27.01 AM.png

As you said, Sharing info is optional, if it is inside shared folder then only "sharing_info" will be available. 

Re: Not getting sharing_info in response of /search api

Greg-DB
Dropboxer

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.

Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    mukund Explorer | Level 3
What do Dropbox user levels mean?
Need more support?