REST API: Complex contact filters: Difference between revisions

From Planfix
Jump to: navigation, search
(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:
{{#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.
Например: “user:1”, “contact:5”, “group:3”
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 || Дополнительный email
|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 - идентификатор группы, можно получить методом /contact/groups
| int - group ID, get using /contact/groups method
|-
|-
|4016 || Шаблон контакта
|4016 || Contact template
|  
|  
*equal
*equal
*notequal
*notequal
| int - номер шаблона, список шаблонов контактов можно получить методом /contact/templates
| 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
  • equal
  • notequal
  • gt
  • lt

Object :

 
"value": {
    "dateType": string,
    "dateValue": string,
    "dateFrom": string,
    "dateTo": string
}

dateType takes the following values:

  • today - today
  • yesterday
  • tomorrow
  • thisWeek
  • lastWeek
  • nextWeek
  • thisMonth
  • lastMonth
  • nextMonth
  • last - last 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
  • otherDate - exact date, date is passed in dd-mm-yyyy format in dateFrom
  • otherRange - exact range, date is passed in dd-mm-yyyy format in dateFrom and dateTo
  • otherDate_withTime - exact date and time, date passed in dd-mm-yyyy hh:mm format in dateFrom
  • otherRange_withTime - exact range with time, date is passed in dd-mm-yyyy hh:mm format in dateFrom and dateTo

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
  • equal
  • notequal
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
  • equal
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
  • equal
  • notequal
string - filter contains / doesn't contain
4002 Position
4003 Phone number
4004 Address
4005 Email
4221 Additional email
4014 Contact first name / Company name
4015 Contact last name
4101 Custom String field
4102 Custom Number field
  • equal
  • notequal
  • gt
  • lt
int
4105 Custom Checkbox field
  • equal
  • notequal
int - 1 / 0

boolean

4106 Custom List field
  • equal
  • notequal
string
4107 Custom Directory field
  • equal
  • notequal
int - entry ID
4114 Custom Directory Entry Set field
  • equal
  • notequal
int - entry ID, semicolon-delimited ;
4111 Custom Set of Values field
  • equal
  • notequal
string - string - value, semicolon-delimited;
4152 Does contain a value in a custom field
  • equal

int - field identifier

4153 Does not contain a value in a custom field
4008 Contact group
  • equal
  • notequal
int - group ID, get using /contact/groups method
4016 Contact template
  • equal
  • notequal
int - template number, get list of contact templates using /contact/templates method
4231 Contact number
  • equal
  • notequal
int - Contact number


Go To