Purpose
This WS allows to get licenses list for legal entity. Used by legal entity employees to receive full information about primary and additional licenses of legal entity.
Key points
This REST method is used by MIS.
Only authenticated and authorized user with appropriate scope can get licenses list.
Specification
Authorization
Verify the validity of MIS client secret
in case of error - return 401 (“Invalid access token”)
Verify the validity of access token
in case of error - return 401 (“Invalid access token”) in case of validation fails
Verify that token is not expired
in case of error - return 401 (“Invalid access token”)
Check user scopes in order to perform this action (scope = 'license:read')
return 403 (“Your scope does not allow to access this resource. Missing allowances: license:read”) in case of invalid scope(s)
Search params
id
license_number
type
is_primary
Service logic
Extract client_id from token.
Filter active licenses:
for current legal entity from token (licenses.legal_entity_id=$.client_id).
by search params.
Render found licenses with all fields from DB.