REST API: Complex project filters: Difference between revisions
From Planfix
(Created page with "{{#seo: |title=REST API: Complex Project Filters |titlemode=append |keywords=planfix, project filters, api, rest, rest api, complex project filters |description=REST API: Complex Project Filters }} Complex filters in REST API Planfix are used in the "/project/list" method to obtain a list of projects. Project filters are set by the following parameters:: *'''type''' — numeric identifier of the filter. *'''operator''' — filter operator, one of the val...") |
No edit summary |
||
Line 45: | Line 45: | ||
{| class="wikitable" style="margin-top: 1em; width:100%" | {| class="wikitable" style="margin-top: 1em; width:100%" | ||
!width="40"| | !width="40"|Type !!width="200"| Name !! Operators !! Format value | ||
|- | |- | ||
|5103 || Project field type "Data" | |5103 || Project field type "Data" | ||
Line 54: | Line 54: | ||
*lt | *lt | ||
|rowspan="3" | | |rowspan="3" | | ||
Object : | |||
<pre> | <pre> | ||
"value": { | "value": { | ||
Line 65: | Line 65: | ||
dateType accepts the following values: | dateType accepts the following values: | ||
*today | |||
today | *yesterday | ||
yesterday | *tomorrow | ||
tomorrow | *thisWeek | ||
thisWeek | *lastWeek | ||
lastWeek | *nextWeek | ||
nextWeek | *thisMonth | ||
thisMonth | *lastMonth | ||
lastMonth | *nextMonth | ||
nextMonth | *last - last n days, n is passed in dateValue | ||
last - last n days, n is passed in dateValue | *next - next n days, n is passed in dateValue | ||
next - next n days, n is passed in dateValue | *in - in n days, n is passed in dateValue | ||
in - in n days, n is passed in dateValue | *otherDate - exact date, date is passed in the format dd-mm-yyyy in dateFrom | ||
otherDate - exact date, date is passed in the format dd-mm-yyyy in dateFrom | *otherRange - exact period, dates are passed in the format dd-mm-yyyy in dateFrom and dateTo | ||
otherRange - exact period, dates are passed in the format dd-mm-yyyy in dateFrom and dateTo | *otherDate_withTime - exact date-time, date is passed in the format "dd-mm-yyyy hh:mm" in dateFrom | ||
otherDate_withTime - exact date-time, date is passed in the format "dd-mm-yyyy hh:mm" in dateFrom | *otherRange_withTime - exact period with specified time, dates are passed in the format "dd-mm-yyyy hh:mm" in dateFrom and dateTo | ||
otherRange_withTime - exact period with specified time, dates are passed in the format "dd-mm-yyyy hh:mm" in dateFrom and dateTo | |||
Whether a date is considered in the past depends on the time zone of the employee who made the request. | Whether a date is considered in the past depends on the time zone of the employee who made the request. |
Revision as of 08:03, 29 February 2024
Complex filters in REST API Planfix are used in the "/project/list" method to obtain a list of projects.
Project filters are set by the following parameters::
- type — numeric identifier of the filter.
- operator — filter operator, one of the values from the list (equal, not equal, gt, lt). Different filters can have different valid operators.
- value — filter value, which can be a string, a number, or a complex object, depending on the filter type.
- field — identifier of the custom data tag field by which the filter is performed.
Example of a request to get a list of projects with several filters by a custom field of type "Date" and a custom field of type "Employee List" (AND logic is used):
{ "offset": 0, "pageSize": 100, "fields": "id,name,description,3,5", "filters": [ { "type": 5103, "field": 3, "operator": "equal", "value": { "dateType": "otherRange", "dateFrom": "15-12-2022", "dateTo": "17-12-2022" } }, { "type": 5109, "field": 5, "operator": "equal", "value": "user:50" } ] }
Type | Name | Operators | Format value |
---|---|---|---|
5103 | Project field type "Data" |
|
Object : "value": { "dateType": string, "dateValue": string, "dateFrom": string, "dateTo": string } dateType accepts the following values:
Whether a date is considered in the past depends on the time zone of the employee who made the request. Examples: "value": { "dateType": "thisWeek" } "value": { "dateType": "otherRange", "dateFrom": "01-12-2022", "dateTo": "06-12-2022" } "value": { "dateType": "otherDate_withTime", "dateFrom": "30-12-2022 12:00", } |
5005 | Due date | ||
5013 | Creation date | ||
5004 | Author |
|
string - employee/contact/group number with a prefix. Например: “user:1”, “contact:5”, “group:3” |
5008 | Customer Manager | ||
5012 | Auditor | ||
5011 | Assignee | ||
5108 | Project field type "Contact" | ||
5109 | Project field type "Employee" | ||
5110 | Project field type "Counterparty" | ||
5112 | Project field type "Group, employee, contact" | ||
5113 | Project field type "Employee list" | ||
5001 | Project name |
|
string - contains/does not contain filter is applied |
5101 | Project field type "String" |
|
string - equal/not equal/ contains/does not contain filter is applied |
5007 | Project number |
|
int |
5102 | Project field type "Number" | ||
5105 | Project field type "Checklist" |
|
int - 1 / 0
boolean |
5106 | Project field type "List" |
|
string |
5107 | Project field type "Directory entry" |
|
int - entry identifier |
5115 | Project field type "Task" |
|
int - task number |
5117 | Project field type "Project" |
|
int - project number |
5002 | Project group |
|
int - group identifier |
5006 | Project status |
|
int - status identifier |
5010 | Template |
|
int - template number |
5003 | Counterparty |
|
int - counterparty number
string - counterparty number with a prefix, for example: "contact:1" |
5014 | Subproject |
|
int - subproject number |