Forum Discussion

rshaizawa's avatar
rshaizawa
Explorer | Level 3
5 years ago

search_v2 API does not work when using id

Hi ,

 

The specification of search_v2 api(link)  is written as follows. so I tried to search by id.

 

path String(pattern="(/(.|[\r\n]):*)?|id:.*|(ns:[0-9]+(/.*)?)")? Scopes the search to a path in the user's Dropbox. Searches the entire Dropbox if not specified. This field is optional.

But, When send a request with the id on using Dropbox Api Explore , return 400 error.

Does search_v2 api not support searching by id?

 

 

description:

request:

(Authorization and path value is masked.)

curl -X POST https://api.dropboxapi.com/2/files/search_v2 \
  --header 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  --header 'Content-Type: application/json' \
  --data '{"query":"Sample","options":{"path":"id:dummy"}}'

Response:

Error: 400
Error in call to API function "files/search_v2": <redacted>

Thanks,

rshaizawa

7 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    Thanks for the report! We'll look into it.

  • rm2020's avatar
    rm2020
    New member | Level 2
    5 years ago

    FYI As requested in a recent email from dropbox, I've just converted our system to use the /search_v2 api and am experiencing this problem as well.

     

    "Error in call to API function "files/search_v2": rpc error: ... deep stack trace removed ..."

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    rm2020 Thanks for the additional report. The team is aware of the issue and is looking into it. I recommend switching to using paths instead of IDs when calling /2/files/search_v2 to avoid this error.

  • Lito's avatar
    Lito
    Explorer | Level 4
    5 years ago

    Same here, but we have the problem that we haven't paths on our system, only ids.

     

    We need to do a previous get_metadata request to get the path and then filter by path.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    Lito Thanks for the note! I'll follow up here once I have an update on this issue.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    This should be fixed now. Please try again and let us know if you're still seeing any issues. Thanks!

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

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!