ЕСОЗ - публічна документація
Resend SMS on Approval
Purpose
It can be processed in both sync and async methods depends on Server decision.
Specification
Link | |
Resource | /api/patients/{{patiend_id}}/approvals/{{id}}/actions/resend |
Scope | approval:create |
Components | Approvals |
Microservices | API paragraph not found |
Protocol type | REST |
Request type | PATCH |
Sync/Async | Async |
Public/Private/Internal | Public |
Logic
It can be processed in both sync and async methods depends on Server decision.
Input parameters
Input parameter | Values | Type | Description | Example |
---|---|---|---|---|
patiend_id |
| String | mpi_id |
|
id |
| String | approval_id |
|
Authorize
Verify the validity of access token
Return 401 in case of validation fails
Check user scope approval:create in order to perform this action
Return 403 in case of invalid scope
Request to process the request using a token in the headers
Headers
Наприклад:
Content-Type:application/json
Authorization:Bearer d368a4b0-4a0e-457a-b267-32359fa6288f
Request data validation
Validate authentication method
Resend SMS on Approval is allowed for person_authentication_method which was specified on Create Approval in the authorize_with field.
Return 409 in case of validation fails (message "Resend SMS is not allowed for this authentication method")
Processing
Service Logic
Search for approval by patient_id + approval_id
Validate person by patient_id
In case error return 404 (message "Person not found")
Validate approval by approval.id
In case error return 404 (message "Approval with such id is not found")
Send SMS with OTP-code to persons phone from approvals.urgent.phone_number
Response structure
See on Apiary
Example:
HTTP status codes
HTTP status code | Message | What caused the error |
---|---|---|
201 | use payload from response | sync |
202 | use Get job details to get processing result. Response payload will be returned in the job details | async: default method |
ЕСОЗ - публічна документація