Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Purpose

This method searches and returns request for registration employee by id. This method uses scopes and context. 

...

  • The legal entity (Owner, HR) can see only employee_requests that were made by this legal entity.

  • NHS Admin can see all employee_requests

Specification

Page Properties

Link

 https://ehealthmisapi1.docs.apiary.io/#reference/public.-medical-service-provider-integration-layer/employee-requests/get-employee-request-by-id

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

Resource

 /api/employee_requests/{{id}}

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

Scope

 employee_request:read

Scope для доступу

Components

 Employee requests

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

Microservices

 API paragraph not found

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

Protocol type

 REST

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

Request type

 GET

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

Sync/Async

 Sync

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

Public/Private/Internal

 Public

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

Logic

API paragraph not found

...

Request data validation

Validate request

  1. Verify the validity of access token

    1. in case error return 401

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

    1. in case error return 403

Validate id

  1. Verify id - employee_request_id exists

    1. in case error return 404 (not found employee request in DB with this ID)

Validate context

  1. Get legal_entity.id from '$.context'. Filter employee requests by legal_entity.id

    1. in case error return 404

Response structure

See on Apiary

...

HTTP status code

Message

What caused the error

200

Response

 

401

Error

 Access token validation failed

403

Error

Check user scopes in order to perform this action failed

404

  1. Not found employee request in DB with this ID

  2. Error

2. Get legal_entity.id from '$.context'. Filter employee requests by legal_entity.id failed

...