diff --git a/code/API_definitions/number_verification.yaml b/code/API_definitions/number_verification.yaml index 61d25e6..92664b6 100644 --- a/code/API_definitions/number_verification.yaml +++ b/code/API_definitions/number_verification.yaml @@ -168,6 +168,11 @@ components: openId: type: openIdConnect openIdConnectUrl: https://example.com/.well-known/openid-configuration + headers: + x-correlator: + description: Correlation id for the different services + schema: + type: string schemas: NumberVerificationRequestBody: type: object @@ -228,10 +233,8 @@ components: Generic400: description: Problem with the client request headers: - X-Correlator: - description: Correlation id for the different services - schema: - type: string + x-correlator: + $ref: "#/components/headers/x-correlator" content: application/json: schema: @@ -241,20 +244,27 @@ components: code: INVALID_ARGUMENT message: Client specified an invalid argument, request body or query param Generic401: - description: Authentication problem with the client request + description: Unauthorized headers: - X-Correlator: - description: Correlation id for the different services - schema: - type: string + x-correlator: + $ref: "#/components/headers/x-correlator" content: application/json: schema: $ref: '#/components/schemas/ErrorInfo' - example: - status: 401 - code: UNAUTHENTICATED - message: Request not authenticated due to missing, invalid, or expired credentials + examples: + GENERIC_401_UNAUTHENTICATED: + description: Request cannot be authenticated + value: + status: 401 + code: UNAUTHENTICATED + message: Request not authenticated due to missing, invalid, or expired credentials. + GENERIC_401_AUTHENTICATION_REQUIRED: + description: New authentication is needed, authentication is no longer valid + value: + status: 401 + code: AUTHENTICATION_REQUIRED + message: New authentication is required. PhoneNumberVerificationPermissionDenied403: description: | Client does not have sufficient permission. @@ -262,37 +272,34 @@ components: - Client authentication was not via mobile network. In order to check the authentication method, AMR parameter value in the 3-legged user's access token can be used and make sure that the authentication was not either by SMS+OTP nor username/password (`{"code": "NUMBER_VERIFICATION.USER_NOT_AUTHENTICATED_BY_MOBILE_NETWORK","message": "Client must authenticate via the mobile network to use this service"}`) - Phone number cannot be deducted from access token context.(`{"code": "NUMBER_VERIFICATION.INVALID_TOKEN_CONTEXT","message": "Phone number cannot be deducted from access token context"}`) headers: - X-Correlator: - description: Correlation id for the different services - schema: - type: string + x-correlator: + $ref: "#/components/headers/x-correlator" content: application/json: schema: $ref: '#/components/schemas/ErrorInfo' examples: - PermissionDenied: + GENERIC_403_PERMISSION_DENIED: + description: Permission denied. OAuth2 token access does not have the required scope or when the user fails operational security value: status: 403 code: PERMISSION_DENIED - message: Client does not have sufficient permissions to perform this action - UserNotAuthenticatedByMobileNetwork: + message: Client does not have sufficient permissions to perform this action. + GENERIC_403_USER_NOT_AUTHENTICATED_BY_MOBILE_NETWORK: value: status: 403 code: NUMBER_VERIFICATION.USER_NOT_AUTHENTICATED_BY_MOBILE_NETWORK message: Client must authenticate via the mobile network to use this service - InvalidTokenContext: + GENERIC_403_INVALID_TOKEN_CONTEXT: value: status: 403 - code: NUMBER_VERIFICATION.INVALID_TOKEN_CONTEXT + code: INVALID_TOKEN_CONTEXT message: Phone number cannot be deducted from access token context Generic500: description: Server error headers: - X-Correlator: - description: Correlation id for the different services - schema: - type: string + x-correlator: + $ref: "#/components/headers/x-correlator" content: application/json: schema: @@ -304,10 +311,8 @@ components: Generic503: description: Service unavailable. Typically the server is down. headers: - X-Correlator: - description: Correlation id for the different services - schema: - type: string + x-correlator: + $ref: "#/components/headers/x-correlator" content: application/json: schema: @@ -319,10 +324,8 @@ components: Generic504: description: Request time exceeded. If it happens repeatedly, consider reducing the request complexity headers: - X-Correlator: - description: Correlation id for the different services - schema: - type: string + x-correlator: + $ref: "#/components/headers/x-correlator" content: application/json: schema: