REST API: Complex contact filters: Difference between revisions
From Planfix
(Created page with "<!-- {{#seo: |title=REST API: Complex contact filters |titlemode=append |keywords= Planfix, REST, API, Complex, contact, filters |description=REST API: Complex contact filters }} Planfix applies complex filters in the /contact/list method when getting a list of contacts using the REST API. Contact filters are defined using the following parameters: *'''type''' — numeric identifier of the filter. *'''operator''' — filter operator, value from list (equal, notequal,...") |
No edit summary |
||
Line 1: | Line 1: | ||
{{#seo: | |||
|title=REST API: Complex contact filters | |title=REST API: Complex contact filters | ||
|titlemode=append | |titlemode=append | ||
Line 126: | Line 126: | ||
*equal | *equal | ||
*notequal | *notequal | ||
| rowspan="8" | string - | | rowspan="8" | string - employee/contact/group number with prefix. | ||
Example: "user:1", "contact:5", "group:3" | |||
|- | |- | ||
|2 || Supervisor | |2 || Supervisor | ||
Line 159: | Line 159: | ||
|4013 || Cannot be a counterparty in tasks | |4013 || Cannot be a counterparty in tasks | ||
|- | |- | ||
|4018 || | |4018 || Cannot be a counterparty in tasks | ||
|- | |- | ||
|4201 || | |4201 || Counterparty with no active tasks | ||
|- | |- | ||
|4202 || | |4202 || Is not participating in active tasks | ||
|- | |- | ||
|4203 || | |4203 || Counterparty with active tasks | ||
|- | |- | ||
|4204 || | |4204 || Is participating in active tasks | ||
|- | |- | ||
|4205 || | |4205 || Counterparty in overdue tasks | ||
|- | |- | ||
|4206 || | |4206 || Is participating in overdue tasks | ||
|- | |- | ||
|4001 || | |4001 || First or last name of contact / Company name | ||
| rowspan="9" | | | rowspan="9" | | ||
*equal | *equal | ||
*notequal | *notequal | ||
| rowspan="9" | string - | | rowspan="9" | string - filter contains / doesn't contain | ||
|- | |- | ||
|4002 || | |4002 || Position | ||
|- | |- | ||
|4003 || | |4003 || Phone number | ||
|- | |- | ||
|4004 || | |4004 || Address | ||
|- | |- | ||
|4005 || Email | |4005 || Email | ||
|- | |- | ||
|4221 || | |4221 || Additional email | ||
|- | |- | ||
|4014 || | |4014 || Contact first name / Company name | ||
|- | |- | ||
|4015 || | |4015 || Contact last name | ||
|- | |- | ||
|4101 || | |4101 || Custom String field | ||
|- | |- | ||
|4102 || | |4102 || Custom Number field | ||
| | | | ||
*equal | *equal | ||
Line 203: | Line 203: | ||
| int | | int | ||
|- | |- | ||
|4105 || | |4105 || Custom Checkbox field | ||
| | | | ||
*equal | *equal | ||
Line 210: | Line 210: | ||
boolean | boolean | ||
|- | |- | ||
|4106 || | |4106 || Custom List field | ||
| | | | ||
*equal | *equal | ||
Line 216: | Line 216: | ||
| string | | string | ||
|- | |- | ||
|4107 || | |4107 || Custom Directory field | ||
| | | | ||
*equal | *equal | ||
*notequal | *notequal | ||
| int - | | int - entry ID | ||
|- | |- | ||
|4114 || | |4114 || Custom Directory Entry Set field | ||
| | | | ||
*equal | *equal | ||
*notequal | *notequal | ||
| int - | | int - entry ID, semicolon-delimited ; | ||
|- | |- | ||
|4111 || | |4111 || Custom Set of Values field | ||
| | | | ||
*equal | *equal | ||
*notequal | *notequal | ||
| string - | | string - string - value, semicolon-delimited; | ||
|- | |- | ||
|4152 || | |4152 || Does contain a value in a custom field | ||
| rowspan="2"| | | rowspan="2"| | ||
*equal | *equal | ||
| rowspan="2"| | | rowspan="2"| | ||
int - | int - field identifier | ||
|- | |- | ||
|4153 || | |4153 || Does not contain a value in a custom field | ||
|- | |- | ||
|4008 || | |4008 || Contact group | ||
| | | | ||
*equal | *equal | ||
*notequal | *notequal | ||
| int - | | int - group ID, get using /contact/groups method | ||
|- | |- | ||
|4016 || | |4016 || Contact template | ||
| | | | ||
*equal | *equal | ||
*notequal | *notequal | ||
| int - | | int - template number, get list of contact templates using /contact/templates method | ||
|- | |- | ||
|4231 || | |4231 || Contact number | ||
| | | | ||
*equal | *equal | ||
*notequal | *notequal | ||
| int - | | int - Contact number | ||
|- | |- | ||
|} | |} | ||
== | == Go To == | ||
*[[REST API]] | *[[REST API]] |
Revision as of 13:46, 17 August 2023
Planfix applies complex filters in the /contact/list method when getting a list of contacts using the REST API. Contact filters are defined using the following parameters:
- type — numeric identifier of the filter.
- operator — filter operator, value from list (equal, notequal, gt, lt). Different filters can have different possible operators.
- value — filter value, depending on filter type can be string, number, or complex object.
- field — custom field ID, used for filters on custom fields.
{ "type": 12, "operator": "equal", "value": { "dateType": "otherDate", "dateValue": "01-07-2022" } }
A call requesting a list of contacts with multiple filters (using AND logic):
{ "fields": "name", "filters": [{ "type": 4223, "operator": "equal", "value": { "dateType": "otherDate", "dateValue": "01-12-1990" } }, { "type": 1, "operator": "equal", "value": "user:5" } ] }
Type | Name | Operators | Value format |
---|---|---|---|
12 | Creation date |
|
Object : "value": { "dateType": string, "dateValue": string, "dateFrom": string, "dateTo": string } dateType takes the following values:
Dates are taken in the time zone of the employee making the call. Example: "value": { "dateType": "thisWeek" } "value": { "dateType": "otherRange", "dateFrom": "02-07-2022", "dateTo": "06-07-2022" } "value": { "dateType": "otherDate_withTime", "dateFrom": "30-06-2022 12:00", } |
38 | Дата последнего изменения | ||
4223 | Date of birth (with year) | ||
4011 | Date of birth (without year) | ||
4213 | Counterparty in tasks with recent activity | ||
4219 | Counterparty without tasks with recent activity | ||
4214 | Is participating in tasks with recent activity | ||
4220 | Is not participating in tasks with recent activity | ||
4103 | Custom Date field | ||
1 | Added |
|
string - employee/contact/group number with prefix.
Example: "user:1", "contact:5", "group:3" |
2 | Supervisor | ||
47 | Is available to | ||
48 | Can be edited by | ||
4108 | Custom Contact field | ||
4109 | Custom Employee field | ||
4112 | Custom Group, Employee, Contact field | ||
4113 | Custom Employee List field | ||
4006 | Is a company |
|
int - 1
boolean - true |
4007 | Is a contact | ||
4010 | With Planfix access | ||
4012 | Cannot be participant in tasks | ||
4017 | Can be counterparty in tasks | ||
4013 | Cannot be a counterparty in tasks | ||
4018 | Cannot be a counterparty in tasks | ||
4201 | Counterparty with no active tasks | ||
4202 | Is not participating in active tasks | ||
4203 | Counterparty with active tasks | ||
4204 | Is participating in active tasks | ||
4205 | Counterparty in overdue tasks | ||
4206 | Is participating in overdue tasks | ||
4001 | First or last name of contact / Company name |
|
string - filter contains / doesn't contain |
4002 | Position | ||
4003 | Phone number | ||
4004 | Address | ||
4005 | |||
4221 | Additional email | ||
4014 | Contact first name / Company name | ||
4015 | Contact last name | ||
4101 | Custom String field | ||
4102 | Custom Number field |
|
int |
4105 | Custom Checkbox field |
|
int - 1 / 0
boolean |
4106 | Custom List field |
|
string |
4107 | Custom Directory field |
|
int - entry ID |
4114 | Custom Directory Entry Set field |
|
int - entry ID, semicolon-delimited ; |
4111 | Custom Set of Values field |
|
string - string - value, semicolon-delimited; |
4152 | Does contain a value in a custom field |
|
int - field identifier |
4153 | Does not contain a value in a custom field | ||
4008 | Contact group |
|
int - group ID, get using /contact/groups method |
4016 | Contact template |
|
int - template number, get list of contact templates using /contact/templates method |
4231 | Contact number |
|
int - Contact number |