From 59f5cbbff035586c83b8889a8d07d8e35eac03bc Mon Sep 17 00:00:00 2001 From: DENGYONG18 <18910193721@189.cn> Date: Mon, 19 May 2025 11:12:49 +0800 Subject: [PATCH 1/8] Verified Caller API Proposal --- code/API_definitions/Verified Caller API.yaml | 394 ++++++++++++++++++ 1 file changed, 394 insertions(+) create mode 100644 code/API_definitions/Verified Caller API.yaml diff --git a/code/API_definitions/Verified Caller API.yaml b/code/API_definitions/Verified Caller API.yaml new file mode 100644 index 0000000..94490dd --- /dev/null +++ b/code/API_definitions/Verified Caller API.yaml @@ -0,0 +1,394 @@ +openapi: 3.0.3 +info: + title: Verified Caller + description: | + This API provides the API consumers with the ability to display their brand cards and improve the connection rate. + + # Introduction + + The Verified Caller API is used by the API consumer to display its brand card to the called user, which informs the called user who the caller is, thus reducing malicious calls. + + # Relevant Definitions and Concepts + + * **Verified Caller**: A service that verifies the identity of the caller. It informs the identity of the caller to the called user through the caller's brand card. + + * **Brand card template**: A template includes template code, template parameters and etc., which is to show brand name, logo, text content and etc. Template parameters are used to display the brand card content, and one template code corresponds to one template parameter. + + * **Strategy**: A brand card presentation strategy, including TTL, location and etc. + + + # API Functionality + + This API allows accurate operator certified "brand card" information such as SMS to be displayed on the phone screen of the called user before answering the call. + + # Authorization and authentication + + In cases where personal data is processed by the API and users can exercise their rights through mechanisms such as opt-in and/or opt-out, the use of three-legged access tokens is mandatory. This ensures that the API remains in compliance with privacy regulations, upholding the principles of transparency and user-centric privacy-by-design. + + ## Further info and support + + (FAQs will be added in a later version of the documentation) + + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + version: wip +externalDocs: + description: Official website of caller ID. + url: https://www.118114.net/qt2//#/intro + +servers: + - url: '{apiRoot}/verified-caller/v1.0.0' + variables: + apiRoot: + default: http://localhost:8081 + description: API root + +tags: + - name: Verified Caller + description: Operations to display caller's brand card to the called user +paths: + /verified-caller: + post: + tags: + - Verified Caller + summary: "Request to send brand card information such as SMS" + description: Request to send brand card information such as SMS + operationId: SMSSendRequest + parameters: + - $ref: '#/components/parameters/x-correlator' + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SMSSendRequest" + required: true + responses: + "200": + description: (OK) status code indicates that the request result successfully. + headers: + x-correlator: + $ref: '#/components/headers/x-correlator' + content: + application/json: + schema: + $ref: "#/components/schemas/SMSSendResponse" + examples: + SMSSendResponse: + value: + code: 200 + msg: "consumer name: Tom" + + "204": + $ref: "#/components/responses/Generic204" + "400": + $ref: "#/components/responses/Generic400" + "401": + $ref: "#/components/responses/Generic401" + "403": + $ref: "#/components/responses/Generic403" + "404": + $ref: "#/components/responses/Generic404" + "422": + $ref: "#/components/responses/Generic422" + "429": + $ref: "#/components/responses/Generic429" + +components: + securitySchemes: + openId: + type: openIdConnect + openIdConnectUrl: https://example.com/.well-known/openid-configuration + parameters: + x-correlator: + name: x-correlator + in: header + description: Correlation id for the different services + schema: + type: string + pattern: ^[a-zA-Z0-9-]{0,55}$ + example: "b4333c46-49c0-4f62-80d7-f0ef930f1c46" + headers: + x-correlator: + description: Correlation id for the different services + schema: + type: string + pattern: ^[a-zA-Z0-9-]{0,55}$ + example: "b4333c46-49c0-4f62-80d7-f0ef930f1c46" + schemas: + SMSSendRequest: + title: SMSSendRequest + type: object + properties: + brand name: + type: string + description: Consumer account + example: 'XX Hospital' + A-number: + type: string + description: Calling Number + example: '+123456789' + templateCode: + type: string + description: Template code + example: 'tmplatcode11001' + strategy: + type: string + description: Indicating API service providers to send the brand card under certain specific circumstances such as TTL, location and etc. + + + description: request parmeters + + SMSSendResponse: + title: SMSSendResponse + type: object + properties: + code: + type: integer + description: response code, where 200 indicates success, and any other codes indicate failure + msg: + type: string + description: response code detail description + example: 'No_Content' + description: response parmeters + + PhoneNumber: + description: A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, prefixed with '+'. + type: string + pattern: '^\+[1-9][0-9]{4,14}$' + example: "+123456789" + + Port: + description: TCP or UDP port number + type: integer + minimum: 0 + maximum: 65535 + + + ErrorInfo: + description: The error object used for error-cases. + type: object + required: + - status + - code + properties: + code: + type: integer + description: HTTP response status code + status: + type: string + description: Code given to this error + + + responses: + Generic204: + description: Status code indicates that the request result failure. + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 204 + status: + enum: + - No_Contect + + examples: + GENERIC_400_INVALID_ARGUMENT: + description: Invalid request. + value: + status: No_Contect + code: 204 + Generic400: + description: Bad Request + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 400 + status: + enum: + - INVALID_ARGUMENT + - OUT_OF_RANGE + examples: + GENERIC_400_INVALID_ARGUMENT: + description: Invalid Argument. Generic Syntax Exception + value: + status: INVALID_ARGUMENT + code: 400 + message: Client specified an invalid argument, request body or query param. + GENERIC_400_OUT_OF_RANGE: + description: Out of Range. Specific Syntax Exception used when a given field has a pre-defined range or a invalid filter criteria combination is requested + value: + status: OUT_OF_RANGE + code: 400 + message: Client specified an invalid range. + Generic401: + description: Unauthorized + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 401 + status: + enum: + - UNAUTHENTICATED + - AUTHENTICATION_REQUIRED + examples: + GENERIC_401_UNAUTHENTICATED: + description: Request cannot be authenticated + value: + status: UNAUTHENTICATED + code: 401 + 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: AUTHENTICATION_REQUIRED + code: 401 + message: New authentication is required. + Generic403: + description: Forbidden + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 403 + status: + enum: + - PERMISSION_DENIED + examples: + 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: PERMISSION_DENIED + code: 403 + message: Client does not have sufficient permissions to perform this action. + Generic404: + description: Not found + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 404 + status: + enum: + - NOT_FOUND + - IDENTIFIER_NOT_FOUND + examples: + GENERIC_404_NOT_FOUND: + description: Resource is not found + value: + status: NOT_FOUND + code: 404 + message: The specified resource is not found. + Generic422: + description: Unprocessable Content + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 422 + status: + enum: + - SERVICE_NOT_APPLICABLE + - MISSING_IDENTIFIER + - UNNECESSARY_IDENTIFIER + examples: + GENERIC_422_SERVICE_NOT_APPLICABLE: + description: Service not applicable for the provided identifier + value: + status: SERVICE_NOT_APPLICABLE + code: 422 + message: The service is not available for the provided identifier. + GENERIC_422_MISSING_IDENTIFIER: + description: phone number is not included in the request (in case of 2-legged) or the phone number identification cannot be derived from access token (in 3-legged) + value: + status: MISSING_IDENTIFIER + code: 422 + message: The device cannot be identified. + GENERIC_422_UNNECESSARY_IDENTIFIER: + description: An explicit identifier is provided when a device or phone number has already been identified from the access token + value: + status: UNNECESSARY_IDENTIFIER + code: 422 + message: The device is already identified by the access token. + Generic429: + description: Too Many Requests + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 429 + status: + enum: + - QUOTA_EXCEEDED + - TOO_MANY_REQUESTS + examples: + GENERIC_429_QUOTA_EXCEEDED: + description: Request is rejected due to exceeding a business quota limit + value: + status: QUOTA_EXCEEDED + code: 429 + message: Rejected due to exceeding a business quota limit. + GENERIC_429_TOO_MANY_REQUESTS: + description: API Server request limit is overpassed + value: + status: TOO_MANY_REQUESTS + code: 429 + message: Rejected due to request rate limit overpassed. From 9ce79289a1d4ca070efc2635f47af784144f130a Mon Sep 17 00:00:00 2001 From: DENGYONG18 <18910193721@189.cn> Date: Wed, 21 May 2025 14:44:28 +0800 Subject: [PATCH 2/8] Update the Verified Caller API yaml --- code/Verified Caller API_Updated.yaml | 399 ++++++++++++++++++++++++++ 1 file changed, 399 insertions(+) create mode 100644 code/Verified Caller API_Updated.yaml diff --git a/code/Verified Caller API_Updated.yaml b/code/Verified Caller API_Updated.yaml new file mode 100644 index 0000000..053b83b --- /dev/null +++ b/code/Verified Caller API_Updated.yaml @@ -0,0 +1,399 @@ +openapi: 3.0.3 +info: + title: Verified Caller + description: | + This API provides the API consumers with the ability to display their brand cards and improve the connection rate. + + # Introduction + + The Verified Caller API is used by the API consumer to display its brand card to the called user, which informs the called user who the caller is, thus reducing malicious calls. + + # Relevant Definitions and Concepts + + * **Verified Caller**: A service that verifies the identity of the caller. It informs the identity of the caller to the called user through the caller's brand card. + + * **Brand card template**: A template includes template code, template parameters and etc., which is to show brand name, logo, text content and etc. Template parameters are used to display the brand card content, and one template code corresponds to one template parameter. + + * **Strategy**: A brand card presentation strategy, including TTL, location and etc. + + + # API Functionality + + This API allows accurate operator certified "brand card" information such as SMS to be displayed on the phone screen of the called user before answering the call. + + # Authorization and authentication + + In cases where personal data is processed by the API and users can exercise their rights through mechanisms such as opt-in and/or opt-out, the use of three-legged access tokens is mandatory. This ensures that the API remains in compliance with privacy regulations, upholding the principles of transparency and user-centric privacy-by-design. + + ## Further info and support + + (FAQs will be added in a later version of the documentation) + + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + version: wip +externalDocs: + description: Official website of caller ID. + url: https://www.118114.net/qt2//#/intro + +servers: + - url: '{apiRoot}/verified-caller/v1.0.0' + variables: + apiRoot: + default: http://localhost:8081 + description: API root + +tags: + - name: Verified Caller + description: Operations to display caller's brand card to the called user +paths: + /smssend: + post: + tags: + - smssend + summary: "Request to send brand card information such as SMS" + description: Request to send brand card information such as SMS + operationId: SMSSendRequest + parameters: + - $ref: '#/components/parameters/x-correlator' + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SMSSendRequest" + required: true + responses: + "200": + description: (OK) status code indicates that the request result successfully. + headers: + x-correlator: + $ref: '#/components/headers/x-correlator' + content: + application/json: + schema: + $ref: "#/components/schemas/SMSSendResponse" + examples: + SMSSendResponse: + value: + code: 200 + msg: "consumer name: Tom" + + "204": + $ref: "#/components/responses/Generic204" + "400": + $ref: "#/components/responses/Generic400" + "401": + $ref: "#/components/responses/Generic401" + "403": + $ref: "#/components/responses/Generic403" + "404": + $ref: "#/components/responses/Generic404" + "422": + $ref: "#/components/responses/Generic422" + "429": + $ref: "#/components/responses/Generic429" + +components: + securitySchemes: + openId: + type: openIdConnect + openIdConnectUrl: https://example.com/.well-known/openid-configuration + parameters: + x-correlator: + name: x-correlator + in: header + description: Correlation id for the different services + schema: + type: string + pattern: ^[a-zA-Z0-9-]{0,55}$ + example: "b4333c46-49c0-4f62-80d7-f0ef930f1c46" + headers: + x-correlator: + description: Correlation id for the different services + schema: + type: string + pattern: ^[a-zA-Z0-9-]{0,55}$ + example: "b4333c46-49c0-4f62-80d7-f0ef930f1c46" + schemas: + SMSSendRequest: + title: SMSSendRequest + type: object + properties: + brand name: + type: string + description: Consumer account + example: 'XX Hospital' + client ID: + type: string + description: Consumer authentication identifier + example: 'string' + A-number: + type: string + description: Calling Phone Number + example: '+123456789' + B-number: + type: string + description: Called Phone Number + example: '+123456789' + templateCode: + type: string + description: Template code + example: 'tmplatcode11001' + strategy: + type: string + description: Indicating API service providers to send the brand card under certain specific circumstances such as TTL, location and etc. Different strategies can be used for different called phone numbers. + description: request parameters + + SMSSendResponse: + title: SMSSendResponse + type: object + properties: + code: + type: integer + description: response code, where 200 indicates success, and any other codes indicate failure + msg: + type: string + description: response code detail description + example: 'No_Content' + description: response parameters + + PhoneNumber: + description: A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, prefixed with '+'. + type: string + pattern: '^\+[1-9][0-9]{4,14}$' + example: "+123456789" + + Port: + description: TCP or UDP port number + type: integer + minimum: 0 + maximum: 65535 + + ErrorInfo: + description: The error object used for error-cases. + type: object + required: + - status + - code + properties: + code: + type: integer + description: HTTP response status code + status: + type: string + description: Code given to this error + + + responses: + Generic204: + description: Status code indicates that the request result failure. + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 204 + status: + enum: + - No_Contect + + examples: + GENERIC_400_INVALID_ARGUMENT: + description: Invalid request. + value: + status: No_Contect + code: 204 + Generic400: + description: Bad Request + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 400 + status: + enum: + - INVALID_ARGUMENT + - OUT_OF_RANGE + examples: + GENERIC_400_INVALID_ARGUMENT: + description: Invalid Argument. Generic Syntax Exception + value: + status: INVALID_ARGUMENT + code: 400 + message: Client specified an invalid argument, request body or query param. + GENERIC_400_OUT_OF_RANGE: + description: Out of Range. Specific Syntax Exception used when a given field has a pre-defined range or a invalid filter criteria combination is requested + value: + status: OUT_OF_RANGE + code: 400 + message: Client specified an invalid range. + Generic401: + description: Unauthorized + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 401 + status: + enum: + - UNAUTHENTICATED + - AUTHENTICATION_REQUIRED + examples: + GENERIC_401_UNAUTHENTICATED: + description: Request cannot be authenticated + value: + status: UNAUTHENTICATED + code: 401 + 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: AUTHENTICATION_REQUIRED + code: 401 + message: New authentication is required. + Generic403: + description: Forbidden + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 403 + status: + enum: + - PERMISSION_DENIED + examples: + 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: PERMISSION_DENIED + code: 403 + message: Client does not have sufficient permissions to perform this action. + Generic404: + description: Not found + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 404 + status: + enum: + - NOT_FOUND + - IDENTIFIER_NOT_FOUND + examples: + GENERIC_404_NOT_FOUND: + description: Resource is not found + value: + status: NOT_FOUND + code: 404 + message: The specified resource is not found. + Generic422: + description: Unprocessable Content + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 422 + status: + enum: + - SERVICE_NOT_APPLICABLE + - MISSING_IDENTIFIER + - UNNECESSARY_IDENTIFIER + examples: + GENERIC_422_SERVICE_NOT_APPLICABLE: + description: Service not applicable for the provided identifier + value: + status: SERVICE_NOT_APPLICABLE + code: 422 + message: The service is not available for the provided identifier. + GENERIC_422_MISSING_IDENTIFIER: + description: phone number is not included in the request (in case of 2-legged) or the phone number identification cannot be derived from access token (in 3-legged) + value: + status: MISSING_IDENTIFIER + code: 422 + message: The device cannot be identified. + GENERIC_422_UNNECESSARY_IDENTIFIER: + description: An explicit identifier is provided when a device or phone number has already been identified from the access token + value: + status: UNNECESSARY_IDENTIFIER + code: 422 + message: The device is already identified by the access token. + Generic429: + description: Too Many Requests + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 429 + status: + enum: + - QUOTA_EXCEEDED + - TOO_MANY_REQUESTS + examples: + GENERIC_429_QUOTA_EXCEEDED: + description: Request is rejected due to exceeding a business quota limit + value: + status: QUOTA_EXCEEDED + code: 429 + message: Rejected due to exceeding a business quota limit. + GENERIC_429_TOO_MANY_REQUESTS: + description: API Server request limit is overpassed + value: + status: TOO_MANY_REQUESTS + code: 429 + message: Rejected due to request rate limit overpassed. From c52e9d8d42b960946df86db2077b10fc073bbfa5 Mon Sep 17 00:00:00 2001 From: DENGYONG18 <18910193721@189.cn> Date: Wed, 21 May 2025 14:45:36 +0800 Subject: [PATCH 3/8] Update the Verified Caller API yaml --- .../Verified Caller API_Updated.yaml | 399 ++++++++++++++++++ 1 file changed, 399 insertions(+) create mode 100644 code/API_definitions/Verified Caller API_Updated.yaml diff --git a/code/API_definitions/Verified Caller API_Updated.yaml b/code/API_definitions/Verified Caller API_Updated.yaml new file mode 100644 index 0000000..053b83b --- /dev/null +++ b/code/API_definitions/Verified Caller API_Updated.yaml @@ -0,0 +1,399 @@ +openapi: 3.0.3 +info: + title: Verified Caller + description: | + This API provides the API consumers with the ability to display their brand cards and improve the connection rate. + + # Introduction + + The Verified Caller API is used by the API consumer to display its brand card to the called user, which informs the called user who the caller is, thus reducing malicious calls. + + # Relevant Definitions and Concepts + + * **Verified Caller**: A service that verifies the identity of the caller. It informs the identity of the caller to the called user through the caller's brand card. + + * **Brand card template**: A template includes template code, template parameters and etc., which is to show brand name, logo, text content and etc. Template parameters are used to display the brand card content, and one template code corresponds to one template parameter. + + * **Strategy**: A brand card presentation strategy, including TTL, location and etc. + + + # API Functionality + + This API allows accurate operator certified "brand card" information such as SMS to be displayed on the phone screen of the called user before answering the call. + + # Authorization and authentication + + In cases where personal data is processed by the API and users can exercise their rights through mechanisms such as opt-in and/or opt-out, the use of three-legged access tokens is mandatory. This ensures that the API remains in compliance with privacy regulations, upholding the principles of transparency and user-centric privacy-by-design. + + ## Further info and support + + (FAQs will be added in a later version of the documentation) + + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + version: wip +externalDocs: + description: Official website of caller ID. + url: https://www.118114.net/qt2//#/intro + +servers: + - url: '{apiRoot}/verified-caller/v1.0.0' + variables: + apiRoot: + default: http://localhost:8081 + description: API root + +tags: + - name: Verified Caller + description: Operations to display caller's brand card to the called user +paths: + /smssend: + post: + tags: + - smssend + summary: "Request to send brand card information such as SMS" + description: Request to send brand card information such as SMS + operationId: SMSSendRequest + parameters: + - $ref: '#/components/parameters/x-correlator' + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SMSSendRequest" + required: true + responses: + "200": + description: (OK) status code indicates that the request result successfully. + headers: + x-correlator: + $ref: '#/components/headers/x-correlator' + content: + application/json: + schema: + $ref: "#/components/schemas/SMSSendResponse" + examples: + SMSSendResponse: + value: + code: 200 + msg: "consumer name: Tom" + + "204": + $ref: "#/components/responses/Generic204" + "400": + $ref: "#/components/responses/Generic400" + "401": + $ref: "#/components/responses/Generic401" + "403": + $ref: "#/components/responses/Generic403" + "404": + $ref: "#/components/responses/Generic404" + "422": + $ref: "#/components/responses/Generic422" + "429": + $ref: "#/components/responses/Generic429" + +components: + securitySchemes: + openId: + type: openIdConnect + openIdConnectUrl: https://example.com/.well-known/openid-configuration + parameters: + x-correlator: + name: x-correlator + in: header + description: Correlation id for the different services + schema: + type: string + pattern: ^[a-zA-Z0-9-]{0,55}$ + example: "b4333c46-49c0-4f62-80d7-f0ef930f1c46" + headers: + x-correlator: + description: Correlation id for the different services + schema: + type: string + pattern: ^[a-zA-Z0-9-]{0,55}$ + example: "b4333c46-49c0-4f62-80d7-f0ef930f1c46" + schemas: + SMSSendRequest: + title: SMSSendRequest + type: object + properties: + brand name: + type: string + description: Consumer account + example: 'XX Hospital' + client ID: + type: string + description: Consumer authentication identifier + example: 'string' + A-number: + type: string + description: Calling Phone Number + example: '+123456789' + B-number: + type: string + description: Called Phone Number + example: '+123456789' + templateCode: + type: string + description: Template code + example: 'tmplatcode11001' + strategy: + type: string + description: Indicating API service providers to send the brand card under certain specific circumstances such as TTL, location and etc. Different strategies can be used for different called phone numbers. + description: request parameters + + SMSSendResponse: + title: SMSSendResponse + type: object + properties: + code: + type: integer + description: response code, where 200 indicates success, and any other codes indicate failure + msg: + type: string + description: response code detail description + example: 'No_Content' + description: response parameters + + PhoneNumber: + description: A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, prefixed with '+'. + type: string + pattern: '^\+[1-9][0-9]{4,14}$' + example: "+123456789" + + Port: + description: TCP or UDP port number + type: integer + minimum: 0 + maximum: 65535 + + ErrorInfo: + description: The error object used for error-cases. + type: object + required: + - status + - code + properties: + code: + type: integer + description: HTTP response status code + status: + type: string + description: Code given to this error + + + responses: + Generic204: + description: Status code indicates that the request result failure. + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 204 + status: + enum: + - No_Contect + + examples: + GENERIC_400_INVALID_ARGUMENT: + description: Invalid request. + value: + status: No_Contect + code: 204 + Generic400: + description: Bad Request + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 400 + status: + enum: + - INVALID_ARGUMENT + - OUT_OF_RANGE + examples: + GENERIC_400_INVALID_ARGUMENT: + description: Invalid Argument. Generic Syntax Exception + value: + status: INVALID_ARGUMENT + code: 400 + message: Client specified an invalid argument, request body or query param. + GENERIC_400_OUT_OF_RANGE: + description: Out of Range. Specific Syntax Exception used when a given field has a pre-defined range or a invalid filter criteria combination is requested + value: + status: OUT_OF_RANGE + code: 400 + message: Client specified an invalid range. + Generic401: + description: Unauthorized + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 401 + status: + enum: + - UNAUTHENTICATED + - AUTHENTICATION_REQUIRED + examples: + GENERIC_401_UNAUTHENTICATED: + description: Request cannot be authenticated + value: + status: UNAUTHENTICATED + code: 401 + 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: AUTHENTICATION_REQUIRED + code: 401 + message: New authentication is required. + Generic403: + description: Forbidden + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 403 + status: + enum: + - PERMISSION_DENIED + examples: + 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: PERMISSION_DENIED + code: 403 + message: Client does not have sufficient permissions to perform this action. + Generic404: + description: Not found + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 404 + status: + enum: + - NOT_FOUND + - IDENTIFIER_NOT_FOUND + examples: + GENERIC_404_NOT_FOUND: + description: Resource is not found + value: + status: NOT_FOUND + code: 404 + message: The specified resource is not found. + Generic422: + description: Unprocessable Content + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 422 + status: + enum: + - SERVICE_NOT_APPLICABLE + - MISSING_IDENTIFIER + - UNNECESSARY_IDENTIFIER + examples: + GENERIC_422_SERVICE_NOT_APPLICABLE: + description: Service not applicable for the provided identifier + value: + status: SERVICE_NOT_APPLICABLE + code: 422 + message: The service is not available for the provided identifier. + GENERIC_422_MISSING_IDENTIFIER: + description: phone number is not included in the request (in case of 2-legged) or the phone number identification cannot be derived from access token (in 3-legged) + value: + status: MISSING_IDENTIFIER + code: 422 + message: The device cannot be identified. + GENERIC_422_UNNECESSARY_IDENTIFIER: + description: An explicit identifier is provided when a device or phone number has already been identified from the access token + value: + status: UNNECESSARY_IDENTIFIER + code: 422 + message: The device is already identified by the access token. + Generic429: + description: Too Many Requests + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 429 + status: + enum: + - QUOTA_EXCEEDED + - TOO_MANY_REQUESTS + examples: + GENERIC_429_QUOTA_EXCEEDED: + description: Request is rejected due to exceeding a business quota limit + value: + status: QUOTA_EXCEEDED + code: 429 + message: Rejected due to exceeding a business quota limit. + GENERIC_429_TOO_MANY_REQUESTS: + description: API Server request limit is overpassed + value: + status: TOO_MANY_REQUESTS + code: 429 + message: Rejected due to request rate limit overpassed. From 37516ff2a76d4caba4bdbed106ff9b0d5c9061e4 Mon Sep 17 00:00:00 2001 From: DENGYONG18 <18910193721@189.cn> Date: Wed, 21 May 2025 17:39:42 +0800 Subject: [PATCH 4/8] Delete code/Verified Caller API_Updated.yaml --- code/Verified Caller API_Updated.yaml | 399 -------------------------- 1 file changed, 399 deletions(-) delete mode 100644 code/Verified Caller API_Updated.yaml diff --git a/code/Verified Caller API_Updated.yaml b/code/Verified Caller API_Updated.yaml deleted file mode 100644 index 053b83b..0000000 --- a/code/Verified Caller API_Updated.yaml +++ /dev/null @@ -1,399 +0,0 @@ -openapi: 3.0.3 -info: - title: Verified Caller - description: | - This API provides the API consumers with the ability to display their brand cards and improve the connection rate. - - # Introduction - - The Verified Caller API is used by the API consumer to display its brand card to the called user, which informs the called user who the caller is, thus reducing malicious calls. - - # Relevant Definitions and Concepts - - * **Verified Caller**: A service that verifies the identity of the caller. It informs the identity of the caller to the called user through the caller's brand card. - - * **Brand card template**: A template includes template code, template parameters and etc., which is to show brand name, logo, text content and etc. Template parameters are used to display the brand card content, and one template code corresponds to one template parameter. - - * **Strategy**: A brand card presentation strategy, including TTL, location and etc. - - - # API Functionality - - This API allows accurate operator certified "brand card" information such as SMS to be displayed on the phone screen of the called user before answering the call. - - # Authorization and authentication - - In cases where personal data is processed by the API and users can exercise their rights through mechanisms such as opt-in and/or opt-out, the use of three-legged access tokens is mandatory. This ensures that the API remains in compliance with privacy regulations, upholding the principles of transparency and user-centric privacy-by-design. - - ## Further info and support - - (FAQs will be added in a later version of the documentation) - - license: - name: Apache 2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html - version: wip -externalDocs: - description: Official website of caller ID. - url: https://www.118114.net/qt2//#/intro - -servers: - - url: '{apiRoot}/verified-caller/v1.0.0' - variables: - apiRoot: - default: http://localhost:8081 - description: API root - -tags: - - name: Verified Caller - description: Operations to display caller's brand card to the called user -paths: - /smssend: - post: - tags: - - smssend - summary: "Request to send brand card information such as SMS" - description: Request to send brand card information such as SMS - operationId: SMSSendRequest - parameters: - - $ref: '#/components/parameters/x-correlator' - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/SMSSendRequest" - required: true - responses: - "200": - description: (OK) status code indicates that the request result successfully. - headers: - x-correlator: - $ref: '#/components/headers/x-correlator' - content: - application/json: - schema: - $ref: "#/components/schemas/SMSSendResponse" - examples: - SMSSendResponse: - value: - code: 200 - msg: "consumer name: Tom" - - "204": - $ref: "#/components/responses/Generic204" - "400": - $ref: "#/components/responses/Generic400" - "401": - $ref: "#/components/responses/Generic401" - "403": - $ref: "#/components/responses/Generic403" - "404": - $ref: "#/components/responses/Generic404" - "422": - $ref: "#/components/responses/Generic422" - "429": - $ref: "#/components/responses/Generic429" - -components: - securitySchemes: - openId: - type: openIdConnect - openIdConnectUrl: https://example.com/.well-known/openid-configuration - parameters: - x-correlator: - name: x-correlator - in: header - description: Correlation id for the different services - schema: - type: string - pattern: ^[a-zA-Z0-9-]{0,55}$ - example: "b4333c46-49c0-4f62-80d7-f0ef930f1c46" - headers: - x-correlator: - description: Correlation id for the different services - schema: - type: string - pattern: ^[a-zA-Z0-9-]{0,55}$ - example: "b4333c46-49c0-4f62-80d7-f0ef930f1c46" - schemas: - SMSSendRequest: - title: SMSSendRequest - type: object - properties: - brand name: - type: string - description: Consumer account - example: 'XX Hospital' - client ID: - type: string - description: Consumer authentication identifier - example: 'string' - A-number: - type: string - description: Calling Phone Number - example: '+123456789' - B-number: - type: string - description: Called Phone Number - example: '+123456789' - templateCode: - type: string - description: Template code - example: 'tmplatcode11001' - strategy: - type: string - description: Indicating API service providers to send the brand card under certain specific circumstances such as TTL, location and etc. Different strategies can be used for different called phone numbers. - description: request parameters - - SMSSendResponse: - title: SMSSendResponse - type: object - properties: - code: - type: integer - description: response code, where 200 indicates success, and any other codes indicate failure - msg: - type: string - description: response code detail description - example: 'No_Content' - description: response parameters - - PhoneNumber: - description: A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, prefixed with '+'. - type: string - pattern: '^\+[1-9][0-9]{4,14}$' - example: "+123456789" - - Port: - description: TCP or UDP port number - type: integer - minimum: 0 - maximum: 65535 - - ErrorInfo: - description: The error object used for error-cases. - type: object - required: - - status - - code - properties: - code: - type: integer - description: HTTP response status code - status: - type: string - description: Code given to this error - - - responses: - Generic204: - description: Status code indicates that the request result failure. - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 204 - status: - enum: - - No_Contect - - examples: - GENERIC_400_INVALID_ARGUMENT: - description: Invalid request. - value: - status: No_Contect - code: 204 - Generic400: - description: Bad Request - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 400 - status: - enum: - - INVALID_ARGUMENT - - OUT_OF_RANGE - examples: - GENERIC_400_INVALID_ARGUMENT: - description: Invalid Argument. Generic Syntax Exception - value: - status: INVALID_ARGUMENT - code: 400 - message: Client specified an invalid argument, request body or query param. - GENERIC_400_OUT_OF_RANGE: - description: Out of Range. Specific Syntax Exception used when a given field has a pre-defined range or a invalid filter criteria combination is requested - value: - status: OUT_OF_RANGE - code: 400 - message: Client specified an invalid range. - Generic401: - description: Unauthorized - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 401 - status: - enum: - - UNAUTHENTICATED - - AUTHENTICATION_REQUIRED - examples: - GENERIC_401_UNAUTHENTICATED: - description: Request cannot be authenticated - value: - status: UNAUTHENTICATED - code: 401 - 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: AUTHENTICATION_REQUIRED - code: 401 - message: New authentication is required. - Generic403: - description: Forbidden - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 403 - status: - enum: - - PERMISSION_DENIED - examples: - 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: PERMISSION_DENIED - code: 403 - message: Client does not have sufficient permissions to perform this action. - Generic404: - description: Not found - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 404 - status: - enum: - - NOT_FOUND - - IDENTIFIER_NOT_FOUND - examples: - GENERIC_404_NOT_FOUND: - description: Resource is not found - value: - status: NOT_FOUND - code: 404 - message: The specified resource is not found. - Generic422: - description: Unprocessable Content - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 422 - status: - enum: - - SERVICE_NOT_APPLICABLE - - MISSING_IDENTIFIER - - UNNECESSARY_IDENTIFIER - examples: - GENERIC_422_SERVICE_NOT_APPLICABLE: - description: Service not applicable for the provided identifier - value: - status: SERVICE_NOT_APPLICABLE - code: 422 - message: The service is not available for the provided identifier. - GENERIC_422_MISSING_IDENTIFIER: - description: phone number is not included in the request (in case of 2-legged) or the phone number identification cannot be derived from access token (in 3-legged) - value: - status: MISSING_IDENTIFIER - code: 422 - message: The device cannot be identified. - GENERIC_422_UNNECESSARY_IDENTIFIER: - description: An explicit identifier is provided when a device or phone number has already been identified from the access token - value: - status: UNNECESSARY_IDENTIFIER - code: 422 - message: The device is already identified by the access token. - Generic429: - description: Too Many Requests - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 429 - status: - enum: - - QUOTA_EXCEEDED - - TOO_MANY_REQUESTS - examples: - GENERIC_429_QUOTA_EXCEEDED: - description: Request is rejected due to exceeding a business quota limit - value: - status: QUOTA_EXCEEDED - code: 429 - message: Rejected due to exceeding a business quota limit. - GENERIC_429_TOO_MANY_REQUESTS: - description: API Server request limit is overpassed - value: - status: TOO_MANY_REQUESTS - code: 429 - message: Rejected due to request rate limit overpassed. From 2b062dcb0c574d61c947653bb13509fbd914a562 Mon Sep 17 00:00:00 2001 From: DENGYONG18 <18910193721@189.cn> Date: Wed, 21 May 2025 17:42:33 +0800 Subject: [PATCH 5/8] Delete code/API_definitions/Verified Caller API.yaml --- code/API_definitions/Verified Caller API.yaml | 394 ------------------ 1 file changed, 394 deletions(-) delete mode 100644 code/API_definitions/Verified Caller API.yaml diff --git a/code/API_definitions/Verified Caller API.yaml b/code/API_definitions/Verified Caller API.yaml deleted file mode 100644 index 94490dd..0000000 --- a/code/API_definitions/Verified Caller API.yaml +++ /dev/null @@ -1,394 +0,0 @@ -openapi: 3.0.3 -info: - title: Verified Caller - description: | - This API provides the API consumers with the ability to display their brand cards and improve the connection rate. - - # Introduction - - The Verified Caller API is used by the API consumer to display its brand card to the called user, which informs the called user who the caller is, thus reducing malicious calls. - - # Relevant Definitions and Concepts - - * **Verified Caller**: A service that verifies the identity of the caller. It informs the identity of the caller to the called user through the caller's brand card. - - * **Brand card template**: A template includes template code, template parameters and etc., which is to show brand name, logo, text content and etc. Template parameters are used to display the brand card content, and one template code corresponds to one template parameter. - - * **Strategy**: A brand card presentation strategy, including TTL, location and etc. - - - # API Functionality - - This API allows accurate operator certified "brand card" information such as SMS to be displayed on the phone screen of the called user before answering the call. - - # Authorization and authentication - - In cases where personal data is processed by the API and users can exercise their rights through mechanisms such as opt-in and/or opt-out, the use of three-legged access tokens is mandatory. This ensures that the API remains in compliance with privacy regulations, upholding the principles of transparency and user-centric privacy-by-design. - - ## Further info and support - - (FAQs will be added in a later version of the documentation) - - license: - name: Apache 2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html - version: wip -externalDocs: - description: Official website of caller ID. - url: https://www.118114.net/qt2//#/intro - -servers: - - url: '{apiRoot}/verified-caller/v1.0.0' - variables: - apiRoot: - default: http://localhost:8081 - description: API root - -tags: - - name: Verified Caller - description: Operations to display caller's brand card to the called user -paths: - /verified-caller: - post: - tags: - - Verified Caller - summary: "Request to send brand card information such as SMS" - description: Request to send brand card information such as SMS - operationId: SMSSendRequest - parameters: - - $ref: '#/components/parameters/x-correlator' - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/SMSSendRequest" - required: true - responses: - "200": - description: (OK) status code indicates that the request result successfully. - headers: - x-correlator: - $ref: '#/components/headers/x-correlator' - content: - application/json: - schema: - $ref: "#/components/schemas/SMSSendResponse" - examples: - SMSSendResponse: - value: - code: 200 - msg: "consumer name: Tom" - - "204": - $ref: "#/components/responses/Generic204" - "400": - $ref: "#/components/responses/Generic400" - "401": - $ref: "#/components/responses/Generic401" - "403": - $ref: "#/components/responses/Generic403" - "404": - $ref: "#/components/responses/Generic404" - "422": - $ref: "#/components/responses/Generic422" - "429": - $ref: "#/components/responses/Generic429" - -components: - securitySchemes: - openId: - type: openIdConnect - openIdConnectUrl: https://example.com/.well-known/openid-configuration - parameters: - x-correlator: - name: x-correlator - in: header - description: Correlation id for the different services - schema: - type: string - pattern: ^[a-zA-Z0-9-]{0,55}$ - example: "b4333c46-49c0-4f62-80d7-f0ef930f1c46" - headers: - x-correlator: - description: Correlation id for the different services - schema: - type: string - pattern: ^[a-zA-Z0-9-]{0,55}$ - example: "b4333c46-49c0-4f62-80d7-f0ef930f1c46" - schemas: - SMSSendRequest: - title: SMSSendRequest - type: object - properties: - brand name: - type: string - description: Consumer account - example: 'XX Hospital' - A-number: - type: string - description: Calling Number - example: '+123456789' - templateCode: - type: string - description: Template code - example: 'tmplatcode11001' - strategy: - type: string - description: Indicating API service providers to send the brand card under certain specific circumstances such as TTL, location and etc. - - - description: request parmeters - - SMSSendResponse: - title: SMSSendResponse - type: object - properties: - code: - type: integer - description: response code, where 200 indicates success, and any other codes indicate failure - msg: - type: string - description: response code detail description - example: 'No_Content' - description: response parmeters - - PhoneNumber: - description: A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, prefixed with '+'. - type: string - pattern: '^\+[1-9][0-9]{4,14}$' - example: "+123456789" - - Port: - description: TCP or UDP port number - type: integer - minimum: 0 - maximum: 65535 - - - ErrorInfo: - description: The error object used for error-cases. - type: object - required: - - status - - code - properties: - code: - type: integer - description: HTTP response status code - status: - type: string - description: Code given to this error - - - responses: - Generic204: - description: Status code indicates that the request result failure. - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 204 - status: - enum: - - No_Contect - - examples: - GENERIC_400_INVALID_ARGUMENT: - description: Invalid request. - value: - status: No_Contect - code: 204 - Generic400: - description: Bad Request - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 400 - status: - enum: - - INVALID_ARGUMENT - - OUT_OF_RANGE - examples: - GENERIC_400_INVALID_ARGUMENT: - description: Invalid Argument. Generic Syntax Exception - value: - status: INVALID_ARGUMENT - code: 400 - message: Client specified an invalid argument, request body or query param. - GENERIC_400_OUT_OF_RANGE: - description: Out of Range. Specific Syntax Exception used when a given field has a pre-defined range or a invalid filter criteria combination is requested - value: - status: OUT_OF_RANGE - code: 400 - message: Client specified an invalid range. - Generic401: - description: Unauthorized - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 401 - status: - enum: - - UNAUTHENTICATED - - AUTHENTICATION_REQUIRED - examples: - GENERIC_401_UNAUTHENTICATED: - description: Request cannot be authenticated - value: - status: UNAUTHENTICATED - code: 401 - 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: AUTHENTICATION_REQUIRED - code: 401 - message: New authentication is required. - Generic403: - description: Forbidden - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 403 - status: - enum: - - PERMISSION_DENIED - examples: - 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: PERMISSION_DENIED - code: 403 - message: Client does not have sufficient permissions to perform this action. - Generic404: - description: Not found - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 404 - status: - enum: - - NOT_FOUND - - IDENTIFIER_NOT_FOUND - examples: - GENERIC_404_NOT_FOUND: - description: Resource is not found - value: - status: NOT_FOUND - code: 404 - message: The specified resource is not found. - Generic422: - description: Unprocessable Content - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 422 - status: - enum: - - SERVICE_NOT_APPLICABLE - - MISSING_IDENTIFIER - - UNNECESSARY_IDENTIFIER - examples: - GENERIC_422_SERVICE_NOT_APPLICABLE: - description: Service not applicable for the provided identifier - value: - status: SERVICE_NOT_APPLICABLE - code: 422 - message: The service is not available for the provided identifier. - GENERIC_422_MISSING_IDENTIFIER: - description: phone number is not included in the request (in case of 2-legged) or the phone number identification cannot be derived from access token (in 3-legged) - value: - status: MISSING_IDENTIFIER - code: 422 - message: The device cannot be identified. - GENERIC_422_UNNECESSARY_IDENTIFIER: - description: An explicit identifier is provided when a device or phone number has already been identified from the access token - value: - status: UNNECESSARY_IDENTIFIER - code: 422 - message: The device is already identified by the access token. - Generic429: - description: Too Many Requests - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 429 - status: - enum: - - QUOTA_EXCEEDED - - TOO_MANY_REQUESTS - examples: - GENERIC_429_QUOTA_EXCEEDED: - description: Request is rejected due to exceeding a business quota limit - value: - status: QUOTA_EXCEEDED - code: 429 - message: Rejected due to exceeding a business quota limit. - GENERIC_429_TOO_MANY_REQUESTS: - description: API Server request limit is overpassed - value: - status: TOO_MANY_REQUESTS - code: 429 - message: Rejected due to request rate limit overpassed. From 92c87c099b9a551ad167ce01283fb30a42ebac59 Mon Sep 17 00:00:00 2001 From: DENGYONG18 <18910193721@189.cn> Date: Fri, 20 Jun 2025 14:12:41 +0800 Subject: [PATCH 6/8] Add files via upload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only the following four mandatory parameters are retained: caller phone number (Mandatory) called phone number (Mandatory) ClientID (Mandatory) timeToLive (Mandatory) --- code/API_definitions/Verified Caller API.yaml | 377 ++++++++++++++++++ 1 file changed, 377 insertions(+) create mode 100644 code/API_definitions/Verified Caller API.yaml diff --git a/code/API_definitions/Verified Caller API.yaml b/code/API_definitions/Verified Caller API.yaml new file mode 100644 index 0000000..328053e --- /dev/null +++ b/code/API_definitions/Verified Caller API.yaml @@ -0,0 +1,377 @@ +openapi: 3.0.3 +info: + title: Verified Caller- Pre-Authorization + description: | + This API provides the API consumers with the ability to display their brand cards and improve the connection rate. + # Introduction + The Verified Caller API is used by the API consumer to display its brand card to the called user, which informs the called user who the caller is, thus reducing malicious calls. + # Relevant Definitions and Concepts + * **Verified Caller**: A service that verifies the identity of the caller. It informs the identity of the caller to the called user through the caller's brand card. + * **Brand card template**: A template includes template code, template parameters and etc., which is to show brand name, logo, text content and etc. Template parameters are used to display the brand card content, and one template code corresponds to one template parameter. + + # API Functionality + This API allows accurate operator certified "brand card" information such as SMS to be displayed on the phone screen of the called user before answering the call. + # Authorization and authentication + In cases where personal data is processed by the API and users can exercise their rights through mechanisms such as opt-in and/or opt-out, the use of three-legged access tokens is mandatory. This ensures that the API remains in compliance with privacy regulations, upholding the principles of transparency and user-centric privacy-by-design. + ## Further info and support + (FAQs will be added in a later version of the documentation) + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + version: wip +externalDocs: + description: Official website of caller ID. + url: https://www.118114.net/qt2//#/intro + +servers: + - url: '{apiRoot}/verified-caller/v1.0.0' + variables: + apiRoot: + default: http://localhost:8081 + description: API root + +tags: + - name: Verified Caller + description: Operations to display caller's brand card to the called user +paths: + /smssend: + post: + tags: + - smssend + summary: "Request to send brand card information such as SMS" + description: Request to send brand card information such as SMS + operationId: SMSSendRequest + parameters: + - $ref: '#/components/parameters/x-correlator' + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SMSSendRequest" + required: true + responses: + "200": + description: (OK) status code indicates that the request result successfully. + headers: + x-correlator: + $ref: '#/components/headers/x-correlator' + content: + application/json: + schema: + $ref: "#/components/schemas/SMSSendResponse" + examples: + SMSSendResponse: + value: + code: 200 + msg: "consumer name: Tom" + + "204": + $ref: "#/components/responses/Generic204" + "400": + $ref: "#/components/responses/Generic400" + "401": + $ref: "#/components/responses/Generic401" + "403": + $ref: "#/components/responses/Generic403" + "404": + $ref: "#/components/responses/Generic404" + "422": + $ref: "#/components/responses/Generic422" + "429": + $ref: "#/components/responses/Generic429" + +components: + securitySchemes: + openId: + type: openIdConnect + openIdConnectUrl: https://example.com/.well-known/openid-configuration + parameters: + x-correlator: + name: x-correlator + in: header + description: Correlation id for the different services + schema: + type: string + pattern: ^[a-zA-Z0-9-]{0,55}$ + example: "b4333c46-49c0-4f62-80d7-f0ef930f1c46" + headers: + x-correlator: + description: Correlation id for the different services + schema: + type: string + pattern: ^[a-zA-Z0-9-]{0,55}$ + example: "b4333c46-49c0-4f62-80d7-f0ef930f1c46" + schemas: + SMSSendRequest: + title: SMSSendRequest + type: object + properties: + client ID: + type: string + description: Consumer authentication identifier + example: 'string' + A-number: + type: string + description: Caller Phone Number + example: '+123456789' + B-number: + type: string + description: Called Phone Number + example: '+123456789' + TTL: + type: string + description: Time to live + description: request parameters + + SMSSendResponse: + title: SMSSendResponse + type: object + properties: + code: + type: integer + description: response code, where 200 indicates success, and any other codes indicate failure + msg: + type: string + description: response code detail description + example: 'No_Content' + description: response parameters + + PhoneNumber: + description: A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, prefixed with '+'. + type: string + pattern: '^\+[1-9][0-9]{4,14}$' + example: "+123456789" + + Port: + description: TCP or UDP port number + type: integer + minimum: 0 + maximum: 65535 + + ErrorInfo: + description: The error object used for error-cases. + type: object + required: + - status + - code + properties: + code: + type: integer + description: HTTP response status code + status: + type: string + description: Code given to this error + + + responses: + Generic204: + description: Status code indicates that the request result failure. + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 204 + status: + enum: + - No_Contect + + examples: + GENERIC_400_INVALID_ARGUMENT: + description: Invalid request. + value: + status: No_Contect + code: 204 + Generic400: + description: Bad Request + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 400 + status: + enum: + - INVALID_ARGUMENT + - OUT_OF_RANGE + examples: + GENERIC_400_INVALID_ARGUMENT: + description: Invalid Argument. Generic Syntax Exception + value: + status: INVALID_ARGUMENT + code: 400 + message: Client specified an invalid argument, request body or query param. + GENERIC_400_OUT_OF_RANGE: + description: Out of Range. Specific Syntax Exception used when a given field has a pre-defined range or a invalid filter criteria combination is requested + value: + status: OUT_OF_RANGE + code: 400 + message: Client specified an invalid range. + Generic401: + description: Unauthorized + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 401 + status: + enum: + - UNAUTHENTICATED + - AUTHENTICATION_REQUIRED + examples: + GENERIC_401_UNAUTHENTICATED: + description: Request cannot be authenticated + value: + status: UNAUTHENTICATED + code: 401 + 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: AUTHENTICATION_REQUIRED + code: 401 + message: New authentication is required. + Generic403: + description: Forbidden + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 403 + status: + enum: + - PERMISSION_DENIED + examples: + 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: PERMISSION_DENIED + code: 403 + message: Client does not have sufficient permissions to perform this action. + Generic404: + description: Not found + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 404 + status: + enum: + - NOT_FOUND + - IDENTIFIER_NOT_FOUND + examples: + GENERIC_404_NOT_FOUND: + description: Resource is not found + value: + status: NOT_FOUND + code: 404 + message: The specified resource is not found. + Generic422: + description: Unprocessable Content + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 422 + status: + enum: + - SERVICE_NOT_APPLICABLE + - MISSING_IDENTIFIER + - UNNECESSARY_IDENTIFIER + examples: + GENERIC_422_SERVICE_NOT_APPLICABLE: + description: Service not applicable for the provided identifier + value: + status: SERVICE_NOT_APPLICABLE + code: 422 + message: The service is not available for the provided identifier. + GENERIC_422_MISSING_IDENTIFIER: + description: phone number is not included in the request (in case of 2-legged) or the phone number identification cannot be derived from access token (in 3-legged) + value: + status: MISSING_IDENTIFIER + code: 422 + message: The device cannot be identified. + GENERIC_422_UNNECESSARY_IDENTIFIER: + description: An explicit identifier is provided when a device or phone number has already been identified from the access token + value: + status: UNNECESSARY_IDENTIFIER + code: 422 + message: The device is already identified by the access token. + Generic429: + description: Too Many Requests + headers: + x-correlator: + $ref: "#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "#/components/schemas/ErrorInfo" + - type: object + properties: + code: + enum: + - 429 + status: + enum: + - QUOTA_EXCEEDED + - TOO_MANY_REQUESTS + examples: + GENERIC_429_QUOTA_EXCEEDED: + description: Request is rejected due to exceeding a business quota limit + value: + status: QUOTA_EXCEEDED + code: 429 + message: Rejected due to exceeding a business quota limit. + GENERIC_429_TOO_MANY_REQUESTS: + description: API Server request limit is overpassed + value: + status: TOO_MANY_REQUESTS + code: 429 + message: Rejected due to request rate limit overpassed. \ No newline at end of file From dcd529db6a97cc879aca0e458ace212f4295d0dd Mon Sep 17 00:00:00 2001 From: DENGYONG18 <18910193721@189.cn> Date: Fri, 20 Jun 2025 14:13:03 +0800 Subject: [PATCH 7/8] Delete code/API_definitions/Verified Caller API_Updated.yaml --- .../Verified Caller API_Updated.yaml | 399 ------------------ 1 file changed, 399 deletions(-) delete mode 100644 code/API_definitions/Verified Caller API_Updated.yaml diff --git a/code/API_definitions/Verified Caller API_Updated.yaml b/code/API_definitions/Verified Caller API_Updated.yaml deleted file mode 100644 index 053b83b..0000000 --- a/code/API_definitions/Verified Caller API_Updated.yaml +++ /dev/null @@ -1,399 +0,0 @@ -openapi: 3.0.3 -info: - title: Verified Caller - description: | - This API provides the API consumers with the ability to display their brand cards and improve the connection rate. - - # Introduction - - The Verified Caller API is used by the API consumer to display its brand card to the called user, which informs the called user who the caller is, thus reducing malicious calls. - - # Relevant Definitions and Concepts - - * **Verified Caller**: A service that verifies the identity of the caller. It informs the identity of the caller to the called user through the caller's brand card. - - * **Brand card template**: A template includes template code, template parameters and etc., which is to show brand name, logo, text content and etc. Template parameters are used to display the brand card content, and one template code corresponds to one template parameter. - - * **Strategy**: A brand card presentation strategy, including TTL, location and etc. - - - # API Functionality - - This API allows accurate operator certified "brand card" information such as SMS to be displayed on the phone screen of the called user before answering the call. - - # Authorization and authentication - - In cases where personal data is processed by the API and users can exercise their rights through mechanisms such as opt-in and/or opt-out, the use of three-legged access tokens is mandatory. This ensures that the API remains in compliance with privacy regulations, upholding the principles of transparency and user-centric privacy-by-design. - - ## Further info and support - - (FAQs will be added in a later version of the documentation) - - license: - name: Apache 2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html - version: wip -externalDocs: - description: Official website of caller ID. - url: https://www.118114.net/qt2//#/intro - -servers: - - url: '{apiRoot}/verified-caller/v1.0.0' - variables: - apiRoot: - default: http://localhost:8081 - description: API root - -tags: - - name: Verified Caller - description: Operations to display caller's brand card to the called user -paths: - /smssend: - post: - tags: - - smssend - summary: "Request to send brand card information such as SMS" - description: Request to send brand card information such as SMS - operationId: SMSSendRequest - parameters: - - $ref: '#/components/parameters/x-correlator' - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/SMSSendRequest" - required: true - responses: - "200": - description: (OK) status code indicates that the request result successfully. - headers: - x-correlator: - $ref: '#/components/headers/x-correlator' - content: - application/json: - schema: - $ref: "#/components/schemas/SMSSendResponse" - examples: - SMSSendResponse: - value: - code: 200 - msg: "consumer name: Tom" - - "204": - $ref: "#/components/responses/Generic204" - "400": - $ref: "#/components/responses/Generic400" - "401": - $ref: "#/components/responses/Generic401" - "403": - $ref: "#/components/responses/Generic403" - "404": - $ref: "#/components/responses/Generic404" - "422": - $ref: "#/components/responses/Generic422" - "429": - $ref: "#/components/responses/Generic429" - -components: - securitySchemes: - openId: - type: openIdConnect - openIdConnectUrl: https://example.com/.well-known/openid-configuration - parameters: - x-correlator: - name: x-correlator - in: header - description: Correlation id for the different services - schema: - type: string - pattern: ^[a-zA-Z0-9-]{0,55}$ - example: "b4333c46-49c0-4f62-80d7-f0ef930f1c46" - headers: - x-correlator: - description: Correlation id for the different services - schema: - type: string - pattern: ^[a-zA-Z0-9-]{0,55}$ - example: "b4333c46-49c0-4f62-80d7-f0ef930f1c46" - schemas: - SMSSendRequest: - title: SMSSendRequest - type: object - properties: - brand name: - type: string - description: Consumer account - example: 'XX Hospital' - client ID: - type: string - description: Consumer authentication identifier - example: 'string' - A-number: - type: string - description: Calling Phone Number - example: '+123456789' - B-number: - type: string - description: Called Phone Number - example: '+123456789' - templateCode: - type: string - description: Template code - example: 'tmplatcode11001' - strategy: - type: string - description: Indicating API service providers to send the brand card under certain specific circumstances such as TTL, location and etc. Different strategies can be used for different called phone numbers. - description: request parameters - - SMSSendResponse: - title: SMSSendResponse - type: object - properties: - code: - type: integer - description: response code, where 200 indicates success, and any other codes indicate failure - msg: - type: string - description: response code detail description - example: 'No_Content' - description: response parameters - - PhoneNumber: - description: A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, prefixed with '+'. - type: string - pattern: '^\+[1-9][0-9]{4,14}$' - example: "+123456789" - - Port: - description: TCP or UDP port number - type: integer - minimum: 0 - maximum: 65535 - - ErrorInfo: - description: The error object used for error-cases. - type: object - required: - - status - - code - properties: - code: - type: integer - description: HTTP response status code - status: - type: string - description: Code given to this error - - - responses: - Generic204: - description: Status code indicates that the request result failure. - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 204 - status: - enum: - - No_Contect - - examples: - GENERIC_400_INVALID_ARGUMENT: - description: Invalid request. - value: - status: No_Contect - code: 204 - Generic400: - description: Bad Request - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 400 - status: - enum: - - INVALID_ARGUMENT - - OUT_OF_RANGE - examples: - GENERIC_400_INVALID_ARGUMENT: - description: Invalid Argument. Generic Syntax Exception - value: - status: INVALID_ARGUMENT - code: 400 - message: Client specified an invalid argument, request body or query param. - GENERIC_400_OUT_OF_RANGE: - description: Out of Range. Specific Syntax Exception used when a given field has a pre-defined range or a invalid filter criteria combination is requested - value: - status: OUT_OF_RANGE - code: 400 - message: Client specified an invalid range. - Generic401: - description: Unauthorized - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 401 - status: - enum: - - UNAUTHENTICATED - - AUTHENTICATION_REQUIRED - examples: - GENERIC_401_UNAUTHENTICATED: - description: Request cannot be authenticated - value: - status: UNAUTHENTICATED - code: 401 - 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: AUTHENTICATION_REQUIRED - code: 401 - message: New authentication is required. - Generic403: - description: Forbidden - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 403 - status: - enum: - - PERMISSION_DENIED - examples: - 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: PERMISSION_DENIED - code: 403 - message: Client does not have sufficient permissions to perform this action. - Generic404: - description: Not found - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 404 - status: - enum: - - NOT_FOUND - - IDENTIFIER_NOT_FOUND - examples: - GENERIC_404_NOT_FOUND: - description: Resource is not found - value: - status: NOT_FOUND - code: 404 - message: The specified resource is not found. - Generic422: - description: Unprocessable Content - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 422 - status: - enum: - - SERVICE_NOT_APPLICABLE - - MISSING_IDENTIFIER - - UNNECESSARY_IDENTIFIER - examples: - GENERIC_422_SERVICE_NOT_APPLICABLE: - description: Service not applicable for the provided identifier - value: - status: SERVICE_NOT_APPLICABLE - code: 422 - message: The service is not available for the provided identifier. - GENERIC_422_MISSING_IDENTIFIER: - description: phone number is not included in the request (in case of 2-legged) or the phone number identification cannot be derived from access token (in 3-legged) - value: - status: MISSING_IDENTIFIER - code: 422 - message: The device cannot be identified. - GENERIC_422_UNNECESSARY_IDENTIFIER: - description: An explicit identifier is provided when a device or phone number has already been identified from the access token - value: - status: UNNECESSARY_IDENTIFIER - code: 422 - message: The device is already identified by the access token. - Generic429: - description: Too Many Requests - headers: - x-correlator: - $ref: "#/components/headers/x-correlator" - content: - application/json: - schema: - allOf: - - $ref: "#/components/schemas/ErrorInfo" - - type: object - properties: - code: - enum: - - 429 - status: - enum: - - QUOTA_EXCEEDED - - TOO_MANY_REQUESTS - examples: - GENERIC_429_QUOTA_EXCEEDED: - description: Request is rejected due to exceeding a business quota limit - value: - status: QUOTA_EXCEEDED - code: 429 - message: Rejected due to exceeding a business quota limit. - GENERIC_429_TOO_MANY_REQUESTS: - description: API Server request limit is overpassed - value: - status: TOO_MANY_REQUESTS - code: 429 - message: Rejected due to request rate limit overpassed. From d47b2348d6817e6af09cf1b0453a92148693695f Mon Sep 17 00:00:00 2001 From: DENGYONG18 <18910193721@189.cn> Date: Fri, 20 Jun 2025 14:20:27 +0800 Subject: [PATCH 8/8] Update Verified Caller API.yaml --- code/API_definitions/Verified Caller API.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/API_definitions/Verified Caller API.yaml b/code/API_definitions/Verified Caller API.yaml index 328053e..066d92d 100644 --- a/code/API_definitions/Verified Caller API.yaml +++ b/code/API_definitions/Verified Caller API.yaml @@ -8,7 +8,6 @@ info: # Relevant Definitions and Concepts * **Verified Caller**: A service that verifies the identity of the caller. It informs the identity of the caller to the called user through the caller's brand card. * **Brand card template**: A template includes template code, template parameters and etc., which is to show brand name, logo, text content and etc. Template parameters are used to display the brand card content, and one template code corresponds to one template parameter. - # API Functionality This API allows accurate operator certified "brand card" information such as SMS to be displayed on the phone screen of the called user before answering the call. # Authorization and authentication @@ -374,4 +373,4 @@ components: value: status: TOO_MANY_REQUESTS code: 429 - message: Rejected due to request rate limit overpassed. \ No newline at end of file + message: Rejected due to request rate limit overpassed.