1
0
-1

When searching for events, I cannot use the filter: "eventLocationDistance": according to https://userguide.rescuegroups.org/display/APIDG/Object+definitions#Objectdefinitions-events it should be an option to use. 


{  
"apikey":"<APIKEY>",
"objectType":"events",
"objectAction":"publicSearch",
"search":{
"resultStart":0,
"resultLimit":15,
"resultSort":"eventStart",
"resultOrder":"asc",
"calcFoundRows":"Yes",
"filters":[
{
"fieldName":"eventStart",
"operation":"greaterthanorequal",
"criteria":"rg:today"
},
{
"fieldName":"locationPostalcode",
"operation":"equal",
"criteria":"47201"
},
{
"fieldName":"eventLocationDistance",
"operation":"radius",
"criterai":"25"
}
],
"fields":[
"eventID",
"eventName",
"eventStart",
"eventSpecies",
"eventDescription",
"locationName",
"locationAddress",
"locationCity",
"locationState",
"locationPostalcode",
"locationPhone"
]
}
}
    CommentAdd your comment...

    2 answers

    1.  
      2
      1
      0

      Brandon,

      Couple issues with your query - first, the location and distance field names should be locationPostalcode and locationDistance.

      Also, you have "criteria" spelled wrong in your filters.

      Here's an updated query that works (notice that there are no future events within 25 miles of 47201 at the moment):

      {  
      	"apikey":"{{apikey}}",
      	"objectType":"events",
      	"objectAction":"publicSearch",
      	"search":{  
      	  "resultStart":0,
      	  "resultLimit":15,
      	  "resultSort":"eventStart",
      	  "resultOrder":"asc",
      	  "calcFoundRows":"Yes",
      	  "filters":[  
      	     {  
      	        "fieldName":"eventStart",
      	        "operation":"greaterthanorequal",
      	        "criteria":"rg:today"
      	     },
      	     {
      	     	"fieldName":"locationPostalcode",
      	     	"operation":"equal",
      	     	"criteria":"47201"
      	     },
      	     {
      	     	"fieldName":"locationDistance",
      	     	"operation":"radius",
      	     	"criteria":"250"
      	     }
      	  ],
      	  "fields":[  
      			"eventID",
      			"eventName",
      			"eventStart",
      			"eventSpecies",
      			"eventDescription",
      			"locationName",
      			"locationAddress",
      			"locationCity",
      			"locationState",
      			"locationPostalcode",
      			"locationPhone"
      		]
      	}
      }
        CommentAdd your comment...
      1.  
        1
        0
        -1

        Last question, is there a wiki link that shows date ranges? 

        eventStart rg:today

        eventEnd rg: Next week or whatever?

          CommentAdd your comment...