ЕСОЗ - публічна документація
(GraphQL) Get Merge Request by ID
Purpose
This service is designed to obtain list of merge requests by NHS user.
Overview
only users with scope "merge_request:read" can get list of merge_request
Specification
Link |
| Посилання на Apiary або Swagger |
Resource |
| Посилання на ресурс, наприклад: /api/persons/create |
Scope |
| Scope для доступу |
Components |
| Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription |
Microservices |
| Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC |
Protocol type |
| Тип протоколу, який використовується запитом, наприклад: SOAP | REST |
Request type |
| Тип запиту API, наприклад: GET, POST, PATCH… |
Sync/Async |
| Метод є синхронним чи асинхронним? |
Public/Private/Internal |
| Потрібно зазначити тип методу за ступенем доступності |
GraphQL schema
Logic
API paragraph not found
Request structure
API paragraph not found
Authorize
API paragraph not found
Headers
API paragraph not found
Request data validation
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 = 'merge_request:read')
Return forbidden in case invalid scope(s) -"Your scope does not allow to access this resource. Missing allowances: merge_request:read"
Verify user and role
Extract from token:
Validate client_id (is_blocked=false)
in case of error return 403 Error ('Client is blocked')
Check user_roles by client_id
check whether exist role NHS_REVIEWER
in case of error return 403 Error ('User doesn't have required role')
Validate client_id is NHS
check client type is NHS
in case of error rerun forbidden error (Client is not allowed to the action')
Validate context
Return response to user limited by context from user's token
return limited response by manual_merge_requests.assignee_id=$user_id and manual_merge_requests.status in ('NEW', 'POSTPONE')
in case of error return forbidden ('You are not allowed to view this merge request)
Validate merge_request id. Check merge_requests.id = $.id
in case error return 404 ("Merge request with id=$id doesn't exist")
Processing
API paragraph not found
Response structure
API paragraph not found
Post-processing processes
API paragraph not found
HTTP status codes
API paragraph not found
ЕСОЗ - публічна документація