Welcome to the Smartsheet Forum Archives


The posts in this forum are no longer monitored for accuracy and their content may no longer be current. If there's a discussion here that interests you and you'd like to find (or create) a more current version, please Visit the Current Forums.

I cannot get the search query api to work - it gives partial matches

Phips Allison
Phips Allison ✭✭
edited 12/09/19 in Archived 2017 Posts

I've tried using postman and single and double quotes do not make any difference either

 

I can filter the results but it seems like i must be doing something wrong

 

https://api.smartsheet.com/2.0/search/sheets/798272320235396?query="'Elliott'"

 

returns 

{

  "results": [

    {

      "text": "White cottage",

      "objectType": "row",

      "objectId": 3223433130600324,

      "parentObjectType": "sheet",

      "parentObjectId": 798272320235396,

      "parentObjectName": "Leads",

      "contextData": [

        "Row 24: 2003"

      ]

 

    }, etc etc etc

Comments

  • Steve Weil
    Steve Weil Employee

    Please use double quotes - not both (as in your example)

     

    For example

    search/sheets/7515998992525188?query="Building"

    This only matches rows with the complete word "Building" - but not rows with "Build"

     

     

     

  • Taylor F
    Taylor F Employee

    Hey Phips, 

     

    Welcome to the Smartsheet Community. I worked with you over email. The issue was caused by a space between the equals symbol and the first set of quotations.

     

    https://api.smartsheet.com/2.0/search/sheets/{sheet ID}?query= "'Elliott'"

     

    Both in the API and in the app, if you search for a word without quotes it will search for any combination of the letters which is why it found ott in cottage. Placing quotes around the word Elliott would force the search to only find that exact combination. I can't explain why the extra space caused the issue but it was causing the API to not search by the exact phrase. 

     

    Steve is correct that you don't need the single and double quotes around your search string.

     

    Let me know if this doesn't resolve the issue for you.

This discussion has been closed.