Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Purpose

This method is designed to generate links to media storage for thirds parties as a part of:

  • ambulatory contracts process

Specification

Apiary

...

Page Properties
idAPI_Specification

Link

Apiary

Посилання на Apiary або Swagger

Resource

Посилання на ресурс, наприклад: /api/persons/create

Scope

private_contracts:write

Scope для доступу

Components

Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription

Microservices

Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC

Protocol type

Тип протоколу, який використовується запитом, наприклад: SOAP | REST

Request type

Тип запиту API, наприклад: GET, POST, PATCH…

Sync/Async

Метод є синхронним чи асинхронним?

Public/Private/Internal

Потрібно зазначити тип методу за ступенем доступності

Logic

  1. Only authenticated and authorized user can use this service

  2. All files will be stored in separated bucket

  1. Create new separated bucket for such files

  2. Bucket name - ambulatory_contracts

...

  1. (prod), ambulatory_contracts-preprod (preprod), ambulatory_contracts-demo (demo)

Request structure

See on Apiary

Authorize

  1. Verify the validity of api-key

    1. Return 401 in case validation fails

  2. Verify the validity of token

    1. Return 401 in case validation fails

  3. Check scopes in order to perform this action (scope = 'private_contracts:write')

    1. Return 403 in case invalid scope(s)

...

Headers

Request data validation

  1. Validate request using JSON schema

    1. Return 422 in case validation fails

...

Processing

  1. Invoke AEL rpc - generate secure link for requested action, resource_id (folder identifier - contractor_legal_entity_id) and resource_name (file name*) in configured bucket

*If the file name consists of several words, it must be encoded using Percent-encoding before executing the request.

Response structure

See on Apiary

Post-processing processes

HTTP status codes