ЕСОЗ - публічна документація
[DRAFT] Public. Get Contract Request Details [API-005-002-002-0049]
Сторінка знаходиться в процесі розробки. Інформація на ній може бути застарілою.
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 employee
- 9.5 Validate context
- 9.6 Validate data
- 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] Public. Get Contract Request Details [API-005-002-002-0049] |
Guideline ID | GUI-0011 |
Author | @ |
Document version | 1 |
Document status | DRAFT |
Date of creation | ХХ.ХХ.ХХХХ (дата фінальної версії документа – RC або PROD) |
Date of update | ХХ.ХХ.ХХХХ (дата зміни версії) |
Method API ID | API-005-002-002-0049 |
Microservices (namespace) | IL |
Component | Contracts |
Component ID | COM-005-002 |
Link на API-специфікацію | |
Resource | {{host}}/api/contract_requests/{{contract_type}}/{{id}} |
Scope | contract_request:read |
Protocol type | REST |
Request type | GET |
Sync/Async | Sync |
Public/Private | Public |
Purpose
Get full information of contract request by id
Logic
This method is designed to get full information of contract request by id
Configuration parameters
N/A
Dictionaries
CONTRACT_PAYMENT_METHOD
CONTRACT_TYPE
REIMBURSEMENT_CONTRACT_TYPE
ADDRESS_TYPE
COUNTRY
SETTLEMENT_TYPE
STREET_TYPE
PHONE_TYPE
SPECIALITY_TYPE
SPECIALITY_LEVEL
SPEC_QUALIFICATION_TYPE
Input parameters
Input parameter | Mandatory | Type | Description | Example | |
---|---|---|---|---|---|
1 | id |
| String | contract request identifier |
|
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 = 'contract_request:read')
Return 403 in case invalid scope(s)
Validate employee
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 nhs_legal_entity is active
in case error return 403 - (Client is not active)
Validate context
extract client_id from token. LE employee can see only this legal entities contract requests. NHS employee can see any contract request.
if TOKENS_TYPES_PERSONAL
Check client_id = contract_request.contractor_legal_entity_id
in case error return 403 "You are not allowed to view this contract request"
Validate data
Validate contract request id. Check contract_requests.id = $.id
in case error return 404 ("Contract request with id=$id doesn't exist")
Processing
N/A
Response structure examples
See on API-specification
This WS besides the meta and data objects responds with urgent object, that contains links to the documents. The content of urgent depends on contract request status:
Contract request status | List of documents links |
---|---|
|
|
|
|
HTTP status codes
Response code | HTTP Status code | Message | Internal name | Description | |
---|---|---|---|---|---|
1 | Базові | ||||
2 |
| 200 |
|
|
|
3 |
| 403 | Client is not active |
|
|
4 |
| 403 | user is not active |
|
|
5 |
| 403 | You are not allowed to view this contract request |
|
|
6 |
| 404 | Contract request with id=$id doesn't exist |
|
|
7 | Специфічні | ||||
8 |
|
|
|
|
|
Post-processing processes
N/A
Technical modules where the method is used
ЕСОЗ - публічна документація