Purpose
This web service allows to initialize the contract request creation by generating links for the contract_request documents upload.
Overview
- Legal entity owner with 'contract_request:create' scope can initialize the contract request creation
- WS responds with contract_request id and links that should be used for documents upload
- After documents are uploaded, contract_request id from the response should be used for Create Contract Request WS
Specification
Validation
Validate token
- Verify the validity of access token
- Return 401 in case validation fails
- Check if token is not expired
- in case error return 401 - "Token is expired"
Validate user
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 legal_entity is active
- in case error return 403 - (Client is not active)
- Check user role is "OWNER"
- in case error return 403 "User is not allowed to perform this action"
Validate scopes
- Check user scopes in order to perform this action (scope = 'contract_request:create')
- Return 403 in case invalid scope(s) "Your scope does not allow to access this resource. Missing allowances: contract_request:create"
Generate links and contract request id
Response
set
field | value |
---|---|
$id | contract_request.id |
$statute_url | link to Storage for uploading contract_request_statute |
$additional_document_url | link to Storage for uploading contract_request_additional_document_url |