Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.
Комментарий: Published by Scroll Versions from space TMINT and version 6.11
Sv translation
languageru

Описание: Список групп

Метод: GET

Ресурс: group

Параметры:

  • filter — список фильтрации:
    • change_date[from] — от даты последнего изменения в формате UNIX-timestamp (можно использовать отдельно от change_date[to])
    • change_date[to] — до даты последнего изменения в формате UNIX-timestamp (можно использовать отдельно от change_date[from])
    • create_date[from] — от даты создания в формате UNIX-timestamp (можно использовать отдельно от create_date[to])
    • create_date[to] — до даты создания в формате UNIX-timestamp (можно использовать отдельно от create_date[from]
    • is_deleted — флаг 1 или 0. Если параметр указан, то будут выдавать сущности с указанным значением
    • disabled — флаг 1 или 0, признак активности. Если выставлен, то сущность неактивна (признак берется из LDAP)
    • contact_type[] — фильтрация по типу контакта (можно передать несколько, например: /xapi/group?filter[contact_type][]=webaccount&filter[contact_type][]=icq)
    • contact_value[] — фильтрация по значению контакта (можно передавать несколько, например: /xapi/group?filter[contact_value][]=user@ad&filter[contact_value][]=login@example.com)
    • parent_group_id[] — фильтрация по группам (можно передать несколько, например: /xapi/group?filter[parent_group_id][]=FCE1409680E5D6469E1F7998266CE9E9&filter[parent_group_id][]=918462B6DC2C954BAAF8706F7DC53F14)
  • with[] — список дополнительных сущностей, которые должны быть добавлены к объекту:
    • contacts — контакты группы
    • children — подчиненные группы
  • sort — параметр для сортировки
    • change_date — сортировать по дате изменения asc или desc (например: /xapi/group?sort[change_date]=asc) (предупреждение) может замедлить выдачу  

 

  • start — с какой позиции начать отдавать элементы, по-умолчанию 0
  • limit — сколько элементов отдавать, по-умолчанию 100, не может быть больше 1000

 

Ответ    : Список персон, описанный следующей JSON-Schema:  

JSON схема отдачи 

 

 {
    "type": "object",
    "required": [
        "data",
        "meta"
    ],
    "properties": {
        "data": {
            "description": "Массив групп",
            "type": "array",
            "items": {
                "description": "Группа",
                "type": "object",
                "required": [
                    "GROUP_ID",
                    "CREATE_DATE",
                    "CHANGE_DATE",
                    "DISPLAY_NAME",
                    "DISTINGUISHEDNAME",
                    "GROUP_TYPE",
                    "IS_VISIBLE",
                    "IS_DELETED",
                    "childrenCount"
                ],
                "properties": {
                    "GROUP_ID": {
                        "description": "Уникальный индентификатор группы",
                        "type": "string"
                    },
                    "CREATE_DATE": {
                        "description": "Дата создания записи",
                        "type": "string"
                    },
                    "CHANGE_DATE": {
                        "description": "Дата изменения записи",
                        "type": "string"
                    },
                    "DISPLAY_NAME": {
                        "description": "Название группы",
                        "type": "string"
                    },
                    "DISTINGUISHEDNAME": {
                        "description": "Полное имя",
                        "type": "string"
                    },
                    "GROUP_TYPE": {
                        "description": "Тип группы (tmRoot, tmGroup, adRoot, adGroup, adContainer, adDomain, adOU from LDAP objectclass)",
                        "type": "string"
                    },
                    "IS_VISIBLE": {
                        "description": "Видимость группы",
                        "type": "integer"
                    },
                    "IS_DELETED": {
                        "description": "Удалена ли группа из TM",
                        "type": "integer"
                    },
                    "childrenCount": {
                        "description": "Количество детей в группе",
                        "type": "integer"
                    },
                    "contacts": {
                        "description": "Массив контактов",
                        "type": "array",
                        "items": {
                            "description": "Контакт",
                            "type": "object",
                            "required": [
                                "CONTACT_ID",
                                "CREATE_DATE",
                                "CHANGE_DATE",
                                "CONTACT_TYPE",
                                "VALUE",
                                "IS_PERSONAL",
                                "IS_PRIMARY",
                                "SOURCE"
                            ],
                            "properties": {
                                "CONTACT_ID": {
                                    "description": "Уникальный идентификатор объекта",
                                    "type": "string"
                                },
                                "CREATE_DATE": {
                                    "description": "Дата создания",
                                    "type": "string"
                                },
                                "CHANGE_DATE": {
                                    "description": "Дата изменения",
                                    "type": "string"
                                },
                                "CONTACT_TYPE": {
                                    "description": "Тип",
                                    "type": "string"
                                },
                                "VALUE": {
                                    "description": "Значение",
                                    "type": "string"
                                },
                                "IS_PERSONAL": {
                                    "description": "Принадлежность (Рабочий, Личный)",
                                    "type": "integer"
                                },
                                "IS_PRIMARY": {
                                    "description": "Признак основной",
                                    "type": "integer"
                                },
                                "SOURCE": {
                                    "description": "Тип",
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "children": {
                        "description": "Массив групп принадлежащих текущей группе",
                        "type": "array",
                        "items": {
                            "description": "Группа",
                            "type": "object",
                            "properties": {
                                "GROUP_ID": {
                                    "description": "Уникальный идентификатор группы",
                                    "type": "string"
                                },
                                "PARENT_GROUP_ID": {
                                    "description": "Уникальный идентификатор группы родителя",
                                    "type": "string"
                                },
                                "RELATION_TYPE": {
                                    "description": "Тип связи: 0 - tm, 1 - member, 2 - distinguishedname",
                                    "type": "integer"
                                }
                            }
                        }
                    }
                }
            },
            "meta": {
                "description": "Дополнительные данные",
                "type": "object",
                "required": [
                    "totalCount",
                    "start",
                    "limit"
                ],
                "properties": {
                    "totalCount": {
                        "type": "integer",
                        "description": "Общее количество"
                    },
                    "start": {
                        "type": "integer",
                        "description": "С какой позиции началось отдаваться"
                    },
                    "limit": {
                        "type": "integer",
                        "description": "Сколько всего отдалось"
                    }
                }
            }
        }
    }

Пример:

Запрос 

/xapi/group?filter[change_date][from]=1&filter[change_date][to]=2&with[]=contacts&with[]=children&limit=10&sort[change_date]=asc
Sv translation
languageen

Description: the list of groups

Method: GET

Resource: group

Parameters:

  • filter — the filter list:
    • change_date[from] — since the date of the last change in UNIX-timestamp format (can be used separately from change_date[to])
    • change_date[to] — up to the date of the last change in UNIX-timestamp format (can be used separately from change_date[from])
    • create_date[from] — since the date of the last change in UNIX-timestamp format (can be used separately from create_date[to])
    • create_date[to] — up to the date of the last change in UNIX-timestamp format (can be used separately from create_date[from]
    • is_deleted — flag 1 or 0. If the parameter is specified, then entities with the specified value will be returned
    • disabled — flag 1 or 0, indicates activity. If the flag is set, then the entity is inactive (the flag is obtained from LDAP)
    • contact_type[] — filtering by the contact type (several values can be passed, e.g., /xapi/group?filter[contact_type][]=webaccount&filter[contact_type][]=icq)
    • contact_value[] — filtering by the contact value (several values can be passed, e.g., /xapi/group?filter[contact_value][]=user@ad&filter[contact_value][]=login@example.com )
    • parent_group_id[] — filtering by groups (several values can be passed, e.g., /xapi/group?filter[parent_group_id][]=FCE1409680E5D6469E1F7998266CE9E9&filter[parent_group_id][]=918462B6DC2C954BAAF8706F7DC53F14)
  • with[] — the list of additional entities to be added to the object:
    • contacts — group contacts
    • children — child groups
  • sort — parameter for sorting
    • change_date — sort by the modification date asc or desc (e.g., /xapi/group?sort[change_date]=asc) (предупреждение) may slow down returning the result   
  • start — a start position for returning items, the default value is 0
  • limit — how many items to return (the default value is 100, cannot be more than 1000

 

Response: The list of persons described with the following JSON Schema:   

JSON returning schema  

 

  {
     "$schema" :  "http://json-schema.org/draft-04/schema#" ,
     "type" :  "object" ,
     "required" : [
         "data" ,
         "meta"
     ],
     "properties" : {
         "data" : {
             "description" :  "Array of groups" ,
             "type" :  "array" ,
             "items" : {
                 "description" :  "Group" ,
                 "type" :  "object" ,
                 "required" : [
                     "GROUP_ID" ,
                     "CREATE_DATE" ,
                     "CHANGE_DATE" ,
                     "DISPLAY_NAME" ,
                     "DISTINGUISHEDNAME" ,
                     "GROUP_TYPE" ,
                     "IS_VISIBLE" ,
                     "IS_DELETED" ,
                     "childrenCount"
                 ],
                 "properties" : {
                     "GROUP_ID" : {
                         "description" :  "A unique identifier of the group" ,
                         "type" :  "string"
                     },
                     "CREATE_DATE" : {
                         "description" :  "Entry creation date" ,
                         "type" :  "string"
                     },
                     "CHANGE_DATE" : {
                         "description" :  "Entry modification date" ,
                         "type" :  "string"
                     },
                     "DISPLAY_NAME" : {
                         "description" :  "Group name" ,
                         "type" :  "string"
                     },
                     "DISTINGUISHEDNAME" : {
                         "description" :  "Full name" ,
                         "type" :  "string"
                     },
                     "GROUP_TYPE" : {
                         "description" :  "Group type (tmRoot, tmGroup, adRoot, adGroup, adContainer, adDomain, adOU from LDAP objectclass)" ,
                         "type" :  "string"
                     },
                     "IS_VISIBLE" : {
                         "description" :  "Group visibility" ,
                         "type" :  "integer"
                     },
                     "IS_DELETED" : {
                         "description" :  "Whether the group is deleted from TM" ,
                         "type" :  "integer"
                     },
                     "childrenCount" : {
                         "description" :  "The number of child elements in the group" ,
                         "type" :  "integer"
                     },
                     "contacts" : {
                         "description" :  "Array of contacts" ,
                         "type" :  "array" ,
                         "items" : {
                             "description" :  "Contact" ,
                             "type" :  "object" ,
                             "required" : [
                                 "CONTACT_ID" ,
                                 "CREATE_DATE" ,
                                 "CHANGE_DATE" ,
                                 "CONTACT_TYPE" ,
                                 "VALUE" ,
                                 "IS_PERSONAL" ,
                                 "IS_PRIMARY" ,
                                 "SOURCE"
                             ],
                             "properties" : {
                                 "CONTACT_ID" : {
                                     "description" :  "Object unique identifier" ,
                                     "type" :  "string"
                                 },
                                 "CREATE_DATE" : {
                                     "description" :  "Creation date" ,
                                     "type" :  "string"
                                 },
                                 "CHANGE_DATE" : {
                                     "description" :  "Modification date" ,
                                     "type" :  "string"
                                 },
                                 "CONTACT_TYPE" : {
                                     "description" :  "Type" ,
                                     "type" :  "string"
                                 },
                                 "VALUE" : {
                                     "description" :  "Value" ,
                                     "type" :  "string"
                                 },
                                 "IS_PERSONAL" : {
                                     "description" :  "Belongs to (Work, Personal)" ,
                                     "type" :  "integer"
                                 },
                                 "IS_PRIMARY" : {
                                     "description" :  "Is primary" ,
                                     "type" :  "integer"
                                 },
                                 "SOURCE" : {
                                     "description" :  "Type" ,
                                     "type" :  "string"
                                 }
                             }
                         }
                     },
                     "children" : {
                         "description" :  "An array of groups which belong to the current group" ,
                         "type" :  "array" ,
                         "items" : {
                             "description" :  "Group" ,
                             "type" :  "object" ,
                             "properties" : {
                                 "GROUP_ID" : {
                                     "description" :  "A unique identifier of the group" ,
                                     "type" :  "string"
                                 },
                                 "PARENT_GROUP_ID" : {
                                     "description" :  "A unique identifier of the parent group" ,
                                     "type" :  "string"
                                 },
                                 "RELATION_TYPE" : {
                                     "description" :  "Connection type: 0 - tm, 1 - member, 2 - distinguishedname" ,
                                     "type" :  "integer"
                                 }
                             }
                         }
                     }
                 }
             },
             "meta" : {
                 "description" :  "Additional data" ,
                 "type" :  "object" ,
                 "required" : [
                     "totalCount" ,
                     "start" ,
                     "limit"
                 ],
                 "properties" : {
                     "totalCount" : {
                         "type" :  "integer" ,
                         "description" :  "Total number"
                     },
                     "start" : {
                         "type" :  "integer" ,
                         "description" :  "A position from which returning started"
                     },
                     "limit" : {
                         "type" :  "integer" ,
                         "description" :  "Total number of returned items"
                     }
                 }
             }
         }
     }

 

Example:

Query  

 

/xapi/group?filter[change_date][from]=1&filter[change_date][to]=2& with []=contacts& with []=children&limit=10&sort[change_date]=asc