Is it possible to filter using json structure when using the API?
If not, what’s the purpose of this field, where can I use it?
Is it possible to filter using json structure when using the API?
If not, what’s the purpose of this field, where can I use it?
Hi @ricardo,
yes, these JSON advanced filters can be used in some API endpoints that supports them, like:
To use it, provide the JSON object as a query parameter called filters
, e.g. ?filters={"filter_type": "AND", "filters": [{"field": 1, "type": "equal", "value": "test"}]}
.
So a full URL would be like https://api.baserow.io/api/database/rows/table/{table_id}/?filters={"filter_type": "AND", "filters": [{"field": 1, "type": "equal", "value": "test"}]}
.
You will need to encode it because of the use of characters that wouldn’t be allowed in URL. If you grab the URL from the builder in the docs, it will be done for you:
Many thanks, Petrs
I think it will be more simple if I could use body on the request, but the existing solution resolves the problem.