Retrieves a list of tasks, given the specified paging, filtering, and sorting.
Query Tasks runs with the following defaults, which you can override:
createdDate
in DESC
orderFor field support for filters and sorting, see Tasks: Supported Filters and Sorting.
To learn about working with Query methods, see API Query Language, Sorting and Paging, and Field Projection.
You can only call this method when authenticated as a Wix app or Wix user identity.
Query options.
The retrieved tasks.
Paging metadata.
Retrieves tasks by a query with filter and sort
curl -X POST \
'https://www.wixapis.com/crm/tasks/v2/tasks/query' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
--data-raw '
{
"query": {
"sort": [
{
"fieldName": "dueDate",
"order": "DESC"
}
],
"filter": {
"$and": [
{
"status": "ACTION_NEEDED"
},
{
"dueDate": {"$gt": "2023-08-20T12:00:00.000Z"}
},
{
"contact.id": "c3341c32-f40e-4de5-8e90-d181c9cddb04"
}
]
},
"cursorPaging": {
"limit": 1
}
}
}'
{
"tasks": [
{
"id": "4973f73a-40ef-11ee-be56-0242ac120002",
"revision": "1",
"createdDate": "2022-08-13T07:43:18.125Z",
"updatedDate": "2022-08-13T08:49:37.054Z",
"title": "Need to call someone",
"description": "Explain about your site",
"dueDate": "2022-08-17T09:00:00.000Z",
"status": "ACTION_NEEDED",
"source": {
"sourceType": "USER",
"userId": "fe213e9b-a560-4bcc-aae4-ef31c4152002"
},
"assigneeId": "f6eb6c40-7379-481e-8d52-58cfb6dc4c9a",
"contact": {
"id": "c3341c32-f40e-4de5-8e90-d181c9cddb04",
"firstName": "Some",
"lastName": "One",
"email": "email@example.com",
"phone": "+97297495550",
"imageUrl": "https://www.wix.com/contacts-server/api/v1/metasite/avatar/c3341c32-f40e-4de5-8e90-d181c9cddb04/2528bd01086244efb191c1302d986566/"
}
}
],
"pagingMetadata": {
"count": 1,
"cursors": {
"next": "f7ec4508392aacd205bf1d05054347c6d8f56a5b.Eh0qGwoZCgZzdGF0dXMSDxoNQUNUSU9OX05FRURFRBomCgdkdWVEYXRlGhsqGQoXCgokdGltZXN0YW1wEgkRAAAo9BmieEIiJDI5Mjk0ZDJmLTEyNWYtNGFhZC05OGUwLTE1NDcxZTZkZDhkZg"
},
"has_next": true
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.