openapi: 3.0.0 info: title: Advertisement Service description: API для обработки взаимодействия с платформами version: 1.0.0 servers: - url: http://re-target.ru/api/v1/adv tags: - name: advertisement description: Работа с платформами paths: /link/generate: put: tags: - advertisement summary: Создать уникальную ссылку для платформы description: Создаёт (если её нет, иначе изменяет) и Возвращает уникальную ссылку платформы parameters: - in: cookie name: session_id required: true schema: type: string responses: 201: description: Ссылка создана успешно content: application/json: schema: type: object properties: service: type: object properties: success: type: string example: "Created" body: type: object properties: secret-link: type: string example: http://re-target.ru/api/v1/adv/iframe/secret-link 200: description: У пользователя уже есть ссылка, вернём её content: application/json: schema: type: object properties: service: type: object properties: success: type: string example: "Sent" body: type: object properties: secret-link: type: string example: http://re-target.ru/api/v1/adv/iframe/secret-link 401: description: Не авторизован content: application/json: schema: type: object properties: service: type: object properties: error: type: string example: "Unauthorized" 405: description: Неверный метод запроса content: text/plain: schema: type: string example: Method Not Allowed 500: description: Ошибка поиска или создания ссылки content: application/json: schema: type: object properties: service: type: object properties: error: type: string example: "some error" /link/my: get: tags: - advertisement summary: Получить уникальную ссылку для платформы description: Возвращает уникальную ссылку платформы parameters: - in: cookie name: session_id required: true schema: type: string responses: 200: description: Ссылка найдена успешно content: application/json: schema: type: object properties: service: type: object properties: success: type: string example: "Sent" body: type: object properties: secret-link: type: string example: http://re-target.ru/api/v1/adv/iframe/secret-link 401: description: Не авторизован content: application/json: schema: type: object properties: service: type: object properties: error: type: string example: Unauthorized 400: description: Ошибка поиска ссылки (если у платформы нет ссылки) content: application/json: schema: type: object properties: service: type: object properties: error: type: string example: "Link by user_id not found" 500: description: Ошибка content: application/json: schema: type: object properties: service: type: object properties: error: type: string example: "some error" /iframe/secret-link: get: tags: - advertisement summary: Получить iframe по уникальной ссылке платформы description: Возвращает объект типа text/html с бизнес-логикой на клиенте parameters: - in: cookie name: session_id required: false schema: type: string responses: 200: description: Iframe получен успешно content: text/html: schema: type: string format: html example: |