POST

Query Tasks


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 order

For 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.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Tasks
Read Tasks
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/crm/tasks/v2/tasks/query

Body Params
queryQuery

Query options.

Response Object
tasksArray <Task>

The retrieved tasks.


pagingMetadataPagingMetadata

Paging metadata.

Retrieves tasks by a query with filter and sort

Request
cURL
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 } } }'
Response
JSON
{ "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 } }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?