[DONE] API: Retrieve filtered records with multiple filters is not working

I’m using the API - Retrieve filtered records for an app and trying to evaluate for two filters: single category and status fields. Here is my code:

{
  "filters": [
    {
      "field_id": 1234,
      "field_type": "single_category",
      "match_type": "equal",
      "values": [
        {
          "value": "Category 1"
        }
      ],
      "type": "category"
    },
    {
      "field_id": 5678,
      "field_type": "status",
      "match_type": "equal",
      "values": [
        {
          "value": "Published"
        }
      ],
      "type": "category"
    }
  ]
}

The problem is that it is only evaluating the first filter (single_category > “value”: “Category 1”) and ignoring the second filter (status > “value”: “Published”). The Filter | Tape Developers documentation mentions,

For every supported endpoint, multiple filters can be provided which get concatenated with the boolean AND operator.

Is this a bug, or must I write the code differently?

PS: Here is a related thread [DONE] API: Filter by “unique id” is not working, but in that case, it only evaluates for one filter. I’m trying multiple filters.

Found the solution thanks to @Tim. The second filters is a status field, so it needs to be type: status instead of type: category

 {
      "field_id": 5678,
      "field_type": "status",
      "match_type": "equal",
      "values": [
        {
          "value": "Published"
        }
      ],
      "type": "status"
    }
  ]
}
1 Like