The public web service API expose several domain specific searches that often become critical in identifying one specific object or a group of objects with common criteria. A standard methodology has been adopted across the different web service domains and the \\\$searchStr URL parameter can be used in a search. If you are like me, one particular challenge is that if you enter a name, revision, or any other indexed information you will get any and all results back from the index making it difficult to pinpoint specific objects. That was until I discovered (thanks to a GREAT post from @AN) that the \\\$searchStr supports the index's User Query Language (UQL)!
I have summarized a few examples that @AN provided below but as you can see by leveraging UQL we can now get much more precise and complex search results back from the public search APIs.
NOTE: In the samples provided below, because \\\$searchStr is a URL parameter it must be URI encoded. Tools like Postman can do this for you pretty easily and most programming languages have a helper function to accomplish this as well.
Postman URI Encode String: Select string to encode, Right click, select EncodeURIComponent
| UQL Example | Description |
|---|---|
| name:prd-R1132101349648-00006057 AND revision:A.1 | Search items with Name “prd-R1132101349648-00006057” and revision “A.1” - TNR type of search |
| label:BE* | Search items with Title starting with “BE” |
| owner:AAA27 | Search by elements with owner having id “AAA27” |
| description:hole | Search by elements containing “hole” in the description attribute |
flattenedtaxonomies:"interfaces/EnterpriseExtension" AND [ds6wg:EnterpriseExtension.V_PartNumber]:PN-00000014 | Search for elements with Part Number “PN-00000014” |
[ds6w:created]>=“2021-11-12T23:00:000Z” AND [ds6w:created]<“2021-11-13T23:00:000Z” | Search for items created between the given dates (in UTC time) |
| [ds6w:status]:(VPLM_SMB_Definition.RELEASED) | Search for released items |
| [ds6wg:XP_VPMReference_Ext.ATG_REV]:(00) | Search for items with value 00 on the ATG_REV custom attribute. |
