Filtering for ` /v3/tasks/all`
The filter
object is an optional multi-dimensional array that enables you to fine-tune and narrow down the responses from the /v3/tasks/all
endpoint.
Depending on your environment and tech stack, you may find this easier to do as a GET
or as a POST
.
Method | Endpoint | Link | Send filter as: |
---|---|---|---|
GET | v3/tasks/all | https://docs.enerflo.io/reference/get-v3-tasks-all | url parameters |
POST | v3/tasks/all | https://docs.enerflo.io/reference/post-v3-tasks-all | json body |
The examples below demonstrate the same filter applied as a JSON body (for a POST
request), and a URL array (for a GET
request). They are functionally equivalent.
Give me all tasks that were completed after "2023-12-01"
{
"orderBy": "created_at",
"orderDir": "asc",
"pageSize": "25",
"filter": {
"logic": "and",
"filters": [
{
"field": "completed_at",
"operator": "gt",
"value": "2023-12-01"
}
]
}
}
orderBy=created_at&orderDir=asc&pageSize=25&filter[logic]=and&filter[filters][0][field]=completed_at&filter[filters][0][operator]=gt&filter[filters][0][value]=2023-12-01
Give me all tasks that were created in the year 2023
{
"orderBy": "created_at",
"orderDir": "asc",
"pageSize": "25",
"filter": {
"logic": "and",
"filters": [
{
"field": "created_at",
"operator": "gte",
"value": "2023-01-01"
},
{
"field": "created_at",
"operator": "lte",
"value": "2023-12-31"
}
]
}
}
orderBy=created_at&orderDir=asc&pageSize=25&filter[logic]=and&filter[filters][0][field]=created_at&filter[filters][0][operator]=gte&filter[filters][0][value]=2023-01-01&filter[filters][1][field]=created_at&filter[filters][1][operator]=lte&filter[filters][1][value]=2023-12-31
Updated 11 months ago