Meelis Nigols Posted November 25, 2019 Share Posted November 25, 2019 Another thing that was unexpected. When searching folders by name, it turns out that folder name string is used for substring search. For example, when using next URL for search: https://passwordstate/winapi/folders/?FolderName=Folder1&TreePath=\Test then results include folders with following names (and treepaths): Folder1 (\Test\Folder1) Folder10 (\Test\Folder10) Subfolder1 (\Test\Folder*\Subfolder1 - serveral folders) Subfolder10 (\Test\Folder*\Subfolder10 - serveral folders) How can I perform search with exact match? Without that i have to construct desired TreePath and then compare all returned results to that, if I want to get only folder I'm searching for... My PasswordState build number is 8706. Link to comment Share on other sites More sharing options...
support Posted November 26, 2019 Share Posted November 26, 2019 Hi Meelis, Unfortunately under these circumstances, we do not have the ability to do an exact match under a nested tree structure, so I've created this script which does a bit of data manipulation to find the exact Folder ID. This is Powershell once again and you'll need to change your URL, and both the variables at the top of the script for your treepath and folder name. $PasswordstateUrl = "https://sandbox.halox.net" $APIKey = "4ca37695823bdfe9285afe3bc3467d87" #Set the search terms for the fodler you wish to look up in the variable below $Name = "Folder 1" $TreePath = "Test" # Construct the URL $FullUrl = "$PasswordstateUrl/api/folders/?FolderName=$Name&TreePath=$TreePath" # Execute the search $result = Invoke-Restmethod -Method GET -Uri $FullURL -Header @{ "APIKey" = $APIKey } # Filter on Results to get FolderID $Folder = $result | select-object folderid, foldername | where {$_.foldername -eq "$Name"} $FolderID = $Folder.FolderID Write-Output $FolderID Regards, Support Link to comment Share on other sites More sharing options...
Meelis Nigols Posted November 26, 2019 Author Share Posted November 26, 2019 5 hours ago, support said: Unfortunately under these circumstances, we do not have the ability to do an exact match under a nested tree structure, so I've created this script which does a bit of data manipulation to find the exact Folder ID. Would it be possible to change documentation and state there, that search performs substring search? Link to comment Share on other sites More sharing options...
support Posted November 27, 2019 Share Posted November 27, 2019 Hello Meelis, Just letting you know that we've added Exact Match searching support for Folders and Password Lists for the next release, due by the end of the week. We'll post back again here when the new build is available. Regards Click Studios Link to comment Share on other sites More sharing options...
support Posted November 29, 2019 Share Posted November 29, 2019 Hi Meelis, We've just released build 8835 which includes a new exact match for the API searching on Password Lists. If you can upgrade at your convenience, then you should be able to take advantage of this new feature. Regards, Support Link to comment Share on other sites More sharing options...
Meelis Nigols Posted November 29, 2019 Author Share Posted November 29, 2019 Thanks. BTW, if substring search is possible, can i also use Reguar Expression syntax to specify search pattern? Meelis Link to comment Share on other sites More sharing options...
support Posted November 29, 2019 Share Posted November 29, 2019 Hello Meelis, No sorry, we do not have functionality to support Regex matching. Regards Click Studios Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now