1
0
-1

I'm using the HTTP/JSON API to search, filter, and display animal data on an external site.

Most things work just fine, but when I try to do an authenticated SEARCH on the "animal" object, it appears that the "animalGroups" search parameter is being ignored.

e.g. Using the following JSON request in a rest client:

{
  "token":"XXXXXX",
  "tokenHash":"XXXXXXXXXXXXX",
  "objectType":"animals",
  "objectAction":"search",
  "search":
  {
    "resultStart": "0",
    "resultLimit": "300",
    "resultSort": "animalID",
    "resultOrder": "asc",
    "filters":
    [
      {
        "fieldName": "animalStatus",
        "operation": "equals",
        "criteria": "Available"
      },
      {
        "fieldName": "animalGroups",
        "operation": "equals",
        "criteria": "279"
      }
    ],
    "fields":
    [
      "animalID", "animalGroups"
    ]
  }
}

The request returns 209 animals which is the count of total animals with "Available" status.

Changing the "criteria" for the "animalGroups" parameter has no impact, nor does it throw an error about it being an invalid request.

The token / tokenhash that I'm using is correct (I'm doing an auth request in a different rest client to get the data needed), I just have them obfuscated here.

What am I missing?  Is there a more preferred method of returning animals that are in a particular custom animal group?

Thanks in advance.

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Dave,

      The animalGroups "field" is a special case because it can contain an array of values.  The filtering isn't working due to limitations in our API.  The best I can suggest is to filter the results on your side after retrieving all of the results.

      Richard

        CommentAdd your comment...