ЕСОЗ - публічна документація
Public. Initialize Contract Request
Purpose
This web service allows to initialize the contract request creation by generating links for the contract_request documents upload.
Overview
Legal entity owner with 'contract_request:create' scope can initialize the contract request creation
WS responds with contract_request id and links that should be used for documents upload
After documents are uploaded, contract_request id from the response should be used for Create Contract Request WS
Specification
Link | Посилання на Apiary або Swagger | |
Resource | /api/contract_requests/{{contract_type}} | Посилання на ресурс, наприклад: /api/persons/create |
Scope | contract_request:create | Scope для доступу |
Components | Contracts | Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription |
Microservices | API paragraph not found | Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC |
Protocol type | REST | Тип протоколу, який використовується запитом, наприклад: SOAP | REST |
Request type | POST | Тип запиту API, наприклад: GET, POST, PATCH… |
Sync/Async | API paragraph not found | Метод є синхронним чи асинхронним? |
Public/Private/Internal | Public | Потрібно зазначити тип методу за ступенем доступності |
Input parameters
Input parameter | Values | Type | Description | Example |
---|---|---|---|---|
contract_type | CAPITATION or REIMBURSEMENT | String | Required |
|
Authorize
Request to process the request using a token in the headers
Headers
Наприклад:
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
Request data validation
Validate token
Verify the validity of access token
Return 401 in case validation fails
Check if token is not expired
in case error return 401 - "Token is expired"
Validate user
extract user_id from token
extract client_id from token
Check if user is active
in case error return 403 - (user is not active)
check legal_entity is active
in case error return 403 - (Client is not active)
Check user role is "OWNER"
in case error return 403 "User is not allowed to perform this action"
Validate scopes
Check user scopes in order to perform this action (scope = 'contract_request:create')
Return 403 in case invalid scope(s) "Your scope does not allow to access this resource. Missing allowances: contract_request:create"
Response structure
Set
field | value |
---|---|
$id | contract_request.id |
$statute_url | link to Storage for uploading contract_request_statute |
$additional_document_url | link to Storage for uploading contract_request_additional_document_url |
Example:
Post-processing processes
API paragraph not found
HTTP status codes
HTTP status code | Message | What caused the error |
---|---|---|
200 | Response |
|
401 |
|
|
403 |
|
|
ЕСОЗ - публічна документація