amocrm/openapi.yaml

943 lines
35 KiB
YAML
Raw Normal View History

2024-04-04 00:19:25 +00:00
openapi: 3.0.3
info:
title: QUIZ AMOCRM integration
description: Интеграция с Амо. Ключевая задача - создавать заявки в соответствующей воронкой подключенного аккаунта
version: 1.0.0
2024-04-04 09:32:27 +00:00
tags:
2024-04-09 07:43:11 +00:00
- name: main
description: Операции связанные с AmoCRM
2024-04-04 09:32:27 +00:00
2024-04-04 00:19:25 +00:00
paths:
/account:
post:
2024-04-04 09:32:27 +00:00
operationId: ConnectAccount
2024-04-04 00:19:25 +00:00
description: подключение аккаунта амо к аккаунту quiz. На вход получает только токен. На выход отдаёт ссылку для подключения. Создаёт модель аккаунта, имеющую связь с основным аккаунтом
2024-04-04 09:32:27 +00:00
tags:
2024-04-09 07:43:11 +00:00
- main
2024-04-04 00:19:25 +00:00
responses:
'200':
description: успешное создание ссылки для авторизации
content:
'application/json':
schema:
2024-04-04 09:32:27 +00:00
$ref: '#/components/schemas/ConnectAccountResp'
2024-04-11 09:55:26 +00:00
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
2024-04-04 00:19:25 +00:00
delete:
2024-04-04 09:32:27 +00:00
operationId: SoftDeleteAccount
2024-04-04 00:19:25 +00:00
description: мягкое удаление аккаунта. Юзер должен иметь возможность создать новый аккаунт, взамен удалённого
2024-04-04 09:32:27 +00:00
tags:
2024-04-09 07:43:11 +00:00
- main
2024-04-04 00:19:25 +00:00
responses:
'200':
2024-04-11 09:55:26 +00:00
$ref: '#/components/responses/200'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
2024-04-04 00:19:25 +00:00
get:
2024-04-04 09:32:27 +00:00
operationId: GetCurrentAccount
2024-06-12 15:22:44 +00:00
description: получение текущего аккаунта, компании текщего пользователя
2024-04-04 09:32:27 +00:00
tags:
2024-04-09 07:43:11 +00:00
- main
2024-04-04 00:19:25 +00:00
responses:
'200':
2024-06-12 15:22:44 +00:00
description: аккаунт интеграции амо
2024-04-04 09:32:27 +00:00
content:
2024-04-04 00:19:25 +00:00
'application/json':
schema:
2024-06-12 15:22:44 +00:00
$ref: '#/components/schemas/AccountAmo'
2024-04-11 09:55:26 +00:00
'401':
$ref: '#/components/responses/401'
2024-06-04 16:05:53 +00:00
'404':
$ref: '#/components/responses/404'
2024-04-11 09:55:26 +00:00
'500':
$ref: '#/components/responses/500'
2024-04-04 00:19:25 +00:00
/webhook/create:
get:
2024-04-04 09:32:27 +00:00
operationId: WebhookCreate
2024-04-04 00:19:25 +00:00
description: это метод для получения пары токенов для аккаунта. Пары токенов стоит хранить в отдельной таблице и завести воркер, который будет обновлять рефреш. https://www.amocrm.ru/developers/content/oauth/step-by-step - вот дока для этого метода
2024-04-04 09:32:27 +00:00
tags:
2024-04-09 07:43:11 +00:00
- main
2024-04-04 09:32:27 +00:00
responses:
'200':
2024-04-07 17:13:17 +00:00
description: Success
2024-04-04 00:19:25 +00:00
/webhook/delete:
get:
2024-04-04 09:32:27 +00:00
operationId: WebhookDelete
2024-04-04 00:19:25 +00:00
description: это метод для оповещения об удалении итеграции из учетки в амо. При его вызове надо мягко удалить соответствующий аккаунт. https://www.amocrm.ru/developers/content/oauth/step-by-step#%D0%A5%D1%83%D0%BA-%D0%BE%D0%B1-%D0%BE%D1%82%D0%BA%D0%BB%D1%8E%D1%87%D0%B5%D0%BD%D0%B8%D0%B8-%D0%B8%D0%BD%D1%82%D0%B5%D0%B3%D1%80%D0%B0%D1%86%D0%B8%D0%B8
2024-04-04 09:32:27 +00:00
tags:
2024-04-09 07:43:11 +00:00
- main
2024-04-06 18:22:50 +00:00
responses:
'200':
2024-04-07 17:13:17 +00:00
description: Success
2024-04-04 00:19:25 +00:00
/users:
get:
2024-05-03 09:25:43 +00:00
operationId: GettingUserWithPagination
2024-04-07 17:13:17 +00:00
tags:
2024-04-09 07:43:11 +00:00
- main
2024-06-12 15:22:44 +00:00
description: получение списка юзеров для текущего пользователя и его компании, закешированных у нас, с пагинацией https://www.amocrm.ru/developers/content/crm_platform/users-api#users-list
2024-04-04 19:57:33 +00:00
parameters:
2024-04-08 07:34:54 +00:00
- in: query
name: Pagination
description: Параметры пагинации
required: false
schema:
type: object
properties:
page:
type: integer
description: Номер страницы пагинации. Если не указан, используется значение по умолчанию.
example: 1
size:
type: integer
description: Размер страницы пагинации. Если не указан, используется значение по умолчанию.
example: 25
required:
- page
- size
2024-04-04 19:57:33 +00:00
responses:
'200':
2024-06-12 15:22:44 +00:00
description: успешное получение списка пользователей для текущего пользователя и его компании
2024-04-04 19:57:33 +00:00
content:
'application/json':
schema:
2024-04-07 13:22:11 +00:00
$ref: "#/components/schemas/UserListResp"
2024-04-23 12:22:12 +00:00
'400':
$ref: '#/components/responses/400'
2024-04-23 11:18:45 +00:00
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
2024-04-04 00:19:25 +00:00
patch:
2024-04-04 09:32:27 +00:00
operationId: UpdateListUsers
2024-04-04 00:19:25 +00:00
description: обновление списка юзеров
2024-04-04 09:32:27 +00:00
tags:
2024-04-09 07:43:11 +00:00
- main
2024-04-04 09:32:27 +00:00
responses:
'200':
2024-04-23 11:18:45 +00:00
$ref: '#/components/responses/200'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
2024-04-04 00:19:25 +00:00
/pipelines:
get:
2024-05-03 09:25:43 +00:00
operationId: GetPipelinesWithPagination
2024-04-07 17:13:17 +00:00
tags:
2024-04-09 07:43:11 +00:00
- main
2024-04-04 00:19:25 +00:00
description: получение списка воронок, закешированных у нас, с пагинацией https://www.amocrm.ru/developers/content/crm_platform/leads_pipelines
2024-04-06 16:12:22 +00:00
parameters:
2024-04-08 07:34:54 +00:00
- in: query
name: Pagination
description: Параметры пагинации
required: false
schema:
type: object
properties:
page:
type: integer
description: Номер страницы пагинации. Если не указан, используется значение по умолчанию.
example: 1
size:
type: integer
description: Размер страницы пагинации. Если не указан, используется значение по умолчанию.
example: 25
required:
- page
- size
2024-04-06 16:12:22 +00:00
responses:
'200':
2024-04-07 13:22:11 +00:00
description: успешное получение списка воронок
2024-04-06 16:12:22 +00:00
content:
'application/json':
schema:
2024-04-07 13:22:11 +00:00
$ref: "#/components/schemas/UserListPipelinesResp"
2024-04-23 12:22:12 +00:00
'400':
$ref: '#/components/responses/400'
2024-04-23 11:18:45 +00:00
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
2024-04-04 00:19:25 +00:00
patch:
2024-04-04 09:32:27 +00:00
operationId: UpdateListPipelines
2024-04-04 00:19:25 +00:00
description: обновление списка воронок
2024-04-04 09:32:27 +00:00
tags:
2024-04-09 07:43:11 +00:00
- main
2024-04-04 09:32:27 +00:00
responses:
'200':
2024-04-23 11:18:45 +00:00
$ref: '#/components/responses/200'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
2024-04-04 00:19:25 +00:00
/steps:
get:
2024-05-03 09:25:43 +00:00
operationId: GetStepsWithPagination
2024-04-07 17:13:17 +00:00
tags:
2024-04-09 07:43:11 +00:00
- main
2024-04-04 00:19:25 +00:00
description: получение списка этапов воронок, закешированных у нас, с пагинацией https://www.amocrm.ru/developers/content/crm_platform/leads_pipelines#%D0%A1%D0%BF%D0%B8%D1%81%D0%BE%D0%BA-%D1%81%D1%82%D0%B0%D1%82%D1%83%D1%81%D0%BE%D0%B2-%D0%B2%D0%BE%D1%80%D0%BE%D0%BD%D0%BA%D0%B8-%D1%81%D0%B4%D0%B5%D0%BB%D0%BE%D0%BA
2024-04-06 18:22:50 +00:00
parameters:
2024-04-08 07:34:54 +00:00
- in: query
name: Pagination
description: Параметры пагинации
required: false
schema:
type: object
properties:
pipelineID:
type: integer
description: id воронки которой принадлежат шаги
example: 123
2024-04-08 07:34:54 +00:00
page:
type: integer
description: Номер страницы пагинации. Если не указан, используется значение по умолчанию.
example: 1
size:
type: integer
description: Размер страницы пагинации. Если не указан, используется значение по умолчанию.
example: 25
required:
- pipelineID
2024-04-08 07:34:54 +00:00
- page
- size
2024-04-06 18:22:50 +00:00
responses:
'200':
2024-04-07 13:22:11 +00:00
description: успешное получение списка шагов воронок
2024-04-06 18:22:50 +00:00
content:
'application/json':
schema:
2024-04-07 13:22:11 +00:00
$ref: "#/components/schemas/UserListStepsResp"
2024-04-23 12:22:12 +00:00
'400':
$ref: '#/components/responses/400'
2024-04-23 11:18:45 +00:00
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
2024-04-04 00:19:25 +00:00
patch:
2024-04-04 09:32:27 +00:00
operationId: UpdateListSteps
2024-04-04 00:19:25 +00:00
description: обновление списка этапов воронок
2024-04-04 09:32:27 +00:00
tags:
2024-04-09 07:43:11 +00:00
- main
2024-04-04 09:32:27 +00:00
responses:
'200':
2024-04-23 11:18:45 +00:00
$ref: '#/components/responses/200'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
2024-04-04 00:19:25 +00:00
/fields:
get:
2024-05-03 09:25:43 +00:00
operationId: GetFieldsWithPagination
2024-04-07 17:13:17 +00:00
tags:
2024-04-09 07:43:11 +00:00
- main
2024-04-04 00:19:25 +00:00
description: получение списка кастомных полей, закешированных у нас, с пагинацией https://www.amocrm.ru/developers/content/crm_platform/custom-fields#%D0%A1%D0%BF%D0%B8%D1%81%D0%BE%D0%BA-%D0%BF%D0%BE%D0%BB%D0%B5%D0%B9-%D1%81%D1%83%D1%89%D0%BD%D0%BE%D1%81%D1%82%D0%B8
2024-04-06 18:22:50 +00:00
parameters:
2024-04-08 07:34:54 +00:00
- in: query
name: Pagination
description: Параметры пагинации
required: false
schema:
type: object
properties:
page:
type: integer
description: Номер страницы пагинации. Если не указан, используется значение по умолчанию.
example: 1
size:
type: integer
description: Размер страницы пагинации. Если не указан, используется значение по умолчанию.
example: 25
required:
- page
- size
2024-04-06 18:22:50 +00:00
responses:
'200':
2024-04-07 13:22:11 +00:00
description: успешное получение списка тегов
2024-04-06 18:22:50 +00:00
content:
'application/json':
schema:
2024-04-07 13:22:11 +00:00
$ref: "#/components/schemas/UserListFieldsResp"
2024-04-23 12:22:12 +00:00
'400':
$ref: '#/components/responses/400'
2024-04-23 11:18:45 +00:00
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
2024-04-04 00:19:25 +00:00
patch:
2024-04-04 09:32:27 +00:00
operationId: UpdateListCustom
2024-04-04 00:19:25 +00:00
description: обновление списка кастомных полей
2024-04-04 09:32:27 +00:00
tags:
2024-04-09 07:43:11 +00:00
- main
2024-04-04 09:32:27 +00:00
responses:
'200':
2024-04-23 11:18:45 +00:00
$ref: '#/components/responses/200'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
2024-04-04 00:19:25 +00:00
/tags:
get:
2024-05-03 09:25:43 +00:00
operationId: GetTagsWithPagination
2024-04-07 17:13:17 +00:00
tags:
2024-04-09 07:43:11 +00:00
- main
2024-04-04 00:19:25 +00:00
description: получение списка тегов, закешированных у нас, с пагинацией https://www.amocrm.ru/developers/content/crm_platform/tags-api#%D0%A1%D0%BF%D0%B8%D1%81%D0%BE%D0%BA-%D1%82%D0%B5%D0%B3%D0%BE%D0%B2-%D0%B4%D0%BB%D1%8F-%D1%81%D1%83%D1%89%D0%BD%D0%BE%D1%81%D1%82%D0%B8
2024-04-04 19:21:43 +00:00
parameters:
2024-04-08 07:34:54 +00:00
- in: query
name: Pagination
description: Параметры пагинации
required: false
schema:
type: object
properties:
page:
type: integer
description: Номер страницы пагинации. Если не указан, используется значение по умолчанию.
example: 1
size:
type: integer
description: Размер страницы пагинации. Если не указан, используется значение по умолчанию.
example: 25
required:
- page
- size
2024-04-04 19:21:43 +00:00
responses:
'200':
2024-04-07 13:22:11 +00:00
description: успешное получение списка тегов
2024-04-04 19:21:43 +00:00
content:
'application/json':
schema:
2024-04-07 13:22:11 +00:00
$ref: "#/components/schemas/UserListTagsResp"
2024-04-23 12:22:12 +00:00
'400':
$ref: '#/components/responses/400'
2024-04-23 11:18:45 +00:00
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
2024-04-04 00:19:25 +00:00
patch:
2024-04-04 09:32:27 +00:00
operationId: UpdateListTags
2024-04-04 00:19:25 +00:00
description: обновление списка тегов
2024-04-04 09:32:27 +00:00
tags:
2024-04-09 07:43:11 +00:00
- main
2024-04-04 09:32:27 +00:00
responses:
'200':
2024-04-23 11:18:45 +00:00
$ref: '#/components/responses/200'
'401':
$ref: '#/components/responses/401'
'500':
$ref: '#/components/responses/500'
2024-04-08 08:20:10 +00:00
# таких запросах для блупринта обязательно нужно указывать параметры
2024-04-04 00:19:25 +00:00
/rules/{quizID}:
2024-04-04 09:32:27 +00:00
get:
2024-04-07 17:13:17 +00:00
operationId: GettingQuizRules
tags:
2024-04-09 07:43:11 +00:00
- main
2024-04-04 00:19:25 +00:00
description: получение настроек интеграции для конкретного квиза
2024-04-08 08:20:10 +00:00
parameters:
- in: path
name: quizID
required: true
schema:
type: string
description: Id квиза
2024-04-06 19:35:35 +00:00
responses:
'200':
description: успешное получение настройки интеграции
content:
'application/json':
schema:
$ref: "#/components/schemas/Rule"
2024-04-23 12:22:12 +00:00
'400':
$ref: '#/components/responses/400'
2024-06-04 16:05:53 +00:00
'404':
$ref: '#/components/responses/404'
2024-04-23 12:22:12 +00:00
'500':
$ref: '#/components/responses/500'
2024-04-04 00:19:25 +00:00
post:
2024-04-04 09:32:27 +00:00
operationId: SetQuizSettings
2024-05-03 07:49:29 +00:00
description: создание настроек интеграции для конкретного квиза, при успешном исходе кладет задачу в кафку, на 1 квиз 1 правило
2024-04-04 09:32:27 +00:00
tags:
2024-04-09 07:43:11 +00:00
- main
2024-04-08 15:24:50 +00:00
parameters:
- in: path
name: quizID
required: true
schema:
type: string
description: Id квиза
2024-04-08 08:20:10 +00:00
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/RulesReq"
2024-04-04 09:32:27 +00:00
responses:
'200':
$ref: '#/components/responses/200'
2024-04-23 12:22:12 +00:00
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
2024-06-04 16:05:53 +00:00
'404':
$ref: '#/components/responses/404'
2024-04-23 12:22:12 +00:00
'500':
$ref: '#/components/responses/500'
2024-04-04 00:19:25 +00:00
patch:
2024-04-04 09:32:27 +00:00
operationId: ChangeQuizSettings
2024-05-03 07:49:29 +00:00
description: изменение настроек интеграции для конкретного квиза, при успешном исходе кладет задачу в кафку, на 1 квиз 1 правило
2024-04-04 09:32:27 +00:00
tags:
2024-04-09 07:43:11 +00:00
- main
2024-04-08 15:24:50 +00:00
parameters:
- in: path
name: quizID
required: true
schema:
type: string
description: Id квиза
2024-04-08 08:20:10 +00:00
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/RulesReq"
2024-04-04 09:32:27 +00:00
responses:
'200':
$ref: '#/components/responses/200'
2024-04-23 12:22:12 +00:00
'400':
$ref: '#/components/responses/400'
'401':
$ref: '#/components/responses/401'
2024-06-04 16:05:53 +00:00
'404':
$ref: '#/components/responses/404'
2024-04-23 12:22:12 +00:00
'500':
$ref: '#/components/responses/500'
2024-04-04 19:21:43 +00:00
components:
schemas:
2024-04-06 19:35:35 +00:00
Rule:
type: object
description: объект настройки правил сохранения данных в амо
properties:
ID:
type: integer
2024-04-16 18:41:51 +00:00
description: айдишник в нашей системе Primary Key
2024-04-07 13:22:11 +00:00
AccountID:
2024-04-16 18:41:51 +00:00
type: integer
description: связь с аккаунтом в интеграции амо id в амо
2024-04-06 19:35:35 +00:00
QuizID:
type: integer
description: айдишник опроса
PerformerID:
type: integer
description: айдишник ответственного за сделку
PipelineID:
type: integer
description: айдишник воронки
StepID:
type: integer
description: айдишник этапа
FieldsRule:
type: object
description: правила заполнения полей сущностей в амо
properties:
lead:
2024-06-28 11:01:50 +00:00
$ref: '#/components/schemas/FieldRule'
2024-04-07 13:22:11 +00:00
contact:
2024-06-28 11:01:50 +00:00
$ref: '#/components/schemas/ContactRules'
2024-04-07 13:22:11 +00:00
company:
2024-06-28 11:01:50 +00:00
$ref: '#/components/schemas/FieldRule'
2024-04-07 13:22:11 +00:00
customer:
2024-06-28 11:01:50 +00:00
$ref: '#/components/schemas/FieldRule'
TagsToAdd:
type: object
properties:
Lead:
2024-04-06 19:35:35 +00:00
type: array
items:
type: integer
format: int64
description: Массив ID тегов для Leads, теги с id который наш Primary
Contact:
2024-04-06 19:35:35 +00:00
type: array
items:
type: integer
format: int64
description: Массив ID тегов для Contacts, теги с id который наш Primary
Company:
2024-04-06 19:35:35 +00:00
type: array
items:
type: integer
format: int64
description: Массив ID тегов для Company, теги с id который наш Primary
Customer:
2024-04-06 19:35:35 +00:00
type: array
items:
type: integer
format: int64
description: Массив ID тегов для Customer, теги с id который наш Primary
example:
Lead: [ 101, 102, 103 ]
Contact: [ 201, 202, 203 ]
Company: [ 301, 302, 303 ]
Customer: [ 401, 402, 403 ]
2024-04-06 19:35:35 +00:00
Deleted:
type: boolean
description: флаг мягкого удаления
CreatedAt:
type: integer
description: таймштамп создания воронки в нашей системе
FieldRule:
type: object
description: правила сопоставления вопроса полю
properties:
QuestionID:
type: integer
2024-04-17 08:35:56 +00:00
additionalProperties:
type: integer
description: сопоставление айдишника вопроса полю, которое будет заполняться ответом. соответственно QuestionID это айдишник вопроса. это я так мэпу пытался записать. Мапа, где ключи - QuestionID, значения - ID кастомного поля
2024-04-06 16:12:22 +00:00
Pipeline:
type: object
description: объект воронки амо
properties:
ID:
type: integer
2024-04-16 18:41:51 +00:00
description: айдишник в нашей системе Primary Key
2024-04-06 16:12:22 +00:00
AmoID:
type: integer
description: айдишник воронки в амо
2024-04-07 13:22:11 +00:00
AccountID:
2024-04-11 15:10:18 +00:00
type: integer
2024-04-16 18:41:51 +00:00
description: связь с аккаунтом в интеграции амо id аккаунта в амо
2024-04-06 16:12:22 +00:00
Name:
type: string
description: название воронки в амо
IsArchive:
type: boolean
description: флаг архивной воронки в амо
Deleted:
type: boolean
description: флаг мягкого удаления
CreatedAt:
type: integer
description: таймштамп создания воронки в нашей системе
2024-04-06 18:22:50 +00:00
Step:
type: object
description: объект шага воронки амо
properties:
ID:
type: integer
2024-04-16 18:41:51 +00:00
description: айдишник в нашей системе Primary Key
2024-04-06 18:22:50 +00:00
AmoID:
type: integer
description: айдишник шага воронки в амо
PipelineID:
type: integer
description: айдишник воронки в амо
2024-04-07 13:22:11 +00:00
AccountID:
2024-04-16 18:41:51 +00:00
type: integer
description: связь с аккаунтом в интеграции амо id в амо
2024-04-06 18:22:50 +00:00
Name:
type: string
description: название воронки в амо
Color:
type: string
description: цвет шага в амо
Deleted:
type: boolean
description: флаг мягкого удаления
CreatedAt:
type: integer
description: таймштамп создания воронки в нашей системе
Field:
type: object
description: объект кастомного поля амо
properties:
ID:
type: integer
2024-04-16 18:41:51 +00:00
description: айдишник в нашей системе Primary Key
2024-04-06 18:22:50 +00:00
AmoID:
type: integer
description: айдишник кастомного поля в амо
Code:
type: string
description: кодовое слово в амо
2024-04-07 13:22:11 +00:00
AccountID:
2024-04-12 11:52:38 +00:00
type: integer
2024-04-16 18:41:51 +00:00
description: связь с аккаунтом в интеграции амо id аккаунта в амо
2024-04-06 18:22:50 +00:00
Name:
type: string
description: название воронки в амо
EntityType:
type: string
description: тип сущности в амо, для которой это кастомное поле
Type:
type: string
description: тип поля https://www.amocrm.ru/developers/content/crm_platform/custom-fields#%D0%94%D0%BE%D1%81%D1%82%D1%83%D0%BF%D0%BD%D1%8B%D0%B5-%D1%82%D0%B8%D0%BF%D1%8B-%D0%BF%D0%BE%D0%BB%D0%B5%D0%B9
Deleted:
type: boolean
description: флаг мягкого удаления
CreatedAt:
type: integer
description: таймштамп создания воронки в нашей системе
UTM:
type: object
description: объект настройки UTM, данные о которых мы сохраняем в амо
properties:
ID:
type: integer
2024-04-16 18:41:51 +00:00
description: айдишник в нашей системе Primary Key
2024-04-06 18:22:50 +00:00
AmoFieldID:
type: integer
description: айдишник кастомного поля в амо
2024-04-06 19:35:35 +00:00
QuizID:
type: integer
description: айдишник квиза
2024-04-04 09:32:27 +00:00
AccountID:
2024-04-15 15:44:04 +00:00
type: integer
2024-04-16 18:41:51 +00:00
description: связь с аккаунтом в интеграции амо id амо
2024-04-06 18:22:50 +00:00
Name:
type: string
description: название тега в амо
Deleted:
type: boolean
description: флаг мягкого удаления
CreatedAt:
type: integer
description: таймштамп создания тега в нашей системе
2024-04-04 19:21:43 +00:00
Tag:
type: object
description: объект тега из амо
properties:
ID:
type: integer
2024-04-16 18:41:51 +00:00
description: айдишник в нашей системе Primary Key
2024-04-04 19:21:43 +00:00
AmoID:
type: integer
description: айдишник тега в амо
2024-04-07 13:22:11 +00:00
AccountID:
type: integer
2024-04-16 18:41:51 +00:00
description: связь с аккаунтом в интеграции амо id аккаунта в амо
2024-04-04 19:21:43 +00:00
Entity:
type: string
description: сущность, к которой принадлежит этот тег. Наверное, стоит сделать через enum в базе
Name:
type: string
description: название тега в амо
Color:
type: string
description: цвет тега в амо
2024-04-06 16:12:22 +00:00
Deleted:
type: boolean
description: флаг мягкого удаления
2024-04-04 19:21:43 +00:00
CreatedAt:
type: integer
description: таймштамп создания тега в нашей системе
2024-06-12 15:22:44 +00:00
AccountAmo:
2024-04-04 19:57:33 +00:00
type: object
2024-06-12 15:22:44 +00:00
description: модель основного аккаунта "компании" амо
2024-04-04 19:57:33 +00:00
properties:
2024-06-12 15:22:44 +00:00
id:
2024-04-04 19:57:33 +00:00
type: integer
2024-06-12 15:22:44 +00:00
format: int64
description: postgres big serial
accountID:
2024-04-04 19:57:33 +00:00
type: string
2024-06-12 15:22:44 +00:00
description: ID аккаунта нашей системы
amoID:
2024-04-04 19:57:33 +00:00
type: integer
2024-06-12 15:22:44 +00:00
format: int32
description: ID компании в AmoCRM
name:
2024-04-04 19:57:33 +00:00
type: string
2024-06-12 15:22:44 +00:00
description: Название компании
deleted:
type: boolean
description: Флаг, указывающий на удаление
createdAt:
2024-04-04 19:57:33 +00:00
type: string
2024-06-12 15:22:44 +00:00
format: date-time
description: Время создания
subdomain:
2024-04-04 19:57:33 +00:00
type: string
2024-06-12 15:22:44 +00:00
description: Поддомен компании в амо
country:
2024-04-04 19:57:33 +00:00
type: string
2024-06-12 15:22:44 +00:00
description: Страна
driveURL:
type: string
description: URL объектного хранилища
2024-06-18 09:20:47 +00:00
stale:
2024-04-06 16:12:22 +00:00
type: boolean
2024-06-18 09:20:47 +00:00
description: флаг "не свежести" если с токенами все в порядке - false, если просрочились то true
2024-06-12 15:22:44 +00:00
UserAmoAccount:
type: object
description: объект пользователя аккаунта амо, который находится под компанией которая подключилась
properties:
id:
2024-04-04 19:57:33 +00:00
type: integer
2024-06-12 15:22:44 +00:00
format: int64
description: postgres big serial
amoID:
2024-04-07 13:22:11 +00:00
type: integer
2024-06-12 15:22:44 +00:00
format: int32
description: ID компании в амо, к которой пользователь принадлежит
amoUserID:
2024-05-03 09:25:43 +00:00
type: integer
2024-06-12 15:22:44 +00:00
format: int32
description: ID пользователя в амо
name:
type: string
description: Имя
email:
2024-04-11 09:29:17 +00:00
type: string
2024-06-12 15:22:44 +00:00
description: Email
role:
type: integer
format: int32
description: Роль
group:
type: integer
format: int32
description: Группа
deleted:
type: boolean
description: Флаг, указывающий на удаление
createdAt:
type: string
2024-06-12 15:22:44 +00:00
format: date-time
description: Время создания записи
2024-04-07 13:22:11 +00:00
ConnectAccountResp:
type: object
properties:
link:
type: string
description: ссылка для авторизации в амо
GetListUserUTMResp:
type: object
properties:
count:
type: integer
description: общее количество юзеров, которые у нас закешированы для этого пользователя
items:
type: array
description: список юзеров, которые были закешированы нашим сервисом
items:
$ref: "#/components/schemas/UTM"
SaveUserListUTMReq:
type: object
properties:
utms:
type: array
description: список utm для сохранения. сохранять только те, которых в этом аккаунте ещё нет
items:
2024-04-15 15:44:04 +00:00
$ref: "#/components/schemas/UTM"
2024-04-07 13:22:11 +00:00
ListSavedIDUTMResp:
type: object
properties:
IDs:
type: array
description: список айдишников сохранённых меток
items:
type: string
ListDeleteUTMIDsReq:
type: object
properties:
utms:
type: array
description: список айдишников utm которые удалить
items:
2024-05-03 09:25:43 +00:00
type: integer
2024-04-07 13:22:11 +00:00
UserListResp:
type: object
properties:
count:
type: integer
2024-06-12 15:22:44 +00:00
description: общее количество юзеров, которые у нас закешированы для этого пользователя и его компании
2024-04-07 13:22:11 +00:00
items:
type: array
description: список юзеров, которые были закешированы нашим сервисом
items:
2024-06-12 15:22:44 +00:00
$ref: "#/components/schemas/UserAmoAccount"
2024-04-07 13:22:11 +00:00
UserListPipelinesResp:
type: object
properties:
count:
type: integer
description: общее количество воронок, которые у нас закешированы для этого пользователя
items:
type: array
description: список воронок, которые были закешированы нашим сервисом
items:
$ref: "#/components/schemas/Pipeline"
UserListStepsResp:
type: object
properties:
count:
type: integer
description: общее количество шагов воронок, которые у нас закешированы для этого пользователя
items:
type: array
description: список шагов воронок, которые были закешированы нашим сервисом
items:
2024-04-08 07:22:03 +00:00
$ref: "#/components/schemas/Step"
2024-04-07 13:22:11 +00:00
UserListFieldsResp:
type: object
properties:
count:
type: integer
description: общее количество кастомных полей, которые у нас закешированы для этого пользователя
items:
type: array
description: список кастомных полей, которые были закешированы нашим сервисом
items:
$ref: "#/components/schemas/Field"
UserListTagsResp:
type: object
properties:
count:
type: integer
description: общее количество тегов, которые у нас закешированы для этого пользователя
items:
type: array
description: список тегов, которые были закешированы нашим сервисом
items:
$ref: "#/components/schemas/Tag"
2024-04-07 17:13:17 +00:00
PaginationReq:
type: object
properties:
page:
type: integer
description: указание страницы пагинации. Если страница не указана, применять 0
size:
type: integer
description: указание размера страницы пагинации. По умолчанию применять 25
2024-04-08 08:20:10 +00:00
RulesReq:
type: object
properties:
2024-04-23 11:18:45 +00:00
PerformerID:
type: integer
description: "айдишник ответственного за сделку"
PipelineID:
type: integer
description: "айдишник воронки"
StepID:
type: integer
description: "айдишник этапа"
Fieldsrule:
type: object
properties:
Lead:
2024-06-28 11:01:50 +00:00
$ref: '#/components/schemas/FieldRule'
2024-04-23 11:18:45 +00:00
Contact:
2024-06-28 11:01:50 +00:00
$ref: '#/components/schemas/ContactRules'
2024-04-23 11:18:45 +00:00
Company:
2024-06-28 11:01:50 +00:00
$ref: '#/components/schemas/FieldRule'
2024-04-23 11:18:45 +00:00
Customer:
2024-06-28 11:01:50 +00:00
$ref: '#/components/schemas/FieldRule'
TagsToAdd:
type: object
properties:
Lead:
type: array
items:
type: integer
format: int64
description: Массив ID тегов для Leads, теги с id который наш Primary
Contact:
type: array
items:
type: integer
format: int64
description: Массив ID тегов для Contacts, теги с id который наш Primary
Company:
type: array
items:
type: integer
format: int64
description: Массив ID тегов для Company, теги с id который наш Primary
Customer:
type: array
items:
type: integer
format: int64
description: Массив ID тегов для Customer, теги с id который наш Primary
example:
Lead: [ 101, 102, 103 ]
Contact: [ 201, 202, 203 ]
Company: [ 301, 302, 303 ]
Customer: [ 401, 402, 403 ]
2024-05-07 13:25:57 +00:00
ContactRules:
type: object
description: правила заполнения сущности контакта, название поля = id кастомного поля в амо
properties:
ContactRuleMap:
type: string
additionalProperties:
type: integer
2024-06-28 11:01:50 +00:00
QuestionID:
type: integer
additionalProperties:
type: integer
description: сопоставление айдишника вопроса полю, которое будет заполняться ответом. соответственно QuestionID это айдишник вопроса. это я так мэпу пытался записать. Мапа, где ключи - QuestionID, значения - ID кастомного поля
2024-04-08 08:20:10 +00:00
responses:
'200':
description: Success
content:
application/json:
schema:
type: string
description: Success
'201':
description: Created
content:
application/json:
schema:
type: string
description: Created
'204':
description: No content
content:
application/json:
schema:
type: string
description: No content
'400':
description: Bad Request
content:
application/json:
schema:
type: string
description: Bad Request
'401':
description: Unauthorized
content:
application/json:
schema:
type: string
description: Unauthorized
'403':
description: Forbidden
content:
application/json:
schema:
type: string
description: Forbidden
'404':
description: Not Found
content:
application/json:
schema:
type: string
description: Not Found
'500':
description: Internal Server Error
content:
application/json:
schema:
type: string
description: Internal Server Error