c++-clidropbox-apispring-social

Specifying a search query in the dropbox API


I have successfully set up a dropbox API (using Spring.Social.DropBox) and am trying to programmatically search my dropbox folder. How do I specifiy a query that can return more than one file type?

DropboxServiceProvider ^dropboxServiceProvider = gcnew Spring::Social::Dropbox::Connect::DropboxServiceProvider(appKey, appSecret, Spring::Social::Dropbox::Api::AccessLevel::AppFolder);
IDropbox ^dropboxApi = dropboxServiceProvider->GetApi(myAccessToken, myAccessSecret);

System::String ^pth = "TestFolder";
System::String ^qry = ".txt";
System::Collections::Generic::IList<Spring::Social::Dropbox::Api::Entry^> ^results = dropboxApi->Search(pth, qry);

The above code works when the querty specifies just one file type (.txt, .png). But how do I construct a query to retrieve multiple file types? I have tried

System::String ^qry = ".txt;.png";
System::String ^qry = ".{txt|png}";
System::String ^qry = ".txt?.png";

Any idea how to do this?


Solution

  • The Dropbox API does not currently support regex queries or any sort of boolean operators like this, so this isn't currently possible. You can get all files of any type with a given name, or all files of a given type by searching for the respective name or type alone, but you can't search for multiple values on a single call. (One workaround may be to make the relevant calls and combine the results together.)