---
openapi: 3.0.0
info:
  title: MRGroup Smaris API
  version: 1.0.0
servers:
- url: https://virtserver.swaggerhub.com/SHOMENKO/MRGroup_smartis/1.0.0
  description: --
paths:
  /leads:
    get:
      tags:
      - To Smartis
      summary: получение записей Интерес
      operationId: GetTolead
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/inline_response_200'
        "400":
          description: Bad Request
        "403":
          description: Forbidden
  /Appointments:
    get:
      tags:
      - To Smartis
      summary: получение записей Встреча newAction
      operationId: GetToAppointments
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/inline_response_200_1'
        "400":
          description: Bad Request
        "403":
          description: Forbidden
  /Phonecalls:
    get:
      tags:
      - To Smartis
      summary: получение записей Звонка newAction
      operationId: GetPhonecalls
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/inline_response_200_2'
        "400":
          description: Bad Request
        "403":
          description: Forbidden
  /Worktasks:
    get:
      tags:
      - To Smartis
      summary: получение записей Задание на работу
      operationId: GetWorktasks
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/inline_response_200_3'
        "400":
          description: Bad Request
        "403":
          description: Forbidden
  /Contacts:
    get:
      tags:
      - To Smartis
      summary: получение записей Контакта
      operationId: GetContacts
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/inline_response_200_4'
        "400":
          description: Bad Request
        "403":
          description: Forbidden
  /BrokerageAgreements:
    get:
      tags:
      - To Smartis
      summary: получение записей Договора бронирования
      operationId: GetBrokerageAgreements
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/inline_response_200_5'
        "400":
          description: Bad Request
        "403":
          description: Forbidden
components:
  schemas:
    newLead:
      required:
      - leadid
      type: object
      properties:
        leadid:
          type: string
          description: id интереса
          example: D789365C-A28D-4C67-88C3-A86738D1D581
        developmentprojectId:
          type: string
          description: Проект
          example: G789342C-A28D-4C67-88C3-A46738D1D581
        createdon:
          type: string
          description: Дата создания
          format: 2015-04-08T11:38:20
          example: 2015-04-08T11:38:20
        modifiedon:
          type: string
          description: Дата изменения
          format: 2015-04-08T11:38:20
          example: 2015-04-08T11:38:20
        ownerId:
          type: string
          description: Ответсвенный ID
          example: 354F6199-88A8-E411-9410-00155D000E0E
        ownerName:
          type: string
          description: Ответственный название
          example: "Фили, Эстатет"
        OwnerBrandId:
          type: string
          description: Бренд ответственного
          example: 354F6199-88A8-E411-9410-00155D000E0E
        ownerBrandName:
          type: string
          description: Бренд ответственного название
          example: Est-a-Tet
        name:
          type: string
          description: Название
          example: "1504-13008-ФИЛ-Голубов, Сергей Анатольевич"
        dealtypeid:
          type: string
          description: Тип сделки
          example: c936ff00-2c8a-49a4-b981-014c48499078
        direction:
          type: string
          description: Направление
          example: 8568bd44-6e86-45e6-bfde-efd3c8fb07b0
        lastname:
          type: string
          description: Фамилия
          example: Голубов
        firstname:
          type: string
          description: Имя
          example: Сергей
        middlename:
          type: string
          description: Отчество
          example: Анатольевич
        contactPhone:
          type: string
          description: Контактный телефон
          example: +7(906)778-10-89
        mobilephone:
          type: string
          description: Мобильный телефон
          example: +7(906)778-10-89
        emailaddress1:
          type: string
          example: s.golubov@atf.ru
        birthdate:
          type: string
          format: 2015-04-08T11:38:20
          example: 1973-06-29T00:00:00
        leadsourceid:
          type: string
          example: e37a085d-4706-48c7-8b88-1be191762764
        requestsourcetypeid:
          type: string
          example: c3c5d53b-c4cc-4ed2-99d6-4e0b1071ce2b
        paymenttypeid:
          type: string
          example: 05e4f7b3-a65d-41fe-a327-f67f2a07bf67
    Appointments:
      required:
      - appointmentId
      type: object
      properties:
        leadid:
          type: string
          example: D789365C-A28D-4C67-88C3-A86738D1D581
        appointmentId:
          type: string
          example: D789365C-A28D-4C67-88C3-A86738D1D581
        subject:
          type: string
          example: По звонку
        createdon:
          type: string
          example: 2015-04-08T11:38:20
        modifiedon:
          type: string
          example: 2015-04-08T11:38:20
        ownerId:
          type: string
          example: 354F6199-88A8-E411-9410-00155D000E0E
        ownerName:
          type: string
          example: "Фили, Эстатет"
        scheduledstart:
          type: string
          example: 2015-04-08T11:38:20
        scheduledend:
          type: string
          example: 2015-04-08T11:38:20
        statecode:
          type: integer
          example: 1
        statuscodeName:
          type: string
          example: Открыть
        isAppointmentClosed:
          type: integer
          description: = statecode
          example: 1
        ownerBrandId:
          type: string
          example: 21AD5298-9573-EA11-BDF3-00155DFC99C4
        ownerBrandName:
          type: string
          example: Est-a-Tet
        appointmentTypeName:
          type: string
          example: Встреча
        ctionTypeName:
          type: string
          example: Первичная встреча
    Phonecalls:
      type: object
      properties:
        phonecallid:
          type: string
          example: D789365C-A28D-4C67-88C3-A86738D1D581
        createdon:
          type: string
          example: 2015-04-08T11:38:20
        modifiedon:
          type: string
          example: 2015-04-08T11:38:20
        ownerId:
          type: string
          example: 354F6199-88A8-E411-9410-00155D000E0E
        ownerName:
          type: string
          example: "Югай, Александра"
        worktaskid:
          type: string
          example: 7FDD4BD0-CF56-EE11-BE96-00155DFC99C4
        direction:
          type: boolean
          description: "0 - входящий, 1 - исходящий"
          example: false
        telephone:
          type: string
          example: "79151699592"
    Worktasks:
      type: object
      properties:
        worktaskid:
          type: string
          example: 7FDD4BD0-CF56-EE11-BE96-00155DFC99C4
        createdon:
          type: string
          example: 2015-04-08T11:38:20
        modifiedon:
          type: string
          example: 2015-04-08T11:38:20
        ownerId:
          type: string
          example: 354F6199-88A8-E411-9410-00155D000E0E
        ownerName:
          type: string
          example: "Югай, Александра"
        worktasktype:
          type: string
          example: Обращение в контакт центр
        worktasksubtype:
          type: string
          example: Новый интерес
        telephone:
          type: string
          example: "79151699592"
        leadid:
          type: string
          example: 7FDD4BD0-CF56-EE11-BE96-00155DFC99C4
        requestsourcetypeid:
          type: string
          example: 7FDD4BD0-CF56-EE11-BE96-00155DFC99C4
        requestsourcetypename:
          type: string
          example: Звонок в контакт центр
    Contacts:
      type: object
      properties:
        ContactId:
          type: string
          example: 7FDD4BD0-CF56-EE11-BE96-00155DFC99C4
        createdon:
          type: string
          example: 2015-04-08T11:38:20
        modifiedon:
          type: string
          example: 2015-04-08T11:38:20
        ownerId:
          type: string
          example: 354F6199-88A8-E411-9410-00155D000E0E
        ownerName:
          type: string
          example: "Югай, Александра"
        lastname:
          type: string
          example: Лазарев
        firstname:
          type: string
          example: Виктор
        middlename:
          type: string
          example: Валентинович
        fullname:
          type: string
          example: "Лазарев, Виктор Валентинович"
        gendercodeValue:
          type: integer
          description: "1 - мужской, 2 - женский"
          example: 1
        gendercodeName:
          type: string
          example: Мужской
        birthdate:
          type: string
          example: 1975-09-19T00:00:00
        age:
          type: integer
          example: 41
        contactPhone:
          type: string
          example: +7(926)521-06-16
        mobilephone:
          type: string
          example: +7(926)521-06-16
        registrationAddress:
          type: string
          example: "г. Москва, ул. Трофимова, дом 18, кв. 37"
        residenceAddress:
          type: string
          example: "г. Москва, ул. Трофимова, дом 18, кв. 37"
    BrokerageAgreements:
      type: object
      properties:
        agreementid:
          type: string
          example: 7FDD4BD0-CF56-EE11-BE96-00155DFC99C4
        developmentProjectId:
          type: string
          example: 7FDD4BD0-CF56-EE11-BE96-00155DFC99C4
        createdon:
          type: string
          example: 2015-04-08T11:38:20
        modifiedon:
          type: string
          example: 2015-04-08T11:38:20
        ownerName:
          type: string
          example: "Югай, Александра"
        ownerBrandName:
          type: string
          example: Est-a-Tet
        name:
          type: string
          example: Лазарев
        date:
          type: string
          example: 1975-09-19T00:00:00
        dealschemeName:
          type: string
          example: Виктор
        agreementtypeName:
          type: string
          example: Валентинович
        dateSigning:
          type: string
          example: "Лазарев, Виктор Валентинович"
        booking_till:
          type: integer
          description: "1 - мужской, 2 - женский"
          example: 1
        paymenttype:
          type: string
          example: Мужской
        agreementStatus:
          type: integer
          example: 41
        agreementState:
          type: string
          example: +7(926)521-06-16
        dealsides:
          type: array
          items:
            $ref: '#/components/schemas/BrokerageAgreements_dealsides'
        leadpositions:
          type: array
          items:
            $ref: '#/components/schemas/BrokerageAgreements_leadpositions'
    inline_response_200:
      type: object
      properties:
        fields:
          $ref: '#/components/schemas/newLead'
        error:
          type: boolean
          description: "false - no error, true - error"
        errorMessage:
          type: string
          description: "error message, empty if error = 0"
    inline_response_200_1:
      type: object
      properties:
        fields:
          $ref: '#/components/schemas/Appointments'
        error:
          type: boolean
          description: "false - no error, true - error"
        errorMessage:
          type: string
          description: "error message, empty if error = 0"
    inline_response_200_2:
      type: object
      properties:
        fields:
          $ref: '#/components/schemas/Phonecalls'
        error:
          type: boolean
          description: "false - no error, true - error"
        errorMessage:
          type: string
          description: "error message, empty if error = 0"
    inline_response_200_3:
      type: object
      properties:
        fields:
          $ref: '#/components/schemas/Worktasks'
        error:
          type: boolean
          description: "false - no error, true - error"
        errorMessage:
          type: string
          description: "error message, empty if error = 0"
    inline_response_200_4:
      type: object
      properties:
        fields:
          $ref: '#/components/schemas/Contacts'
        error:
          type: boolean
          description: "false - no error, true - error"
        errorMessage:
          type: string
          description: "error message, empty if error = 0"
    inline_response_200_5:
      type: object
      properties:
        fields:
          $ref: '#/components/schemas/BrokerageAgreements'
        error:
          type: boolean
          description: "false - no error, true - error"
        errorMessage:
          type: string
          description: "error message, empty if error = 0"
    BrokerageAgreements_dealsides:
      type: object
      properties:
        agreementid:
          type: string
          example: 9A095F46-E326-EA11-BDEF-00155DFC99C4
        customerId:
          type: string
          example: 9A095F46-E326-EA11-BDEF-00155DFC99C4
        customer:
          type: string
          example: 2019-12-25T06:53:44
        customerType:
          type: string
          description: "Contact - Если заполнено Физлицо (newIndividual), Account - Если заполнено Организация (newOrganization)"
          example: Contact
    BrokerageAgreements_leadpositions:
      type: object
      properties:
        developmentProjectId:
          type: string
          example: 9A095F46-E326-EA11-BDEF-00155DFC99C4
        realtyobjectId:
          type: string
          example: 9A095F46-E326-EA11-BDEF-00155DFC99C4
        realtyobjectName:
          type: string
          description: Справочник "Тип объекта недвижимости" значение из поля newValueIntegrationSettings
          example: 9A095F46-E326-EA11-BDEF-00155DFC99C4
        realtyobjectType:
          type: string
          example: "1504-13008-ФИЛ-Голубов, Сергей Анатольевич"
        roomQuantity:
          type: string
          example: 9A095F46-E326-EA11-BDEF-00155DFC99C4
        area:
          type: number
          format: "numeric (18, 1)"
          example: 1100000
        amount:
          type: number
          format: "numeric (18, 1)"
          example: 1100000
        investor:
          type: boolean
          example: false
