Planfix API project.getList: Difference between revisions

From Planfix
Jump to: navigation, search
No edit summary
No edit summary
Line 45: Line 45:
|target || enum ||filter by tab ||not required. for a list of valid values see the [[Planfix API: tab filter for projects section | tab filter for projects section]]
|target || enum ||filter by tab ||not required. for a list of valid values see the [[Planfix API: tab filter for projects section | tab filter for projects section]]
|-
|-
|status || enum ||filter by status ||not required. for a list of valid values for this field, see the [[Planfix API: Project statuses|project statuses]] section  
|status || enum ||filter by status ||not required. for a list of valid values for this field, see the [[Planfix API: Project statuses|project statuses]] section.
|-
|-
|sortType ||enum ||sorting type ||not required. for a list of valid values, see the [[Planfix API:sorting types for projects|sorting types for projects]] section  
|sortType ||enum ||sorting type ||not required. for a list of valid values, see the [[Planfix API:sorting types for projects|sorting types for projects]] section.
|-
|-
|pageCurrent || int|| постраничная навигация ||не обязательный параметр. значение меньше 1 или отсутствие этого параметра будут инициировать процедуру подсчета количества элементов.
|pageCurrent || int|| page navigation ||not required. values less than 1 or omitting this parameter will initiate the procedure for counting the number of elements.
|-
|-
|pageSize ||int || количество выдаваемых значений в результате. не может превышать значение '''100''' ||не обязательный параметр. если будет опущен, возьмется значение по умолчанию.
|pageSize ||int || number of values returned. cannot exceed '''100''' ||parameter not required. if omitted, the default value is used.
|-
|-
|client || || ||не обязательный параметр
|client || || ||not required
|-
|-
|client.id ||int || идентификатор контрагента, выступает в качестве фильтра ||
|client.id ||int || counterparty identifier, works as a filter ||
|-
|-
|filters || || дополнительные сложные фильтры || перечень и формат допустимых значений смотри в разделе [[ПланФикс API:Фильтры проектов|фильтры проектов]]
|filters || || additional complex filters || for a list of available values and formats, see the [[Planfix API:project filters |project filters]] section.
|-
|-
|signature ||string(32) || подпись ||
|signature ||string(32) || signature ||
|-
|-
|}
|}
Все параметры, за исключением '''account''', '''sid''', '''signature ''' не являются обязательными. Если опустить параметр '''user''', то будет получен список проектов доступных для текущего пользователя, необходимо помнить что только администраторы могут смотреть проекты других участников.  
All parameters except '''account''', '''sid''', and '''signature ''' are not required. If the '''user''' parameter is omitted, you will get a list of projects available for the current user. Keep in mind that only administrators can view projects of other participants.


Ответ:
Response:
<source lang="xml">
<source lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
Line 119: Line 119:
</source>
</source>
{| class="wikitable" style="margin-top: 1em; width:100% "
{| class="wikitable" style="margin-top: 1em; width:100% "
!width="150"|Название !!width="200"| Тип !!width="50%"| Значение !! Примечание
!width="150"|Name !!width="200"| Type !!width="50%"| Value !! Notes
|-
|-
|'''projects''' || || корневой элемент, содержит список проектов ||
|'''projects''' || || root element, contains a list of projects ||
|-
|-
|'''projects''' count ||int || количество узлов/проектов возвращенных в результате выполнения запроса ||
|'''projects''' count ||int || number of nodes/projects returned as a result of the request ||
|-
|-
|'''projects''' totalCount||int ||количество проектов удовлетворяющих запросу ||
|'''projects''' totalCount||int ||number of projects satisfying the request ||
|-
|-
|project || || корневой элемент, описывающий проект в списке ||
|project || || root element that describes a project in the list ||
|-
|-
|id ||int ||идентификатор проекта ||
|id ||int ||project identifier ||
|-
|-
|title ||string || название проекта||
|title ||string || project name||
|-
|-
|description ||string ||описание проекта ||
|description ||string ||project description ||
|-
|-
|owner || || владелец/создатель проекта||
|owner || || project owner/creator||
|-
|-
|owner.id ||int ||идентификатор пользователя ||
|owner.id ||int ||user identifier ||
|-
|-
|owner.name || string||имя пользователя, создавшего проект ||
|owner.name || string||name of the user who created the project ||
|-
|-
|client || || контрагент||
|client || || counterparty||
|-
|-
|client.id ||int || идентификатор контрагента||
|client.id ||int || counterparty identifier||
|-
|-
|client.name ||string || имя контрагента ||
|client.name ||string || counterparty name ||
|-
|-
|group|| || группа проектов||
|group|| || project group||
|-
|-
|group.id ||int || идентификатор группы проектов||
|group.id ||int || project group identifier||
|-
|-
|group.name ||string || название группы проектов ||
|group.name ||string || project group name ||
|-
|-
|parent|| || надпроект||
|parent|| || parent project||
|-
|-
|parent.id ||int || идентификатор надпроекта ||
|parent.id ||int || parent project identifier ||
|-
|-
|template|| || шаблон||
|template|| || template||
|-
|-
|template.id ||int || идентификатор шаблона ||
|template.id ||int || template identifier ||
|-
|-
|status || enum||статус в котором находится сейчас проект || перечень допустимых значений для данного поля смотри в разделе [[ПланФикс API:Статусы проектов|статусы проектов]]
|status || enum||current project status ||for a list of valid values for this field, see the project statuses [[Planfix API:project statuses|project statuses]] section
|-
|-
|hidden ||bool || скрытый ||
|hidden ||bool || hidden ||
|-
|-
|hasEndDate ||bool || признак того, что для проекта установлена дата окончания||
|hasEndDate ||bool || indicator of whether or not the project has an end date||
|-
|-
|endDate ||DateTime || дата окончания проекта || установлена, только при '''hasEndDate''' = ''true''
|endDate ||DateTime ||project end date || only set when '''hasEndDate''' = ''true''
|-
|-
|beginDate || DateTime||дата создания проекта ||
|beginDate || DateTime||project creation date||
|-
|-
|taskCount ||int ||количество задач в проекте ||
|taskCount ||int ||number of tasks in the project ||
|-
|-
|isOverdued ||bool || признак того, что проект просрочен ||
|isOverdued ||bool || attribute that indicates if the project is overdue ||
|-
|-
|isCloseToDeadline ||bool ||осталось 25% времени до завершения или прошло 75% отведенного времени на выполнение его  ||
|isCloseToDeadline ||bool ||time left until deadline is 25%, or 75% of dedicated time has passed ||
|-
|-
|customData ||  ||значения пользовательских полей задачи ||
|customData ||  ||values of task custom fields ||
|-
|-
|customData.customValue.field.id ||  ||идентификатор пользовательского поля ||
|customData.customValue.field.id ||  ||custom field identifier ||
|-
|-
|customData.customValue.field.name||  ||название пользовательского поля ||
|customData.customValue.field.name||  ||custom field name ||
|-
|-
|customData.customValue.value ||  ||значение пользовательского поля ||
|customData.customValue.value ||  ||custom field value ||
|-
|-
|customData.customValue.text ||  ||текстовое значение пользовательского поля ||
|customData.customValue.text ||  || text value of the custom field ||
|-
|-
|}
|}
Атрибут '''totalCount''' у элемента '''projects''' показывает сколько всего может быть возвращено данным запросом проектов. Это позволяет избежать дополнительный запрос на полный подсчет количества проектов. Если требуется узнать только количество элементов, достаточно послать запрос с параметром '''pageCurrent'''=0.
The attribute '''totalCount''' of the '''projects''' element shows how many projects can be returned by this request. This prevents you from having to additionally request the total number of projects. If you only need to know the number of elements, send a request with the parameter '''pageCurrent'''=0.


Пустой ответ не '''генерирует ошибку'''. Если в результирующую выборку не попадают никакие проекты, то ответ будет иметь следующую форму:
An empty response will not generate an error. If there are no projects in the resulting selection, the response will look as follows:
<source lang="xml">
<source lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
Line 198: Line 198:
</source>
</source>


В противном случае будет возвращен ответ с ошибкой:
Otherwise, an error response will be returned:
<source lang="xml">
<source lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
Line 207: Line 207:




== Перейти ==
== Go To ==
*[[ПланФикс API:Проекты]]
*[[Planfix API: Projects]]
*[[Коды ошибок]]
*[[Error codes]]
*[[Список функций]]
*[[List of functions]]

Revision as of 09:02, 3 August 2022

Function for getting a list of projects. Request format:

<?xml version="1.0" encoding="UTF-8"?>
<request method="project.getList">
  <account></account>
  <sid></sid>
  <user>
    <id></id>
  </user>
  <target></target>
  <status></status>
  <sortType></sortType>
  <pageCurrent></pageCurrent>
  <pageSize></pageSize>
  <client>
    <id></id>
  </client>
  <filters>
    <filter>
      <type></type>
      <operator></operator>
      <value></value>
      <field></field>
      ...
    </filter>
    ...
  </filters>
  <signature></signature>
</request>
Name Type Value Notes
user Planfix user not required. use in order to view projects in which the specified user is participating. this parameter should only be used if a request is made from an account with admin rights
user.id int user identifier
target enum filter by tab not required. for a list of valid values see the tab filter for projects section
status enum filter by status not required. for a list of valid values for this field, see the project statuses section.
sortType enum sorting type not required. for a list of valid values, see the sorting types for projects section.
pageCurrent int page navigation not required. values less than 1 or omitting this parameter will initiate the procedure for counting the number of elements.
pageSize int number of values returned. cannot exceed 100 parameter not required. if omitted, the default value is used.
client not required
client.id int counterparty identifier, works as a filter
filters additional complex filters for a list of available values and formats, see the project filters section.
signature string(32) signature

All parameters except account, sid, and signature are not required. If the user parameter is omitted, you will get a list of projects available for the current user. Keep in mind that only administrators can view projects of other participants.

Response:

<?xml version="1.0" encoding="UTF-8"?>
<response status="ok">
  <projects count="count" totalCount="totalCount">
    <project>
      <id></id>
      <title></title>
      <description></description>
      <owner>
        <id></id>
        <name></name>
      </owner>
      <client>
        <id></id>
        <name></name>
      </client>
      <group>
        <id></id>
        <name></name>
      </group>
      <parent>
        <id></id>
      </parent>
      <template>
        <id></id>
      </template>
      <status></status>
      <hidden></hidden>
      <hasEndDate></hasEndDate>
      <endDate></endDate>
      <beginDate></beginDate>
      <taskCount></taskCount>
      <isOverdued></isOverdued>
      <isCloseToDeadline></isCloseToDeadline>
      <customData>
        <customValue>
          <field>
            <id></id>
            <name></name>
          </field>
          <value></value>
          <text></text>
        </customValue>
        <customValue>
          <!-- ... -->
        </customValue>
        <!-- ... -->
      </customData>
    </project>
    <!-- ... -->
  </projects>
</response>
Name Type Value Notes
projects root element, contains a list of projects
projects count int number of nodes/projects returned as a result of the request
projects totalCount int number of projects satisfying the request
project root element that describes a project in the list
id int project identifier
title string project name
description string project description
owner project owner/creator
owner.id int user identifier
owner.name string name of the user who created the project
client counterparty
client.id int counterparty identifier
client.name string counterparty name
group project group
group.id int project group identifier
group.name string project group name
parent parent project
parent.id int parent project identifier
template template
template.id int template identifier
status enum current project status for a list of valid values for this field, see the project statuses project statuses section
hidden bool hidden
hasEndDate bool indicator of whether or not the project has an end date
endDate DateTime project end date only set when hasEndDate = true
beginDate DateTime project creation date
taskCount int number of tasks in the project
isOverdued bool attribute that indicates if the project is overdue
isCloseToDeadline bool time left until deadline is 25%, or 75% of dedicated time has passed
customData values of task custom fields
customData.customValue.field.id custom field identifier
customData.customValue.field.name custom field name
customData.customValue.value custom field value
customData.customValue.text text value of the custom field

The attribute totalCount of the projects element shows how many projects can be returned by this request. This prevents you from having to additionally request the total number of projects. If you only need to know the number of elements, send a request with the parameter pageCurrent=0.

An empty response will not generate an error. If there are no projects in the resulting selection, the response will look as follows:

<?xml version="1.0" encoding="UTF-8"?>
<response status="ok">
  <projects count="0" totalCount="0"></projects>
</response>

Otherwise, an error response will be returned:

<?xml version="1.0" encoding="UTF-8"?>
<response status="error">
  <code></code>
</response>


Go To