Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Directus API : how to filter the results

Tags:

php

directus

I want to query the Directus API for changes that have happened since I last checked.
This means hitting the /activity endpoint and filtering based on the datetime param, but I can't seem to get the filter parameter to work.

I'm trying something like this (based on examples in the docs) :

curl -H "Authorization: Bearer <my_token>" "https://<my_server>/api/1.1/activity/?filter[datetime][gt]=2017-06-23T01:45:18-11:00" -g

That request succeeds, but the filter part of it has no effect.

What is the correct syntax for the filter parameter ?

like image 503
kris Avatar asked Sep 05 '25 05:09

kris


2 Answers

The parameter is named filters (plural) instead of filter. The rest of the syntax is correct.

like image 164
Rijk Avatar answered Sep 07 '25 21:09

Rijk


Since Directus 7, the paramteter is indeed filter and not filters

like image 34
beac0n Avatar answered Sep 07 '25 21:09

beac0n