210 lines
7.9 KiB
YAML
210 lines
7.9 KiB
YAML
openapi: 3.0.3
|
||
info:
|
||
title: QUIZ AMOCRM integration
|
||
description: Интеграция с Амо. Ключевая задача - создавать заявки в соответствующей воронкой подключенного аккаунта
|
||
version: 1.0.0
|
||
|
||
tags:
|
||
- name: account
|
||
description: Операции связанные с аккаунтом
|
||
- name: different
|
||
description: Различные операции связанные с AmoCRM
|
||
|
||
|
||
paths:
|
||
/account:
|
||
post:
|
||
operationId: ConnectAccount
|
||
summary: подключение аккаунта амо к аккаунту quiz. На вход получает только токен. На выход отдаёт ссылку для подключения. Создаёт модель аккаунта, имеющую связь с основным аккаунтом
|
||
tags:
|
||
- account
|
||
responses:
|
||
'200':
|
||
description: успешное создание ссылки для авторизации
|
||
content:
|
||
'application/json':
|
||
schema:
|
||
$ref: '#/components/schemas/ConnectAccountResp'
|
||
|
||
delete:
|
||
operationId: SoftDeleteAccount
|
||
summary: мягкое удаление аккаунта. Юзер должен иметь возможность создать новый аккаунт, взамен удалённого
|
||
tags:
|
||
- account
|
||
responses:
|
||
'200':
|
||
description: успешное удаление аккаунта
|
||
get:
|
||
operationId: GetCurrentAccount
|
||
summary: получение текущего аккаунта
|
||
tags:
|
||
- account
|
||
responses:
|
||
'200':
|
||
description: аккаунт интеграции с амо
|
||
content:
|
||
'application/json':
|
||
schema:
|
||
$ref: '#/components/schemas/GetCurrentAccountResp'
|
||
/webhook/create:
|
||
get:
|
||
operationId: WebhookCreate
|
||
summary: это метод для получения пары токенов для аккаунта. Пары токенов стоит хранить в отдельной таблице и завести воркер, который будет обновлять рефреш. https://www.amocrm.ru/developers/content/oauth/step-by-step - вот дока для этого метода
|
||
tags:
|
||
- different
|
||
responses:
|
||
'200':
|
||
description: okay
|
||
/webhook/delete:
|
||
get:
|
||
operationId: WebhookDelete
|
||
summary: это метод для оповещения об удалении итеграции из учетки в амо. При его вызове надо мягко удалить соответствующий аккаунт. 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
|
||
tags:
|
||
- different
|
||
responses:
|
||
'200':
|
||
description: okay
|
||
/users:
|
||
get:
|
||
operationId: GetListUsers
|
||
summary: получение списка юзеров, закешированных у нас, с пагинацией https://www.amocrm.ru/developers/content/crm_platform/users-api#users-list
|
||
tags:
|
||
- account
|
||
responses:
|
||
'200':
|
||
description: okay
|
||
patch:
|
||
operationId: UpdateListUsers
|
||
summary: обновление списка юзеров
|
||
tags:
|
||
- account
|
||
responses:
|
||
'200':
|
||
description: okay
|
||
/pipelines:
|
||
get:
|
||
operationId: GetListPipelines
|
||
summary: получение списка воронок, закешированных у нас, с пагинацией https://www.amocrm.ru/developers/content/crm_platform/leads_pipelines
|
||
tags:
|
||
- different
|
||
responses:
|
||
'200':
|
||
description: okay
|
||
patch:
|
||
operationId: UpdateListPipelines
|
||
summary: обновление списка воронок
|
||
tags:
|
||
- different
|
||
responses:
|
||
'200':
|
||
description: okay
|
||
/steps:
|
||
get:
|
||
operationId: GetListSteps
|
||
summary: получение списка этапов воронок, закешированных у нас, с пагинацией 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
|
||
tags:
|
||
- different
|
||
responses:
|
||
'200':
|
||
description: okay
|
||
patch:
|
||
operationId: UpdateListSteps
|
||
summary: обновление списка этапов воронок
|
||
tags:
|
||
- different
|
||
responses:
|
||
'200':
|
||
description: okay
|
||
/fields:
|
||
get:
|
||
operationId: GetListCustom
|
||
summary: получение списка кастомных полей, закешированных у нас, с пагинацией 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
|
||
tags:
|
||
- different
|
||
responses:
|
||
'200':
|
||
description: okay
|
||
patch:
|
||
operationId: UpdateListCustom
|
||
summary: обновление списка кастомных полей
|
||
tags:
|
||
- different
|
||
responses:
|
||
'200':
|
||
description: okay
|
||
/tags:
|
||
get:
|
||
operationId: GetListTags
|
||
summary: получение списка тегов, закешированных у нас, с пагинацией 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
|
||
tags:
|
||
- different
|
||
responses:
|
||
'200':
|
||
description: okay
|
||
patch:
|
||
operationId: UpdateListTags
|
||
summary: обновление списка тегов
|
||
tags:
|
||
- different
|
||
responses:
|
||
'200':
|
||
description: okay
|
||
/rules/{quizID}:
|
||
get:
|
||
operationId: GetQuizSettings
|
||
summary: получение настроек интеграции для конкретного квиза
|
||
tags:
|
||
- different
|
||
responses:
|
||
'200':
|
||
description: okay
|
||
post:
|
||
operationId: SetQuizSettings
|
||
summary: создание настроек интеграции для конкретного квиза
|
||
tags:
|
||
- different
|
||
responses:
|
||
'200':
|
||
description: okay
|
||
patch:
|
||
operationId: ChangeQuizSettings
|
||
summary: изменение настроек интеграции для конкретного квиза
|
||
tags:
|
||
- different
|
||
responses:
|
||
'200':
|
||
description: okay
|
||
|
||
components:
|
||
schemas:
|
||
ConnectAccountResp:
|
||
type: object
|
||
properties:
|
||
link:
|
||
type: string
|
||
description: ссылка для авторизации в амо
|
||
GetCurrentAccountResp:
|
||
type: object
|
||
properties:
|
||
ID:
|
||
type: string
|
||
description: uuid
|
||
AccountID:
|
||
type: string
|
||
description: связь с аккаунтом в квизе
|
||
AmocrmID:
|
||
type: integer
|
||
description: связь с аккаунтом в амо
|
||
Name:
|
||
type: string
|
||
description: имя аккаунта в амо
|
||
Subdomain:
|
||
type: string
|
||
description: поддомен организации в амо
|
||
AmoUserID:
|
||
type: integer
|
||
description: айдишник пользвателя, который подключал интеграцию
|
||
Country:
|
||
type: string
|
||
description: страна указанная в настройках амо
|