ЕСОЗ - публічна документація

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Required parameters are marked with "*"

Якщо інформації по відповідному параметру немає, потрібно зазначити: “API paragraph not found”.

Purpose*

Use this method to obtain list of Declaration Requests for an empolee_id.

Specification*

Link

Apiary

Resource

/api/v3/declaration_requests

Scope

declaration_request:read

Components

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

Using Dictionaries

Потрібно вказати словники, які використовує метод API

Using Microservices

Вкажіть перелік мікросервісів, які використовує метод API. Наприклад: Auth, ABAC

Protocol type

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

Request type

GET

Sync/Async

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

Logic*

  1. Only authenticated and authorized user can use declaration requests

If you want to reduce amount of data that is going trough your application, use status filter and show only requests that Doctor or Admin is interested in current UI section.

Also we suggest use employee_id and legal_entity_id to make sure that end-user understands context of actions that he or she will perform.

Method returns shortened details, to obtain full information - get Declaration Request it by it's ID.

Important

This endpoint shows the declaration requests which are created by V2 and V3. Due to the fact that structure of declaration request V3 is different from the structure of decl request V2 , so not all fields of declaration request v2 can be displayed. If declaration request is created by v2, the field person_id will be empty

Filters

Filter

Values

Type

Description

Example

 employee_id

 

String

user_id of a doctor

d290f1ee-6c54-4b01-90e6-d701748f0851

legal_entity_id

String

MSP ID

d290f1ee-6c54-4b01-90e6-d701748f0851

status

  • NEW

  • APPROVED

  • SIGNED

  • REJECTED

  • CANCELLED

Enum

 

active

page

Number

Page number

2

page_size

Number

A limit on the number of objects to be returned, between 1 and 100. Default: 50

50

Request structure*

See on Apiary

Authorize*

  1. Verify the validity of access token

    1. Return 401 in case validation fails

  2. Check scopes in order to perform this action (scope = 'declaration_request:read')

    1. Return 403 in case invalid scope(s)

Request to process the request using a token in the headers.

Headers*

  • Content-Type:application/json

  • Authorization:Bearer c2778f3064753ea70de870a53795f5c9

Validate request (JSON schema)*

Наприклад:

  1. Validate request using JSON schema

    1. In case validation failed - generate 422 error

 JSON schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "verification_code": {
      "type": "string"
    }
  },
  "required": [
    "verification_code"
  ],
  "additionalProperties": false
}

Validation data request*

Processing*

Response structure*

on Apiary

 Request example
{
  "meta": {
    "code": 200,
    "url": "https://example.com/resource",
    "type": "object",
    "request_id": "req-adasdoijasdojsda"
  },
  "data": [
    {
      "id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
      "start_date": "2017-03-02",
      "end_date": "2025-03-02",
      "status": "NEW",
      "person_id": "4fa9cac7-8950-44db-9294-0daba56eed58",
      "employee_id": "60a797bb-43c5-463d-86ee-68e354cb626b",
      "division_id": "4c9c9c6e-5230-444d-8b65-7678da1c1ab3",
      "legal_entity_id": "56b8bcd7-78b8-4ff7-8a60-a48e54a6ef57",
      "authorize_with": "cc949559-5dfe-420f-ac05-065e443b2cc6",
      "parent_declaration_id": "8c7753fc-a647-435f-8e43-4ff4546431f6"
    }
  ],
  "paging": {
    "page_number": 2,
    "page_size": 50,
    "total_entries": 1000,
    "total_pages": 23
  }
}

Post-processing processes*

HTTP status codes

HTTP status code

Message

What caused the error

 200

 

 

Backward compatibility

This endpoint returns declaration requests that were created through V2 and V3. Field person_id will be empty for declaration request V2.

 

  • No labels