1
0
-1

I'm wondering if I could get assistance with my query. I'm trying my query with Google Postman, looking for animals within 10 miles of 90210 zip code. However my query seems to return results without regard to the distance from that zip code. The zip codes returned with the animal results are all over the map.

{ "apikey": "XXXXX","objectType": "animals","objectAction": "publicSearch","search":{"resultStart": 0, "resultLimit": 10, "fields": ["animalID","animalOrgID","animalGeneralAge","animalName","animalLocation"],"filters": [{"fieldName": "animalStatus","operation": "equals","criteria": "Available"},{"fieldName": "animalSpecies","operation": "equals","criteria": "dog"},{"fieldName": "animalLocationDistance", "operation": "radius","criteria": "10"},{"fieldName": "animalLocation","operation": "radius","critieria": "90210"}]}}

I'm using the HTTP API.  Any ideas what's wrong with my query?

Thank You

    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      It doesn't look like the results are any different after updating to "equals". Some ZIP codes returned looked like they may be correct (beginning in 9's), but many are much further than 10 miles.

      { "apikey": "XXXX","objectType": "animals","objectAction": "publicSearch","search":{"resultStart": 0, "resultLimit": 10, "fields": ["animalID","animalOrgID","animalGeneralAge","animalName","animalLocation"],"filters": [{"fieldName": "animalStatus","operation": "equals","criteria": "Available"},{"fieldName": "animalSpecies","operation": "equals","criteria": "dog"},{"fieldName": "animalLocationDistance", "operation": "radius","criteria": "10"},{"fieldName": "animalLocation","operation": "equals","critieria": "90210"}]}}

      The results:

      {
      "status": "ok",
      "messages": {
      "generalMessages": [],
      "recordMessages": []
      },
      "data": {
      "101803": {
      "animalID": "101803",
      "animalOrgID": "696",
      "animalGeneralAge": "Senior",
      "animalName": "Chapo",
      "animalLocation": "93465"
      },
      "1006781": {
      "animalID": "1006781",
      "animalOrgID": "945",
      "animalGeneralAge": "Young",
      "animalName": "Dutchess",
      "animalLocation": "43551"
      },
      "1011467": {
      "animalID": "1011467",
      "animalOrgID": "793",
      "animalGeneralAge": "Adult",
      "animalName": "Freckles",
      "animalLocation": "78758"
      },
      "1011965": {
      "animalID": "1011965",
      "animalOrgID": "793",
      "animalGeneralAge": "Adult",
      "animalName": "Uno",
      "animalLocation": "78069"
      },
      "1012443": {
      "animalID": "1012443",
      "animalOrgID": "1719",
      "animalGeneralAge": "Adult",
      "animalName": "Tyler",
      "animalLocation": "29730"
      },
      "1012486": {
      "animalID": "1012486",
      "animalOrgID": "84",
      "animalGeneralAge": "Senior",
      "animalName": "Roscoe *",
      "animalLocation": "17028"
      },

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Mark,

        Could you try the following with your filters?  To find pets in a 10 mile radius of 90210 you should do:

        animalLocation equals 90210
        animalLocationDistance radius 10

        I did see one place in our documentation where the incorrect operator was used.  I've updated that page so it should be in correct (in the radius search for organizations).

        https://userguide.rescuegroups.org/x/RQCl

        Hope that helps.

        1. Angelina R

          Hi Richard, 

          I'm using both the animalLocation and animalLocationDistance as you pointed out above, but I'm finding that the animalLocationDistance is not accurate.  For example, it shows that the distance to one animal location is 23 miles, but it's really only about 12 miles.  What exact fields should I use when specifying that I want an animalLocationDistance within a certain radius?  Do you know why the radius is not accurate?

        CommentAdd your comment...