ЕСОЗ - публічна документація
[DRAFT] Get legators Legal Entities [API-005-009-002-0186]
Сторінка знаходиться в процесі розробки. Інформація на ній може бути застарілою.
https://e-health-ua.atlassian.net/wiki/spaces/EN/pages/17591304241 (remove the link block before publishing the document)
- 1 Properties of a REST API method document
- 2 Purpose
- 3 Logic
- 4 Configuration parameters
- 5 Dictionaries
- 6 Input parameters
- 7 Request structure
- 8 Headers
- 9 Request data validation
- 9.1 Authorize
- 9.2 Validate token
- 9.3 Validate scopes
- 9.4 Validate client
- 9.5 Validate context
- 10 Processing
- 11 Response structure examples
- 12 HTTP status codes
- 13 Post-processing processes
- 14 Technical modules where the method is used
Properties of a REST API method document
Document type | Метод REST API |
---|---|
Document title | [DRAFT] Get legators Legal Entities [API-005-009-002-0186] |
Guideline ID | GUI-0011 |
Author | @ |
Document version | 1 |
Document status | DRAFT |
Date of creation | ХХ.ХХ.ХХХХ (дата фінальної версії документа – RC або PROD) |
Date of update | ХХ.ХХ.ХХХХ (дата зміни версії) |
Method API ID | API-005-009-002-0186 |
Microservices (namespace) | IL |
Component | Legal Entities |
Component ID | COM-005-009 |
Link на API-специфікацію | |
Resource | {{host}}/api/legal_entities/{{id}}/related |
Scope | related_legal_entities:read |
Protocol type | REST |
Request type | GET |
Sync/Async | Sync |
Public/Private | Public |
Purpose
Use this method to get the list of child legal entities which are related to current legal entity.
only employees with scope "related_legal_entities:read" can get a list of related legal entities
it's possible to see only children legal entities (GET /legal_entities/{{id}}/related{?page,page_size})
Logic
N/A
Configuration parameters
N/A
Dictionaries
N/A
Input parameters
Input parameter | Mandatory | Type | Description | Example | |
---|---|---|---|---|---|
1 | id |
| String | Required | d290f1ee-6c54-4b01-90e6-d701748f0851 |
2 |
|
|
|
|
|
Request structure
See on API-specification
Headers
Request data validation
Authorize
Request to process the request using a token in the headers
Validate token
Verify the validity of access token
Return 401 in case validation fails
token is not expired
in case error return 401
Validate scopes
Check user scopes in order to perform this action (scope = 'related_legal_entities:read')
Return 403 in case invalid scope(s) -"Your scope does not allow to access this resource. Missing allowances: related_legal_entities:read"
Validate client
Check $id =tokens.details.client_id
Return 403 in case of error -"User is not allowed to view"
Validate context
Return response to user limited by context from user's token
if TOKENS_TYPES_PERSONAL
return response limited by legal_entity/{{id}}=user.client_id
Processing
Find related legal entities as select merged_from_id from related_legal_entities where merged_to_id=$id. Enrich id with data from legal entities table and form response according to json scheme.
If no related_legal_entities found return 200 and empty array.
Response structure examples
See on API-specification
HTTP status codes
Response code | HTTP Status code | Message | Internal name | Description | |
---|---|---|---|---|---|
1 | Базові | ||||
2 |
| 200 | Response |
|
|
3 |
| 401 | Token validation failed |
|
|
4 |
| 403 | User is not allowed to view |
|
|
5 |
| 403 | Your scope does not allow to access this resource. Missing allowances: related_legal_entities:read |
|
|
6 | Специфічні | ||||
7 |
|
|
|
|
|
Post-processing processes
N/A
Technical modules where the method is used
ЕСОЗ - публічна документація