Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  • RESTfull JSON API
  • RESTfull JSON API

    Доступно с версии 0.84

    Рекомендуемая минимальная версия для использования 1.00

    Table of Contents
    maxLevel3

    Children Display
    sortcreation


    Warning

    В данный момент находиться находится в процессе активной разработки

    API может (и будет) дополняться и изменяться в будущем

    Warning
    titleВерсия

    Доступно с версии 0.84 и выше

    Warning
    titleВерсия

    Чтобы включить API нужно прописать постоянно расширяется и изменяется, следите за новыми версиями

    Общая информация

    Подключение

    Code Block
    $conf{API_ENABLE}
    в файле config.pl
     = 1;

    Конфигурация

    В системе реализован RESTfull RESTful интерфейс управления услугами и абонентами. Интерфейс находит по адресу /api.cgi. Оправка
    Отправка, получение данных производится по протоколу HTTP POST/GET/PUT/DELETE. Все взаимодействие по интерфейсу выполняется по принципам REST (ресурс определяться по средствам задания имени в URL).

    Для сохранение совместимости с стандартом REST все ключи автоматически переводятся в camelCaseв camelCase, но поскольку несоответствие названий в Базе Данных базе данных может усложнить разработку – существует – существует возможность отключить такое превращение используя несколько вариантов:

    1. Параметр $conf{API_FILDS_CAMELIZE} в конфигурационном файле
    2. Задать в заголовках запроса CAMELIZE в соответствующие значение (имеет приоритет над значением в конфигурационном файле)параметрах snakeCase=1 в GET или в POST "snakeCase": "1"
    ЗначениеРезультат
    1Все ключи превращаются в camelCase
    0Ключи в исходном виде, как в базе данных (snake_case)

    Авторизация

    Для подтверждения личности при выполнении запросов, некоторые пути требуют соответствующий привилегии:

    • Авторизация администратора выполняется через API_KEY (можно задать в веб-интерфейсе). Ключ нужно передать в заголовке запроса KEY в значении API_KEY.
    • Пользователям нужно использовать идентификатор сессии (sid), передавая его значение в заголовке USERSID. Для получения sid можно
      воспользоваться авторизацией через API используя маршрут авторизация абонента (/users/login).


    Open API (Swagger) Integration for Confluence
    openapi: 3.0.1
    info:
      title: Abills admins API
      version: 1.0.0
    servers:
    - url: https://demo.abills.net.ua:9443/api.cgi
    tags:
    - name: users
      description: Работа с пользователями
    - name: groups
      description: Группы пользователей
    - name: tp
      description: Тарифные планы
    - name: msgs
      description: Msgs
    - name: internet
      description: Internet
    - name: iptv
      description: Iptv
    - name: abon
      description: Abon
    - name: districts
      description: Районы
    - name: streets
      description: Улицы
    - name: builds
      description: Дома
    - name: payments
      description: Оплаты
    - name: fees
      description: Списания
    - name: online
      description: Сессии пользователя
    - name: version
      description: Версии
    paths:
      /users/login:
        post:
          tags:
          - users
          summary: Авторизация пользователя
          operationId: loginUser
          requestBody:
            content:
              '*/*':
                schema:
                  $ref: '#/components/schemas/UserLogin'
            required: true
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/inline_response_200'
          x-codegen-request-body-name: body
      /users/:
        post:
          tags:
          - users
          summary: Добавить нового пользователя
          operationId: addUser
          requestBody:
            description: Параметры, которые нужно указать
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/User'
            required: true
          responses:
            200:
              description: успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/UserCreated'
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /users/all:
        get:
          tags:
          - users
          summary: Получить всех пользователей
          parameters:
          - name: fio
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: fio2
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: fio3
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: deposit
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: extDeposit
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: extBillId
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: credit
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: creditDate
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: loginStatus
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: phone
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: email
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: floor
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: entrance
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: addressFlat
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: pasportDate
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: pasportNum
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: pasportGrant
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: city
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: zip
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: gid
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: companyId
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: companyName
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: contractId
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: contractSufix
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: contractDate
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: expire
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: reduction
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: lastPayment
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: lastFees
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: registration
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: reductionDate
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: comments
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: billId
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: activate
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: acceptRules
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: password
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: birthDate
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: taxNumber
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: pageRows
            in: query
            description: Количество записей
            schema:
              type: integer
              default: 100000
          - name: sort
            in: query
            description: Сортировка по одному параметру выше
            schema:
              type: string
          responses:
            200:
              description: успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/UserList'
          security:
          - KEY: []
      /users/{UID}:
        get:
          tags:
          - users
          summary: Получить пользователя по UID
          description: Возвращает пользователя
          operationId: getUserByUID
          parameters:
          - name: UID
            in: path
            description: UID пользователя в биллинге
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/User'
            404:
              description: Пользователь не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
        put:
          tags:
          - users
          summary: Обновить информацию о пользователе
          operationId: updateUser
          parameters:
          - name: UID
            in: path
            description: UID пользователь
            required: true
            schema:
              type: integer
              format: int64
          requestBody:
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/User'
            required: true
          responses:
            400:
              description: Invalid ID supplied
              content: {}
          security:
          - KEY: []
          x-codegen-request-body-name: body
        delete:
          tags:
          - users
          summary: Удалить пользователя
          operationId: deleteUser
          parameters:
          - name: UID
            in: path
            description: UID пользователя
            required: true
            schema:
              type: integer
              format: int64
          responses:
            404:
              description: Пользователь не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
      /users/{UID}/pi:
        get:
          tags:
          - users
          summary: Получить персональную информацию о пользователе
          description: Возвращает персональную информацию пользователя
          operationId: getUserPiByUID
          parameters:
          - name: UID
            in: path
            description: UID пользователя в биллинге
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/UserPi'
            404:
              description: Пользователь не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
        put:
          tags:
          - users
          summary: Изменение персональной информации пользователю
          operationId: changeUserPi
          parameters:
          - name: UID
            in: path
            description: UID пользователь
            required: true
            schema:
              type: integer
              format: int64
          requestBody:
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/UserPi'
            required: true
          responses:
            404:
              description: Пользователь не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
          x-codegen-request-body-name: body
        post:
          tags:
          - users
          summary: Добавление персональной информации пользователю
          operationId: addUserPi
          parameters:
          - name: UID
            in: path
            description: UID пользователь
            required: true
            schema:
              type: integer
              format: int64
          requestBody:
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/UserPi'
            required: true
          responses:
            404:
              description: Пользователь не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /users/{UID}/contacts:
        get:
          tags:
          - users
          summary: Получить контакты пользователя по UID
          description: Возвращает контакты пользователя
          operationId: getUserContactsByUID
          parameters:
          - name: UID
            in: path
            description: UID пользователя в биллинге
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ContactsArray'
            404:
              description: Пользователь не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
        post:
          tags:
          - users
          summary: Добавление контакта пользователю
          operationId: updateUserContact
          parameters:
          - name: UID
            in: path
            description: UID пользователь
            required: true
            schema:
              type: integer
              format: int64
          requestBody:
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/User'
            required: true
          responses:
            404:
              description: Пользователь не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /users/{UID}/contacts/{ID}:
        put:
          tags:
          - users
          summary: Обновить контакт пользователю
          operationId: updateUserConctact
          parameters:
          - name: UID
            in: path
            description: UID пользователь
            required: true
            schema:
              type: integer
              format: int64
          - name: ID
            in: path
            description: ID контакта
            required: true
            schema:
              type: integer
              format: int64
          responses:
            404:
              description: Пользователь не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
        delete:
          tags:
          - users
          summary: Удалить контакт пользователя
          operationId: deleteUserContact
          parameters:
          - name: UID
            in: path
            description: UID пользователя
            required: true
            schema:
              type: integer
              format: int64
          - name: ID
            in: path
            description: ID контакта
            required: true
            schema:
              type: integer
              format: int64
          responses:
            404:
              description: Пользователь не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
      /users/contacts:
        post:
          tags:
          - users
          summary: Получить контакты
          description: Возвращает контакты пользователей
          operationId: getContacts
          requestBody:
            description: Параметры для фильтрации контактов
            content:
              '*/*':
                schema:
                  $ref: '#/components/schemas/Contacts'
            required: true
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ContactsArray'
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /users/internet/all:
        get:
          tags:
          - internet
          summary: Получить всех пользователей
          parameters:
          - name: cid
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: cpe_mac
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: vlan
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: server_vlan
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: joinService
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: simultaneonsly
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: speed
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: nasId
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: port
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: allFilterId
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: filterId
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: tpId
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: tpNum
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: tpName
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: monthFee
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: abonDistribution
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: dayFee
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: personalTp
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: paymentType
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: disable
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: ipnActivate
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: dayTrafLimit
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: weekTrafLimit
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: totalTrafLimit
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: feesMethod
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: nasIp
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: fio
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: fio2
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: fio3
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: deposit
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: extDeposit
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: extBillId
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: credit
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: creditDate
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: loginStatus
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: phone
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: email
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: floor
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: entrance
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: addressFlat
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: pasportDate
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: pasportNum
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: pasportGrant
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: city
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: zip
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: gid
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: companyId
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: companyName
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: contractId
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: contractSufix
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: contractDate
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: expire
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: reduction
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: lastPayment
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: lastFees
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: registration
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: reductionDate
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: comments
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: billId
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: activate
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: acceptRules
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: password
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: birthDate
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: taxNumber
            in: query
            description: Параметр который возвращает биллинг
            schema:
              type: boolean
              default: false
          - name: pageRows
            in: query
            description: Количество записей
            schema:
              type: integer
              default: 100000
          - name: sort
            in: query
            description: Сортировка по одному параметру выше
            schema:
              type: string
          responses:
            200:
              description: успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/UserInternetList'
          security:
          - KEY: []
      /users/{UID}/internet:
        get:
          tags:
          - internet
          summary: Получить список ТП Internet пользователя
          description: Возвращает ТП интернет пользователя
          operationId: getUserInternetByUID
          parameters:
          - name: UID
            in: path
            description: UID пользователя в биллинге
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/UserInternetList'
            404:
              description: Пользователь не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
        post:
          tags:
          - internet
          summary: Добавление ТП Internet пользователю
          operationId: addUserInternet
          parameters:
          - name: UID
            in: path
            description: UID пользователь
            required: true
            schema:
              type: integer
              format: int64
          requestBody:
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/UserInternet'
            required: true
          responses:
            404:
              description: Пользователь не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /users/{UID}/internet/{ID}:
        get:
          tags:
          - internet
          summary: Информация об интернет услуге пользователя по ID услуги
          operationId: internetInfoUser
          parameters:
          - name: UID
            in: path
            description: UID пользователь
            required: true
            schema:
              type: integer
              format: int64
          - name: ID
            in: path
            description: ID услуги
            required: true
            schema:
              type: integer
              format: int64
          responses:
            404:
              description: Пользователь не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
      /users/{UID}/iptv:
        get:
          tags:
          - iptv
          summary: Получить список ТП Iptv пользователя
          description: Возвращает ТП Iptv пользователя
          operationId: getUserIptvByUID
          parameters:
          - name: UID
            in: path
            description: UID пользователя в биллинге
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/UserIptvList'
            404:
              description: Пользователь не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
      /users/{UID}/iptv/{ID}:
        get:
          tags:
          - iptv
          summary: Информация об Iptv услуге пользователя по ID услуги
          operationId: iptvInfoUser
          parameters:
          - name: UID
            in: path
            description: UID пользователь
            required: true
            schema:
              type: integer
              format: int64
          - name: ID
            in: path
            description: ID услуги
            required: true
            schema:
              type: integer
              format: int64
          responses:
            404:
              description: Пользователь не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
      /msgs/:
        post:
          tags:
          - msgs
          summary: Добавить сообщение
          operationId: addMsgs
          requestBody:
            description: Параметры, которые нужно указать
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/Msgs'
            required: true
          responses:
            200:
              description: успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiSuccessAddResponse'
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /msgs/{ID}:
        get:
          tags:
          - msgs
          summary: Получить сообщение по ID
          description: Возвращает сообщение
          operationId: getMsgsInfoByID
          parameters:
          - name: ID
            in: path
            description: ID сообщения
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/Msgs'
            404:
              description: Сообщение не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
      /msgs/list:
        post:
          tags:
          - msgs
          summary: Получить список сообщений
          operationId: msgsList
          requestBody:
            description: Параметры, по которым можно фильтровать сообщения
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/Msgs'
            required: true
          responses:
            200:
              description: успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiSuccessAddResponse'
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /msgs/{ID}/reply:
        get:
          tags:
          - msgs
          summary: Ответы на сообщение
          operationId: repliesListToMsgs
          parameters:
          - name: ID
            in: path
            description: ID сообщения
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/MsgsRepliesList'
          security:
          - KEY: []
        post:
          tags:
          - msgs
          summary: Ответить на сообщение
          operationId: addReplyToMsgs
          parameters:
          - name: ID
            in: path
            description: ID сообщения
            required: true
            schema:
              type: integer
              format: int64
          requestBody:
            description: Параметры, которые нужно указать
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/MsgsReply'
            required: true
          responses:
            200:
              description: успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiSuccessAddResponse'
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /msgs/reply/{REPLY_ID}/attachment:
        post:
          tags:
          - msgs
          summary: Прикрепление файла к ответу
          operationId: addAttachmentToReply
          parameters:
          - name: REPLY_ID
            in: path
            description: ID ответа на сообщение
            required: true
            schema:
              type: integer
              format: int64
          requestBody:
            description: Параметры, которые нужно указать
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/MsgsReplyAttachment'
            required: true
          responses:
            200:
              description: успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiSuccessAddResponse'
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /msgs/chapters:
        get:
          tags:
          - msgs
          summary: Получить список разделов
          operationId: chaptersList
          responses:
            200:
              description: успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/MsgsChapter'
          security:
          - KEY: []
      /groups:
        get:
          tags:
          - groups
          summary: Получить группы пользователей
          description: Возвращает группы пользователей
          operationId: getGroupsList
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/Groups'
          security:
          - KEY: []
      /tp/{tpID}:
        get:
          tags:
          - tp
          summary: Получить информацию по тарифному плану
          description: Возвращает тарифный план
          operationId: getTpInfo
          parameters:
          - name: tpID
            in: path
            description: tpID тарифного плана
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/Tp'
            404:
              description: Тарифный план не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
      /tp/{tpID}/intervals/:
        get:
          tags:
          - tp
          summary: Получить информацию по интервалам ТП
          description: Возвращает интервалы ТП
          operationId: getTpIntervalsInfo
          parameters:
          - name: tpID
            in: path
            description: tpID тарифного плана
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/TpIntervals'
            404:
              description: Тарифный план не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
      /districts:
        get:
          tags:
          - districts
          summary: Получить районы
          description: Возвращает список районов
          operationId: getDistricts
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/DistrictsArray'
          security:
          - KEY: []
        post:
          tags:
          - districts
          summary: Добавление района
          operationId: addDistrict
          requestBody:
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/Districts'
            required: true
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiSuccessAddResponse'
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /districts/{ID}:
        get:
          tags:
          - districts
          summary: Получить информацию о районе
          operationId: getDistrictInfo
          parameters:
          - name: ID
            in: path
            description: ID района
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/Districts'
          security:
          - KEY: []
        put:
          tags:
          - districts
          summary: Обновить информацию о районе
          operationId: updateDistrict
          parameters:
          - name: ID
            in: path
            description: ID района
            required: true
            schema:
              type: integer
              format: int64
          requestBody:
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/Districts'
            required: true
          responses:
            400:
              description: Invalid ID supplied
              content: {}
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /streets:
        get:
          tags:
          - streets
          summary: Получить улицы
          description: Возвращает список улиц
          operationId: getStreets
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/StreetsArray'
          security:
          - KEY: []
        post:
          tags:
          - streets
          summary: Добавление района
          operationId: addStreet
          requestBody:
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/Streets'
            required: true
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiSuccessAddResponse'
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /streets/{ID}:
        get:
          tags:
          - streets
          summary: Получить информацию о улице
          description: Возвращает улицу
          operationId: getStreetInfo
          parameters:
          - name: ID
            in: path
            description: ID улицы
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/Streets'
          security:
          - KEY: []
        put:
          tags:
          - streets
          summary: Обновить информацию о улице
          operationId: updateStreet
          parameters:
          - name: ID
            in: path
            description: ID улицы
            required: true
            schema:
              type: integer
              format: int64
          requestBody:
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/Streets'
            required: true
          responses:
            400:
              description: Invalid ID supplied
              content: {}
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /builds:
        get:
          tags:
          - builds
          summary: Получить дома
          description: Возвращает список домов
          operationId: getBuilds
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/BuildsArray'
          security:
          - KEY: []
        post:
          tags:
          - builds
          summary: Добавление дома
          operationId: addBuild
          requestBody:
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/Builds'
            required: true
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiSuccessAddResponse'
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /builds/{ID}:
        get:
          tags:
          - builds
          summary: Получить информацию о доме
          description: Возвращает дом
          operationId: getBuildInfo
          parameters:
          - name: ID
            in: path
            description: ID дома
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/Builds'
          security:
          - KEY: []
        put:
          tags:
          - builds
          summary: Обновить информацию о доме
          operationId: updateBuild
          parameters:
          - name: ID
            in: path
            description: ID дома
            required: true
            schema:
              type: integer
              format: int64
          requestBody:
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/Builds'
            required: true
          responses:
            400:
              description: Invalid ID supplied
              content: {}
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /payments/types:
        get:
          tags:
          - payments
          summary: Получить список типов оплат
          description: Возвращает список типов оплат
          operationId: getPaymentTypesList
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/PaymentTypesArray'
          security:
          - KEY: []
      /payments/users/{UID}:
        get:
          tags:
          - payments
          summary: Получить список оплат пользователя
          description: Возвращает список оплат пользователя
          operationId: getUserPayments
          parameters:
          - name: UID
            in: path
            description: UID пользователя
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/UserPaymentsArray'
          security:
          - KEY: []
        post:
          tags:
          - payments
          summary: Добавление оплаты пользователю
          operationId: addUserPayment
          parameters:
          - name: UID
            in: path
            description: UID пользователя
            required: true
            schema:
              type: integer
              format: int64
          requestBody:
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/UserPaymentAdd'
            required: true
          responses:
            400:
              description: Invalid ID supplied
              content: {}
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /fees/types:
        get:
          tags:
          - fees
          summary: Получить список типов списания
          description: Возвращает список типов списания
          operationId: getFeesTypesList
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/FeesTypesArray'
          security:
          - KEY: []
      /fees/users/{UID}:
        get:
          tags:
          - fees
          summary: Получить список списаний пользователя
          description: Возвращает список списаний пользователя
          operationId: getUserFees
          parameters:
          - name: UID
            in: path
            description: UID пользователя
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/UserFeesArray'
          security:
          - KEY: []
      /fees/users/{UID}/{SUM}:
        post:
          tags:
          - fees
          summary: Добавление списания пользователю
          operationId: addUserFee
          parameters:
          - name: UID
            in: path
            description: UID пользователя
            required: true
            schema:
              type: integer
              format: int64
          - name: SUM
            in: path
            description: Сумма списания
            required: true
            schema:
              type: integer
              format: int64
          requestBody:
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/UserFeeAdd'
            required: true
          responses:
            400:
              description: Invalid ID supplied
              content: {}
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /abon/tariffs:
        get:
          tags:
          - abon
          summary: Получить список ТП
          description: Возвращает список ТП
          operationId: getAbonTps
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/AbonTpsArray'
          security:
          - KEY: []
        post:
          tags:
          - abon
          summary: Добавление ТП
          operationId: addAbonTp
          requestBody:
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/AbonAddTp'
            required: true
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiSuccessAddResponse'
          security:
          - KEY: []
          x-codegen-request-body-name: body
      /abon/tariffs/{ID}:
        get:
          tags:
          - abon
          summary: Получить информацию о ТП
          description: Возвращает информацию о ТП
          operationId: getAbonTp
          parameters:
          - name: ID
            in: path
            description: ID ТП
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/AbonTp'
          security:
          - KEY: []
      /abon/tariffs/{ID}/users/{UID}:
        post:
          tags:
          - abon
          summary: Добавление ТП пользователю
          operationId: addAbonTpToUser
          parameters:
          - name: ID
            in: path
            description: ID ТП
            required: true
            schema:
              type: integer
              format: int64
          - name: UID
            in: path
            description: UID пользователя
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiSuccessAddResponse'
          security:
          - KEY: []
        delete:
          tags:
          - abon
          summary: Удаление ТП пользователя
          description: Удаление ТП пользователя
          operationId: getUserAbonTps
          parameters:
          - name: ID
            in: path
            description: ID ТП
            required: true
            schema:
              type: integer
              format: int64
          - name: UID
            in: path
            description: UID пользователя
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: Успешное выполнение
              content: {}
          security:
          - KEY: []
      /abon/users:
        get:
          tags:
          - abon
          summary: Получить список пользователей Abon
          description: Возвращает список пользователей Abon
          operationId: getUsersAbon
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/AbonUsersArray'
          security:
          - KEY: []
      /online/{UID}:
        get:
          tags:
          - online
          summary: Получить сессии пользователя по UID
          description: Возвращает сессии пользователя
          operationId: getUserSessions
          parameters:
          - name: UID
            in: path
            description: UID пользователя в биллинге
            required: true
            schema:
              type: integer
              format: int64
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/OnlineSessionsArray'
            404:
              description: Пользователь не найден
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/ApiResponse'
          security:
          - KEY: []
      /version:
        get:
          tags:
          - version
          summary: Получить версии биллинга и API
          operationId: getVersion
          responses:
            200:
              description: Успешное выполнение
              content:
                application/json:
                  schema:
                    $ref: '#/components/schemas/Version'
          security:
          - KEY: []
    components:
      schemas:
        User:
          type: object
          properties:
            login:
              type: string
              example: testUser
            password:
              type: string
              example: "123456"
            createBill:
              type: integer
        UserPi:
          type: object
          properties:
            fio:
              type: string
              description: Фамилия
              example: Петренко
            fio2:
              type: string
              description: Имя
              example: Иван
            fio3:
              type: string
              description: Отчество
              example: Петрович
            comments:
              type: string
            email:
              type: string
            phone:
              type: string
        UserCreated:
          type: object
          properties:
            preAdd:
              type: integer
              example: 1
            total:
              type: integer
              example: 0
            insertId:
              type: string
              example: "17"
            uid:
              type: string
              example: "32"
            affected:
              type: integer
              example: 1
            login:
              type: string
              example: testUser
        UserInternetList:
          type: array
          items:
            $ref: '#/components/schemas/UserInternetList_inner'
        UserInternet:
          type: object
          properties:
            tpId:
              type: integer
              example: 41
            cid:
              type: string
              example: 14:11:11:11:11:c1
            activate:
              type: string
              example: 0000-00-00
            expire:
              type: string
              example: 0000-00-00
        UserIptvList:
          type: array
          items:
            $ref: '#/components/schemas/UserIptvList_inner'
        Contacts:
          type: object
          properties:
            value:
              type: string
              example: test@gmail.com
            type:
              type: string
              description: _SHOW - отобразить поле
              example: _SHOW
            typeName:
              type: string
              example: _SHOW
        ContactsArray:
          type: array
          items:
            $ref: '#/components/schemas/ContactsArray_inner'
        Tp:
          type: object
          properties:
            id:
              type: integer
              example: 2
            tpId:
              type: integer
              example: 83
            dayFee:
              type: integer
            monthFee:
              type: integer
            module:
              type: string
              example: Internet
            changePrice:
              type: integer
            activPrice:
              type: integer
            serviceId:
              type: integer
            status:
              type: integer
        TpIntervals:
          type: array
          items:
            $ref: '#/components/schemas/TpIntervals_inner'
        Groups:
          type: array
          items:
            $ref: '#/components/schemas/Groups_inner'
        Msgs:
          type: object
          properties:
            uid:
              type: integer
              example: 11135
            chapter:
              type: integer
              example: 2
            message:
              type: string
              example: Test message
            state:
              type: integer
              example: 0
            subject:
              type: string
              example: Message subject
            priority:
              type: integer
              example: 2
        MsgsReply:
          type: object
          properties:
            aid:
              type: integer
              example: 2
            reply_text:
              type: string
              example: Reply text
        MsgsRepliesList:
          type: array
          items:
            $ref: '#/components/schemas/MsgsRepliesList_inner'
        MsgsReplyAttachment:
          type: object
          properties:
            filename:
              type: string
              example: Test.txt
            filesize:
              type: integer
              example: 12
            content:
              type: string
              example: '  Test content'
            content_type:
              type: string
              example: text/plain
            message_type:
              type: integer
              example: 1
        MsgsChapter:
          type: array
          items:
            $ref: '#/components/schemas/MsgsChapter_inner'
        Districts:
          type: object
          properties:
            name:
              type: string
              example: пос.Зуевка
            city:
              type: string
              example: Харцызск
            zip:
              type: string
        DistrictsArray:
          type: array
          items:
            $ref: '#/components/schemas/DistrictsArray_inner'
        Streets:
          type: object
          properties:
            name:
              type: string
              example: ул.Цэемовская
            district_id:
              type: integer
              example: 2
            second_name:
              type: string
        StreetsArray:
          type: array
          items:
            $ref: '#/components/schemas/StreetsArray_inner'
        Builds:
          type: object
          properties:
            street_id:
              type: integer
              example: 2
            number:
              type: string
        BuildsArray:
          type: array
          items:
            $ref: '#/components/schemas/BuildsArray_inner'
        PaymentTypesArray:
          type: array
          items:
            $ref: '#/components/schemas/PaymentTypesArray_inner'
        UserPaymentsArray:
          type: array
          items:
            $ref: '#/components/schemas/UserPaymentsArray_inner'
        UserPaymentAdd:
          type: object
          properties:
            sum:
              type: integer
              example: 500
            method:
              type: integer
              example: 6
            bill_id:
              type: integer
              example: 10
        FeesTypesArray:
          type: array
          items:
            $ref: '#/components/schemas/FeesTypesArray_inner'
        UserFeesArray:
          type: array
          items:
            $ref: '#/components/schemas/UserFeesArray_inner'
        UserFeeAdd:
          type: object
          properties:
            method:
              type: integer
              example: 6
            bill_id:
              type: integer
              example: 10
            describe:
              type: string
        AbonTpsArray:
          type: array
          items:
            $ref: '#/components/schemas/AbonTpsArray_inner'
        AbonAddTp:
          type: object
          properties:
            price:
              type: integer
              example: 100
            period:
              type: integer
              example: 1
            name:
              type: string
              example: Test abon TP
            description:
              type: string
              example: Test description
        AbonTp:
          type: object
          properties:
            id:
              type: integer
              example: 1
            name:
              type: string
              example: Test abon TP
            price:
              type: integer
              example: 100
            userPortal:
              type: integer
              example: 0
            userCount:
              type: integer
              example: 10
            discount:
              type: integer
              example: 0
            paymentType:
              type: integer
              example: 0
            periodAlignment:
              type: integer
              example: 1
            nextAbonDate:
              type: string
              example: 2021-10-01
            description:
              type: string
        AbonUsersArray:
          type: array
          items:
            $ref: '#/components/schemas/AbonUsersArray_inner'
        OnlineSessionsArray:
          type: array
          items:
            $ref: '#/components/schemas/OnlineSessionsArray_inner'
        Version:
          type: object
          properties:
            version:
              type: string
              example: 0.91.0
            apiVersion:
              type: string
              example: "0.01"
            billing:
              type: string
              example: Abills
        ApiResponse:
          type: object
          properties:
            errstr:
              type: string
              example: ERROR_NOT_EXIST
            errno:
              type: integer
              example: 2
        ApiSuccessAddResponse:
          type: object
          properties:
            total:
              type: integer
              example: 0
            affected:
              type: integer
              example: 1
            insertId:
              type: integer
              example: 37
        UserLogin:
          type: object
          properties:
            login:
              type: string
              example: testuser
            password:
              type: string
              example: testuser
        inline_response_200:
          type: object
          properties:
            login:
              type: string
              example: testuser
            sid:
              type: string
              example: sW44EJZLyWDMeXAV
            uid:
              type: string
              example: "5690"
        UserInternetList_inner:
          type: object
          properties:
            id:
              type: integer
              example: 2
            tpName:
              type: string
              example: Премиум до 100м
            tpId:
              type: integer
              example: 41
            internetStatus:
              type: integer
              example: 0
            cid:
              type: string
              example: 14:11:11:11:11:c1
            monthFee:
              type: integer
              example: 250
            dayFee:
              type: integer
              example: 0
        UserIptvList_inner:
          type: object
          properties:
            id:
              type: integer
              example: 2
            tpName:
              type: string
              example: Премиум Iptvportal
            tpId:
              type: integer
              example: 41
            serviceStatus:
              type: integer
              example: 0
            monthFee:
              type: integer
              example: 250
            dayFee:
              type: integer
              example: 0
            serviceId:
              type: integer
              example: 0
            subscribeId:
              type: integer
              example: 0
            filterId:
              type: integer
              example: 0
        ContactsArray_inner:
          type: object
          properties:
            id:
              type: integer
              example: 1
            uid:
              type: string
              example: "132"
            value:
              type: string
              example: test@gmail.com
            typeName:
              type: string
              example: Email
        TpIntervals_inner:
          type: object
          properties:
            begin:
              type: string
              example: 00:00:00
            end:
              type: string
              example: 23:59:59
            id:
              type: integer
              example: 2
            tarif:
              type: string
            trafficClasses:
              type: string
            day:
              type: integer
        Groups_inner:
          type: object
          properties:
            id:
              type: integer
              example: 53
            name:
              type: string
              example: Должники
            descr:
              type: string
            domainId:
              type: integer
            disableChgTp:
              type: integer
              example: 1
        MsgsRepliesList_inner:
          type: object
          properties:
            id:
              type: integer
              example: 2
            text:
              type: string
              example: Reply text
            aid:
              type: integer
              example: 2
            admin:
              type: string
              example: abills
            datetime:
              type: string
              example: 2021-08-09 13:25:41
            mainMsg:
              type: integer
              example: 40
        MsgsChapter_inner:
          type: object
          properties:
            id:
              type: integer
              example: 2
            name:
              type: string
              example: Первый раздел
            responsible:
              type: integer
              example: 1
            innerChapter:
              type: integer
              example: 0
            autoclose:
              type: integer
              example: 50
        DistrictsArray_inner:
          type: object
          properties:
            id:
              type: integer
              example: 10
            name:
              type: string
              example: пос.Зуевка
            city:
              type: string
              example: Харцызск
            zip:
              type: string
            streetCount:
              type: integer
              example: 31
        StreetsArray_inner:
          type: object
          properties:
            id:
              type: integer
              example: 10
            streetName:
              type: string
              example: ул.Цэемовская
            districtId:
              type: integer
              example: 2
            buildCount:
              type: integer
              example: 31
        BuildsArray_inner:
          type: object
          properties:
            id:
              type: integer
              example: 10
            streetName:
              type: string
              example: ул.Цэемовская
            streetId:
              type: integer
              example: 2
            number:
              type: string
              example: "31"
        PaymentTypesArray_inner:
          type: object
          properties:
            id:
              type: integer
              example: 10
            name:
              type: string
              example: Credit card
            feesType:
              type: integer
              example: 0
            color:
              type: string
        UserPaymentsArray_inner:
          type: object
          properties:
            id:
              type: integer
              example: 10
            sum:
              type: integer
              example: 500
            regDate:
              type: string
              example: 2021-07-02 07:46:01
            method:
              type: integer
              example: 6
            innerDescribe:
              type: string
        FeesTypesArray_inner:
          type: object
          properties:
            id:
              type: integer
              example: 10
            name:
              type: string
              example: Пеня
            sum:
              type: integer
              example: 500
            defaultDescribe:
              type: string
        UserFeesArray_inner:
          type: object
          properties:
            id:
              type: integer
              example: 10
            sum:
              type: integer
              example: 500
            regDate:
              type: string
              example: 2021-07-02 07:46:01
            method:
              type: integer
              example: 2
            dsc:
              type: string
              example: 'Internet: М/А Премиум до 100м (41) - Распределение абонплаты'
        AbonTpsArray_inner:
          type: object
          properties:
            tpId:
              type: integer
              example: 1
            name:
              type: string
              example: Test abon TP
            price:
              type: integer
              example: 100
            userPortal:
              type: integer
              example: 0
            userCount:
              type: integer
              example: 10
            discount:
              type: integer
              example: 0
            paymentType:
              type: integer
              example: 0
            periodAlignment:
              type: integer
              example: 1
            nextAbonDate:
              type: string
              example: 2021-10-01
            description:
              type: string
        AbonUsersArray_inner:
          type: object
          properties:
            tpId:
              type: integer
              example: 1
            tpName:
              type: string
              example: Test abon TP
            price:
              type: integer
              example: 100
            serviceCount:
              type: integer
              example: 1
            date:
              type: string
              example: 2021-08-11
            nextAbon:
              type: string
              example: 2021-09-01
            uid:
              type: integer
              example: 11135
            login:
              type: string
              example: "3433"
        OnlineSessionsArray_inner:
          type: object
          properties:
            clientIpNum:
              type: integer
              example: 3232238092
            nasId:
              type: integer
              example: 12
            duration:
              type: string
              example: 838:59:59
            status:
              type: integer
              example: 10
            userName:
              type: string
              example: userName
            clientIp:
              type: string
              example: 192.168.10.12
            acctSessionId:
              type: string
              example: Akie6VpiYU
        UserList:
          type: array
          items:
            type: object
            properties:
              deposit:
                type: number
                example: 36579.21
              fio:
                type: string
                example: Иванов Иван
              uid:
                type: integer
                example: 1
              gid:
                type: integer
                example: 1
              login:
                type: string
                example: testuser
              billId:
                type: integer
                example: 12
      securitySchemes:
        KEY:
          type: apiKey
          name: KEY
          in: header
    
    
    AnchorAPI пользователяAPI пользователя Open API (Swagger) Integration for Confluence{ "swagger": "2.0", "info": { "version": "1.0.0", "title": "Abills user API" }, "host": "demo.abills.net.ua:9443", "basePath": "/api.cgi", "tags": [ { "name": "user", "description": "Работа с пользователем" }, { "name": "internet", "description": "Работа с услугой Интернет" }, { "name": "msgs", "description": "Работа с заявками пользователя" }, { "name": "abon", "description": "Работа с периодическими списаниями" } ], "schemes": [ "https" ], "paths": { "/user/{UID}": { "get": { "tags": [ "user" ], "summary": "Информация о пользователе", "operationId": "userInfo", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" } ], "responses": { "200": { "description": "Успешное выполнение", "schema": { "$ref": "#/definitions/User" } } }, "security": [ { "USER_SID": [] } ] } }, "/user/{UID}/pi": { "get": { "tags": [ "user" ], "summary": "Персональная информация пользователя", "operationId": "userPersonalInfo", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" } ], "responses": { "200": { "description": "Успешное выполнение", "schema": { "$ref": "#/definitions/UserPi" } } }, "security": [ { "USER_SID": [] } ] } }, "/user/{UID}/credit": { "get": { "tags": [ "user" ], "summary": "Информация об установке кредита", "operationId": "userCreditInfo", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" } ], "responses": { "200": { "description": "Успешное выполнение", "schema": { "$ref": "#/definitions/UserCreditInfo" } } }, "security": [ { "USER_SID": [] } ] }, "post": { "tags": [ "user" ], "summary": "Установка кредита пользователю", "operationId": "userSetCredit", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" } ], "responses": { "200": { "description": "Успешное выполнение", "schema": { "$ref": "#/definitions/UserCredit" } } }, "security": [ { "USER_SID": [] } ] } }, "/user/{UID}/internet": { "get": { "tags": [ "internet" ], "summary": "Информация об интернет услугах пользователя", "operationId": "userInternetInfo", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" } ], "responses": { "200": { "description": "Успешное выполнение", "schema": { "$ref": "#/definitions/UserInternet" } } }, "security": [ { "USER_SID": [] } ] } }, "/user/{UID}/internet/{ID}": { "put": { "tags": [ "internet" ], "summary": "Смена ТП", "operationId": "userChangeInternetTP", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" }, { "name": "ID", "in": "path", "description": "ID услуги Интернет", "required": true, "type": "string" }, { "in": "body", "name": "body", "required": true, "schema": { "$ref": "#/definitions/body" } } ], "responses": { "200": { "description": "Успешное выполнение", "schema": { "$ref": "#/definitions/InternetChangeTPSuccess" } }, "400": { "description": "Ошибка", "schema": { "$ref": "#/definitions/InternetChangeTPError" } } }, "security": [ { "USER_SID": [] } ] } }, "/user/{UID}/internet/{ID}/speed": { "get": { "tags": [ "internet" ], "summary": "Скорость ТП", "operationId": "userTpSpeed", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" }, { "name": "ID", "in": "path", "description": "ID услуги Интернет", "required": true, "type": "string" } ], "responses": { "200": { "description": "Успешное выполнение", "schema": { "$ref": "#/definitions/InternetSpeed" } } }, "security": [ { "USER_SID": [] } ] } }, "/user/{UID}/internet/{ID}/holdup": { "post": { "tags": [ "internet" ], "summary": "Приостановление услуги Интернет", "operationId": "userInternetHoldup", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" }, { "name": "ID", "in": "path", "description": "ID услуги Интернет", "required": true, "type": "string" }, { "in": "body", "name": "body", "required": true, "schema": { "$ref": "#/definitions/body_1" } } ], "responses": { "200": { "description": "Успешное выполнение", "schema": { "$ref": "#/definitions/HoldupReply" } } }, "security": [ { "USER_SID": [] } ] }, "delete": { "tags": [ "internet" ], "summary": "Удаление рассписания на приостановление услуги Интернет", "operationId": "userDeleteInternetHoldup", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" }, { "name": "ID", "in": "path", "description": "ID услуги Интернет", "required": true, "type": "string" } ], "responses": { "200": { "description": "Успешное выполнение", "schema": { "$ref": "#/definitions/HoldupReply" } } }, "security": [ { "USER_SID": [] } ] } }, "/user/{UID}/internet/tariffs": { "get": { "tags": [ "internet" ], "summary": "Доступные для изменения ТП, на которые хватает денег", "operationId": "userInternetAvailableToChangeTariffs", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" } ], "responses": { "200": { "description": "Успешное выполнение", "schema": { "$ref": "#/definitions/UserAvailableTariffs" } } }, "security": [ { "USER_SID": [] } ] } }, "/user/{UID}/internet/tariffs/all": { "get": { "tags": [ "internet" ], "summary": "Все доступные для изменения ТП", "operationId": "userInternetAvailableToChangeTariffsAll", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" } ], "responses": { "200": { "description": "Успешное выполнение", "schema": { "$ref": "#/definitions/UserAvailableTariffs" } } }, "security": [ { "USER_SID": [] } ] } }, "/user/{UID}/internet/{ID}/warnings": { "get": { "tags": [ "internet" ], "summary": "Информация о списаниях", "operationId": "userInternetWarnings", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" }, { "name": "ID", "in": "path", "description": "ID услуги", "required": true, "type": "string" } ], "responses": { "200": { "description": "Успешное выполнение", "schema": { "$ref": "#/definitions/InternetWarnings" } } }, "security": [ { "USER_SID": [] } ] } }, "/user/{UID}/abon": { "get": { "tags": [ "abon" ], "summary": "Информация об периодических списаниях пользователя", "operationId": "userAbonInfo", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" } ], "responses": { "200": { "description": "Успешное выполнение", "schema": { "$ref": "#/definitions/UserAbon" } } }, "security": [ { "USER_SID": [] } ] } }, "/user/{UID}/msgs": { "get": { "tags": [ "msgs" ], "summary": "Список заявок пользователя", "operationId": "userMsgsList", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" } ], "responses": { "200": { "description": "Успешное выполнение", "schema": { "$ref": "#/definitions/MsgsArray" } } }, "security": [ { "USER_SID": [] } ] }, "post": { "tags": [ "msgs" ], "summary": "Создание заявки", "operationId": "userAddMessage", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" }, { "in": "body", "name": "body", "required": true, "schema": { "$ref": "#/definitions/MsgsAdd" } } ], "responses": { "200": { "description": "Успешное выполнение", "schema": { "$ref": "#/definitions/MsgsAdded" } } }, "security": [ { "USER_SID": [] } ] } }, "/user/{UID}/msgs/{ID}": { "get": { "tags": [ "msgs" ], "summary": "Информация о заявке пользователя", "operationId": "userMsgs", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" }, { "name": "ID", "in": "path", "description": "ID заявки", "required": true, "type": "string" } ], "responses": { "200": { "description": "Успешное выполнение", "schema": { "$ref": "#/definitions/MsgsInfo" } } }, "security": [ { "USER_SID": [] } ] } }, "/user/{UID}/msgs/{ID}/reply": { "get": { "tags": [ "msgs" ], "summary": "Список заявок пользователя", "operationId": "userMsgReplyList", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" }, { "name": "ID", "in": "path", "description": "ID заявки", "required": true, "type": "string" } ], "responses": { "200": { "description": "Успешное выполнение", "schema": { "$ref": "#/definitions/MsgsReplyArray" } } }, "security": [ { "USER_SID": [] } ] }, "post": { "tags": [ "msgs" ], "summary": "Создание заявки", "operationId": "userAddReply", "produces": [ "application/json" ], "parameters": [ { "name": "UID", "in": "path", "description": "UID пользователя", "required": true, "type": "string" }, { "name": "ID", "in": "path", "description": "ID заявки", "required": true, "type": "string" }, { "in": "body", "name": "body", "required": true, "schema": { "$ref": "#/definitions/MsgsReplyAdd" } } ], "responses": { "200": { "description": "Успешное выполнение" } }, "security": [ { "USER_SID": [] } ] } } }, "securityDefinitions": { "USER_SID": { "type": "apiKey", "name": "USERSID", "in": "header" } }, "definitions": { "User": { "properties": { "login": { "type": "string", "example": "3433" }, "deposit": { "type": "integer", "example": 1600 }, "credit": { "type": "integer", "example": 100 }, "creditDate": { "type": "string", "example": "2021-08-13" }, "billId": { "type": "integer", "example": 12 }, "gid": { "type": "integer", "example": 57 }, "disable": { "type": "integer", "example": 0 }, "deleted": { "type": "integer", "example": 0 } } }, "UserPi": { "properties": { "fio": { "type": "string", "example": "Иванов Иван Иванович" }, "addressFull": { "type": "string", "example": "ул.Адамца, 121, 3" }, "age": { "type": "integer", "example": 33 }, "locationId": { "type": "integer", "example": 1444 }, "contractId": { "type": "string", "example": "575493" }, "email": { "type": "array", "items": { "type": "string", "example": "test@gmail.com" } }, "phone": { "type": "array", "items": { "type": "string", "example": "380976574568" } } } }, "UserInternet": { "type": "array", "items": { "$ref": "#/definitions/UserInternet_inner" } }, "InternetSpeed": { "type": "array", "items": { "$ref": "#/definitions/InternetSpeed_inner" } }, "UserAbon": { "type": "array", "items": { "$ref": "#/definitions/UserAbon_inner" } }, "UserCredit": { "properties": { "creditSum": { "type": "integer", "example": 500 }, "creditChangePrice": { "type": "integer", "example": 100 }, "uid": { "type": "integer", "example": 11135 }, "creditDays": { "type": "string", "example": "3" }, "creditMonthChanges": { "type": "string", "example": "1" } } }, "UserCreditInfo": { "properties": { "creditChgPrice": { "type": "string", "example": "500" }, "creditMonthChanges": { "type": "string", "example": "1" }, "creditSum": { "type": "string", "example": "800" }, "creditDays": { "type": "string", "example": "3" } } }, "UserAvailableTariffs": { "type": "array", "items": { "$ref": "#/definitions/UserAvailableTariffs_inner" } }, "HoldupReply": { "properties": { "success": { "type": "integer", "example": 1 }, "msg": { "type": "string" } } }, "InternetWarnings": { "properties": { "messageType": { "type": "string", "example": "success" }, "warning": { "type": "string", "example": "следующее списание через 7 дней" }, "daysToFee": { "type": "string", "example": "2" }, "sum": { "type": "integer", "example": 150 }, "abonDate": { "type": "string", "example": "2021-10-01" } } }, "InternetChangeTPSuccess": { "properties": { "success": { "type": "integer", "example": 1 }, "uid": { "type": "integer" } } }, "InternetChangeTPError": { "properties": { "error": { "type": "integer", "example": 145 }, "message": { "type": "string" }, "messageType": { "type": "string" }, "messageTitle": { "type": "string" } } }, "MsgsAdd": { "properties": { "chapter": { "type": "integer", "example": 3 }, "message": { "type": "string", "example": "Some message" }, "subject": { "type": "string", "example": "Message subject" }, "priority": { "type": "integer", "example": 2 } } }, "MsgsAdded": { "properties": { "insertId": { "type": "integer", "example": 43 }, "msgId": { "type": "integer", "example": 43 }, "affected": { "type": "integer", "example": 1 } } }, "MsgsInfo": { "properties": { "subject": { "type": "string", "example": "Message user api subject" }, "message": { "type": "string", "example": "Test message from user api" }, "chapterName": { "type": "string", "example": "Второй раздел" }, "chapter": { "type": "integer", "example": 3 }, "priority": { "type": "integer", "example": 2 }, "state": { "type": "integer", "example": 0 }, "date": { "type": "string", "example": "2021-09-02 13:20:37" } } }, "MsgsArray": { "type": "array", "items": { "$ref": "#/definitions/MsgsInfo" } }, "MsgsReply": { "properties": { "uid": { "type": "integer", "example": 0 }, "aid": { "type": "integer", "example": 2 }, "id": { "type": "integer", "example": 54 }, "text": { "type": "string", "example": "some reply text" }, "datetime": { "type": "string", "example": "2021-09-02 12:50:47" } } }, "MsgsReplyAdd": { "properties": { "reply_text": { "type": "string", "example": "Some reply text" }, "reply_subject": { "type": "string", "example": "Subject" } } }, "MsgsReplyArray": { "type": "array", "items": { "$ref": "#/definitions/MsgsReply" } }, "body": { "properties": { "tp_id": { "type": "integer", "example": 4 }, "date": { "type": "string", "example": "2021-09-17" }, "period": { "type": "integer", "example": "2 (0 - моментальное изменение ТП, если разрешено, 1 - изменение ТП в след. учётный период, 2 - изменение ТП по указаной дате)" } } }, "body_1": { "properties": { "from_date": { "type": "string", "example": "2021-08-14" }, "to_date": { "type": "string", "example": "2021-08-17" } } }, "UserInternet_inner": { "type": "object", "properties": { "id": { "type": "integer", "example": 2 }, "tpName": { "type": "string", "example": "Премиум до 100м" }, "tpId": { "type": "integer", "example": 41 }, "internetStatus": { "type": "integer", "example": 0 }, "cid": { "type": "string", "example": "14:11:11:11:11:c1" }, "monthFee": { "type": "integer", "example": 250 }, "dayFee": { "type": "integer", "example": 0 } } }, "InternetSpeed_inner": { "type": "object", "properties": { "inSpeed": { "type": "integer", "example": 2999 }, "outSpeed": { "type": "integer", "example": 3000 }, "tpNum": { "type": "integer", "example": 155 } } }, "UserAbon_inner": { "type": "object", "properties": { "id": { "type": "integer", "example": 2 }, "name": { "type": "string", "example": "Test abon TP" }, "price": { "type": "integer", "example": 100 }, "period": { "type": "integer", "example": 1 }, "nextAbon": { "type": "string", "example": "2021-09-01" }, "comments": { "type": "string" }, "description": { "type": "string", "example": "Test description" } } }, "UserAvailableTariffs_inner": { "type": "object", "properties": { "id": { "type": "integer", "example": 2 }, "name": { "type": "string", "example": "Премиум до 100м" }, "tpId": { "type": "integer", "example": 41 }, "monthFee": { "type": "integer", "example": 250 }, "dayFee": { "type": "integer", "example": 0 }, "comments": { "type": "string" } } } } }

    Сделать ограничение на Admin RESTful API, можно с помощью опции $conf{API_IPS}, в конфигурационном файле config.pl, пример

    Code Block
    $conf{API_IPS} = '192.20.208.1, 217.116.76.0/24, 104.81.60.171';

    Или в настройках Настройка>Администраторы>Доступ


    Возвращать по почту письма, смс или другие вещи которые поддерживают перевод в RESTful API, можно включить с помощью опции $conf{API_CONF_LANGUAGE}, в конфигурационном файле config.pl, пример

    Code Block
    $conf{API_CONF_LANGUAGE} = 1;

    Опция дебага, позволяет выводить debuginfo при ошибке, и также её сохранять с API_LOG. Никак не влияет на работу системы.

    Code Block
    $conf{API_DEBUG} = 1;


    Авторизация

    Для подтверждения личности при выполнении запросов, некоторые пути требуют соответствующий привилегии:

    • Авторизация администратора выполняется через API_KEY. Ключ нужно передать в заголовке запроса KEY в значении API_KEY.
      Для получения API_KEY нужно его задать через веб-интерфейс
      Настройки > Администраторы, поле API_KEY.
    • Пользователям нужно использовать идентификатор сессии (sid), передавая его значение в заголовке USERSID
      Для получения sid можно воспользоваться авторизацией через API используя путь авторизация абонента (/user/login).


    Разрешить получить сессию администратора с помощью REST API

    Code Block
    $conf{API_ADMIN_AUTH_LOGIN} = 1;


    СТРОГО НЕ РЕКОМЕНДУЕТСЯ ДЛЯ ИСПОЛЬЗОВАНИЯ!!! Возвращает apiKey в запросе на получение сессии!!!

    Code Block
    $conf{API_ADMIN_AUTH_LOGIN_RETURN_API_KEY} = 1;


    Запуск на nginx

    Чтобы включить поддержку nginx нужно:


    Работа с API для ботов

    для авторизации в USER API телеграмм бота необходимо

    1) Прописать IP с которых будет обращаться бот к серверу

    Code Block
    $conf{BOT_APIS}='127.0.0.1';

    2) Прописать секрет бота для дополнительной проверки запроса (любое значение)

    Code Block
    $conf{BOT_SECRET}='test1234567787654';

    Авторизация происходит по хедеру X-ABillS-Bot-Secret

    X-ABillS-Bot-Secret хранится в телеграм боте и передается для авторизации

    Получение информации по пользователю и работа с пользователем

    1) хедер X-ABillS-Bot - какой именно бот авторизуется, возможные варианты - Viber, Telegram

    2) хедер X-ABillS-User-ID - id пользователя в боте

    3) хедер X-ABillS-Admin-ID - id админа в боте


    Получить OpenAPI вашей версии

    1) Прямо с API

    Выставьте переменную:

    Code Block
    $conf{API_SWAGGER} = 1;

    Обращайтесь за
    USER API     - /api.cgi/swagger
    ADMIN API - /api.cgi/swagger/admin

    Для того, чтобы развернуть Redocly, скопируйте файлы с misc/api/redocly/ в cgi-bin.
    USER API     - /redocly-user.html
    ADMIN API - /redocly-admin.html

    2) Прямо с файла

    В каждом биллинге уже установлен полностью скомпилированный OpenAPI.
    Они находятся за путями misc/api/bundle_user.yaml и misc/api/bundle_admin.yaml

    Стандарт REST

    Реализованный в системе RESTful интерфейс управления услугами и абонентами соответствует стандарту REST API.