ЕСОЗ - публічна документація
Verify declaration
Purpose
This method is used by NHS_admin to verify declarations that have been created with offline authorization. Declaration status will be changed to active
Specification
Link | |
Resource | /api/declarations/{{id}}/actions/approve |
Scope | declaration:approve |
Components | Declarations |
Microservices | API paragraph not found |
Protocol type | REST |
Request type | PATCH |
Sync/Async | Sync |
Public/Private/Internal | Public |
Logic
API paragraph not found
Input parameters
Input parameter | Values | Type | Description | Example |
---|---|---|---|---|
id |
| String | Required | d290f1ee-6c54-4b01-90e6-d701748f0851 |
Request structure
API paragraph not found
Authorize
Verify the validity of access token
Check user scope declaration:approve in order to perform this action
In case error - return 401 error.
Headers
Content-Type:application/json
Authorization:Bearer c2778f3064753ea70de870a53795f5c9
Request data validation
Validate transition
Validate transitionю Allowed transitions:
pending_verification → active
pending_verification → closed
Check is_active = true
If not passed, Return Error 403 message "Invalid transition"
Processing
Update Declaration status
$declaration.status = active
$declaration.updated_by = user_id
$declaration.updated_at = timestamp
Response structure
Example:
Post-processing processes
API paragraph not found
HTTP status codes
HTTP status code | Message | What caused the error |
---|---|---|
200 | Response |
|
401 |
| 2. Invalid scope |
403 | Invalid transition |
|
Backward compatibility
API paragraph not found
ЕСОЗ - публічна документація