Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 13.42 KB | None | 0 0
  1. openapi: 3.0.0
  2. info:
  3.   title: 'СПС:API для взаимодействия с Банком'
  4.   contact:
  5.     email: developer@esphere.ru
  6.   version: 1.0.0-oas3
  7. servers:
  8.   - url: 'https://test.epshere.ru/api'
  9. tags:
  10.   - name: token
  11.     description: Методы получения сессионного токена
  12.   - name: requests
  13.     description: Методы работы с запросам от МВД в Банк
  14.   - name: tickets
  15.     description: Методы работы с квитанциями от Банка
  16.   - name: responses
  17.     description: Методы работы с ответом от Банка
  18. paths:
  19.   '/token':
  20.     post:
  21.       tags:
  22.        - token
  23.       summary: Метод получения сессионного токена
  24.       description: Возвращает сессионный токен, с ограниченным сроком действия
  25.       requestBody:
  26.         required: true
  27.         content:
  28.           application/x-www-form-urlencoded:
  29.             schema:
  30.               type: object
  31.               properties:
  32.                 apiKey:
  33.                   type: string
  34.                   description: Ключ приложения
  35.               required:
  36.                - apiKey
  37.       responses:
  38.         '200':
  39.           description: OK
  40.           content:
  41.             application/json:
  42.               schema:
  43.                 $ref: '#/components/schemas/token'
  44.         '403':
  45.           $ref: '#/components/responses/Forbidden'
  46.         '500':
  47.           $ref: '#/components/responses/InternalServerError'
  48.   '/v1.0/request':
  49.     get:
  50.       security:
  51.         - bearerAuth: []
  52.       tags:
  53.        - requests
  54.       summary: Возвращает список запросов в Банк
  55.       description: 'Метод возвращает  список запросов МВД, которые требуют ответа от Банка'
  56.       responses:
  57.         '200':
  58.           description: OK
  59.           content:
  60.             application/json:
  61.               schema:
  62.                 $ref: '#/components/schemas/list'
  63.         '401':
  64.           $ref: '#/components/responses/Unauthorized'
  65.         '403':
  66.           $ref: '#/components/responses/Forbidden'
  67.         '500':
  68.           $ref: '#/components/responses/InternalServerError'
  69.     delete:
  70.       security:
  71.         - bearerAuth: []
  72.       tags:
  73.        - requests
  74.       description: Метод удаляет несколько запросов
  75.       parameters:
  76.         - in: query
  77.           name: id
  78.           schema:
  79.             type: array
  80.             items:
  81.               type: string
  82.               format: uuid
  83.       responses:
  84.         '200':
  85.           description: OK
  86.           content:
  87.             application/json:
  88.               schema:
  89.                 $ref: '#/components/schemas/list'
  90.         '400':
  91.           $ref: '#/components/responses/BadRequest'
  92.         '401':
  93.           $ref: '#/components/responses/Unauthorized'
  94.         '403':
  95.           $ref: '#/components/responses/Forbidden'
  96.         '500':
  97.           $ref: '#/components/responses/InternalServerError'
  98.   '/v1.0/request/{id}':
  99.     get:
  100.       security:
  101.         - bearerAuth: []
  102.       tags:
  103.        - requests
  104.       summary: Метод получения метаданных по запросу
  105.       description: Метод возвращает мета-информацию по конкретному запросу
  106.       parameters:
  107.         - name: id
  108.           in: path
  109.           description: Идентификатор запроса должен быть получен из метода получения списка запроса
  110.           required: true
  111.           schema:
  112.             type: string
  113.             format: uuid
  114.       responses:
  115.         '200':
  116.           description: OK
  117.           content:
  118.             application/json:
  119.               schema:
  120.                 $ref: '#/components/schemas/request'
  121.         '400':
  122.           $ref: '#/components/responses/BadRequest'
  123.         '401':
  124.           $ref: '#/components/responses/Unauthorized'
  125.         '403':
  126.           $ref: '#/components/responses/Forbidden'
  127.         '500':
  128.           $ref: '#/components/responses/InternalServerError'
  129.     delete:
  130.       security:
  131.         - bearerAuth: []
  132.       tags:
  133.        - requests
  134.       summary: Метод удаления запроса из очереди для отправки в Банк
  135.       description: Метод удаляет завпрос из очереди  для отправки в Банк
  136.       parameters:
  137.         - name: id
  138.           in: path
  139.           description: Список запрос для удаления через ;
  140.           required: true
  141.           schema:
  142.             type: string
  143.             format: uuid
  144.       responses:
  145.         '200':
  146.           description: OK
  147.         '400':
  148.           $ref: '#/components/responses/BadRequest'
  149.         '401':
  150.           $ref: '#/components/responses/Unauthorized'
  151.         '403':
  152.           $ref: '#/components/responses/Forbidden'
  153.         '500':
  154.           $ref: '#/components/responses/InternalServerError'
  155.   '/v1.0/request/{id}/content/{contentId}':
  156.     get:
  157.       security:
  158.         - bearerAuth: []
  159.       tags:
  160.        - requests
  161.       summary: Метод получения файлов
  162.       description: Метод возвращает зашифрованные файлы к запросу
  163.       parameters:
  164.         - name: id
  165.           in: path
  166.           description: Идентификатор запроса должен быть получен из метода получения списка запроса
  167.           required: true
  168.           schema:
  169.             type: string
  170.             format: uuid
  171.         - name: contentId
  172.           in: path
  173.           description: Идентификатор файла должен быть получен из метода получения мета-информации по запросу
  174.           required: true
  175.           schema:
  176.             type: string
  177.             format: uuid
  178.       responses:
  179.         '200':
  180.           description: OK
  181.           content:
  182.             application/octet-stream:
  183.               schema:
  184.                 type: string
  185.                 format: binary
  186.         '400':
  187.           $ref: '#/components/responses/BadRequest'
  188.         '401':
  189.           $ref: '#/components/responses/Unauthorized'
  190.         '403':
  191.           $ref: '#/components/responses/Forbidden'
  192.         '500':
  193.           $ref: '#/components/responses/InternalServerError'
  194.   '/v1.0/request/{id}/ticket':
  195.     post:
  196.       security:
  197.         - bearerAuth: []
  198.       tags:
  199.        - tickets
  200.       summary: Метод публикации квитанции от Банка
  201.       description: Метод  для публикации квитанции от Банка. Квитанцию публикует Банк после обработки запроса
  202.       parameters:
  203.         - name: id
  204.           in: path
  205.           description: Идентификатор запроса
  206.           required: true
  207.           schema:
  208.             type: string
  209.             format: uuid
  210.       requestBody:
  211.         required: true
  212.         content:
  213.           application/json:
  214.             schema:
  215.               $ref: '#/components/schemas/signedFile'
  216.       responses:
  217.         '201':
  218.           description: Created
  219.         '400':
  220.           $ref: '#/components/responses/BadRequest'
  221.         '401':
  222.           $ref: '#/components/responses/Unauthorized'
  223.         '403':
  224.           $ref: '#/components/responses/Forbidden'
  225.         '500':
  226.           $ref: '#/components/responses/InternalServerError'
  227.   '/v1.0/request/{id}/response':
  228.     post:
  229.       security:
  230.         - bearerAuth: []
  231.       tags:
  232.        - responses
  233.       summary: Метод публикации ответа  от Банка на запрос МВД
  234.       description: Банк публикует ответ на запрос МВД
  235.       parameters:
  236.         - name: id
  237.           in: path
  238.           description: Идентификатор запроса
  239.           required: true
  240.           schema:
  241.             type: string
  242.             format: uuid
  243.       requestBody:
  244.         content:
  245.           multipart/form-data:
  246.             schema:
  247.               type: object
  248.               properties:
  249.                 packageDescription:
  250.                   $ref: '#/components/schemas/packageDescription'
  251.                 packageContent:
  252.                   type: array
  253.                   description: Содержимое пакета дкоументов
  254.                   items:
  255.                     type: string
  256.                     format: binary
  257.       responses:
  258.         '201':
  259.           description: Created
  260.         '400':
  261.           description: Ошибка входных параметров
  262.         '401':
  263.           description: Некорректно указан сессионный токен
  264.         '404':
  265.           description: Запрос не найден
  266.         '500':
  267.           description: При обработке запроса возникла непредвиденная ошибка
  268. components:
  269.   schemas:
  270.     fileType:
  271.       type: string
  272.       description: 'Тип файла: xml/pdf'
  273.       enum:
  274.        - Xml
  275.         - Pdf
  276.     list:
  277.       type: array
  278.       items:
  279.         maxLength: 255
  280.         type: string
  281.         format: uuid
  282.     request:
  283.       type: object
  284.       properties:
  285.         id:
  286.           maxLength: 255
  287.           type: string
  288.           description: Идентификатор запроса
  289.         date:
  290.           type: string
  291.           description: Дата и время формирования запроса
  292.           format: date-time
  293.         caseNumber:
  294.           maxLength: 255
  295.           type: string
  296.           description: Номер дела
  297.         caseDate:
  298.           type: string
  299.           description: Дата возбуждения дела
  300.           format: date
  301.         caseType:
  302.           type: string
  303.           description: 'Признак: уголовное дело/судебное решение'
  304.           enum:
  305.            - Judgment
  306.             - Criminal
  307.         status:
  308.           type: string
  309.           description: 'Статусы запроса'
  310.           enum:
  311.            - Agreement
  312.             - Rejected
  313.             - Awaiting
  314.             - Error
  315.             - Done
  316.         signatures:
  317.           type: array
  318.           description: Подписи
  319.           items:
  320.             type: string
  321.             format: byte
  322.         certificates:
  323.           type: array
  324.           description: Сертификаты шифрования
  325.           items:
  326.             type: string
  327.             format: byte
  328.         content:
  329.           type: array
  330.           description: Информация по дополнительным файлам
  331.           items:
  332.             $ref: '#/components/schemas/contentInfo'
  333.     contentInfo:
  334.       type: object
  335.       properties:
  336.         id:
  337.           type: string
  338.           description: Идентификатор файла для скачивания
  339.         fileName:
  340.           type: string
  341.           maxLength: 255
  342.           description: Имя документа
  343.         type:
  344.           $ref: '#/components/schemas/fileType'
  345.         encrypted:
  346.           type: boolean
  347.           description: Признак зашифрованного файла
  348.     token:
  349.       type: object
  350.       properties:
  351.         access_token:
  352.           type: string
  353.         token_type:
  354.           type: string
  355.           enum:
  356.            - Bearer
  357.         expires_in:
  358.           type: number
  359.           format: int32
  360.           description: 'Время жизни токена, в секундах'
  361.     signedFile:
  362.       type: object
  363.       properties:
  364.         content:
  365.           type: string
  366.           format: byte
  367.         signature:
  368.           type: string
  369.           format: byte
  370.       required:
  371.        - content
  372.         - signature
  373.     packageDescription:
  374.       type: object
  375.       properties:
  376.         documents:
  377.           type: array
  378.           items:
  379.             $ref: '#/components/schemas/document'
  380.         signatures:
  381.           type: array
  382.           items:
  383.             $ref: '#/components/schemas/signature'
  384.     document:
  385.       type: object
  386.       properties:
  387.         id:
  388.           type: string
  389.           format: uuid
  390.           description: Идентификатор документа
  391.         fileName:
  392.           type: string
  393.           maxLength: 255
  394.         type:
  395.           $ref: '#/components/schemas/fileType'
  396.         encrypted:
  397.           type: boolean
  398.           description: Признак зашифрованного файла
  399.     signature:
  400.       type: object
  401.       properties:
  402.         documentRef:
  403.           type: string
  404.           format: uuid
  405.         signature:
  406.           type: string
  407.           format: byte
  408.       required:
  409.        - documentRef
  410.         - signature
  411.   responses:
  412.     BadRequest:
  413.       description: Ошибка входных параметров
  414.     Unauthorized:
  415.       description: Требуется авторизация
  416.     Forbidden:
  417.       description: Не авторизован
  418.     NotFound:
  419.       description: Ресурс не найден
  420.     InternalServerError:
  421.       description: Возникли непредвиденные ошибки во время выполнения операции
  422.   securitySchemes:
  423.     bearerAuth:
  424.       type: http
  425.       scheme: bearer
  426.       bearerFormat: JWT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement