Skip to content

Commit bbc95d0

Browse files
committed
Add KYC Tenure API
1 parent 88d5c4e commit bbc95d0

File tree

2 files changed

+289
-1
lines changed

2 files changed

+289
-1
lines changed

.github/workflows/rdme-guides-openapi.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,9 @@ jobs:
111111
- name: Run `openapi` command 🚀
112112
uses: readmeio/rdme@v8
113113
with:
114-
rdme: openapi ./v0/catalog/knowyourcustomer/kyc_age_verification_openapi.yaml --key=${{ secrets.README_API_KEY }} --id=686d430f5c2fd20018ce7556
114+
rdme: openapi ./v0/catalog/knowyourcustomer/kyc_age_verification_openapi.yaml --key=${{ secrets.README_API_KEY }} --id=686d430f5c2fd20018ce7556
115+
116+
- name: Run `openapi` command 🚀
117+
uses: readmeio/rdme@v8
118+
with:
119+
rdme: openapi ./v0/catalog/knowyourcustomer/kyc_tenure_openapi.yaml --key=${{ secrets.README_API_KEY }} --id=6874e6f254f6aa3161e0c45b
Lines changed: 283 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,283 @@
1+
openapi: 3.0.3
2+
info:
3+
title: Tenure
4+
termsOfService: http://swagger.io/terms/
5+
contact:
6+
name: Telefónica Open Gateway DevRel
7+
url: https://opengateway.telefonica.com/en/developer-hub
8+
email: devrel@telefonica.com
9+
license:
10+
name: Apache 2.0
11+
url: https://www.apache.org/licenses/LICENSE-2.0.html
12+
13+
version: "0.1"
14+
15+
servers:
16+
- url: "{host}/kyc-tenure/v0.1"
17+
variables:
18+
host:
19+
default: sandbox.opengateway.telefonica.com/apigateway
20+
description: API gateway URL
21+
22+
tags:
23+
- name: Check Subscriber Tenure
24+
description: Check details about the length of tenure of the subscriber
25+
26+
paths:
27+
/check-tenure:
28+
post:
29+
summary: Check tenure length v0.1
30+
tags:
31+
- Check Subscriber Tenure
32+
description: |
33+
Verifies a specified length of tenure, based on a provided date, for a network subscriber to establish a level of trust for the network subscription identifier.
34+
35+
Check the [Authorization guide](/docs/authorization) on how to get an OAuth2 token, with the following scope:
36+
37+
`dpv:FraudPreventionAndDetection#kyc-tenure`
38+
39+
Create an app on our [Sandbox](/docs/sandbox) to get credentials and [retrieve tokens](/reference/authorize) so you can perform API calls to our operators' production environments, or use the following convenience token to test in mock mode:
40+
41+
`mock_sandbox_access_token`
42+
operationId: checkTenure
43+
44+
security:
45+
- openId:
46+
- kyc-tenure
47+
48+
requestBody:
49+
required: true
50+
content:
51+
application/json:
52+
schema:
53+
$ref: "#/components/schemas/Tenure"
54+
55+
responses:
56+
"200":
57+
description: Respond with tenure information
58+
headers:
59+
x-correlator:
60+
$ref: "#/components/headers/X-Correlator"
61+
content:
62+
application/json:
63+
schema:
64+
$ref: "#/components/schemas/TenureInfo"
65+
66+
"400":
67+
$ref: '#/components/responses/Generic400'
68+
"401":
69+
$ref: '#/components/responses/Generic401'
70+
"403":
71+
$ref: '#/components/responses/Generic403'
72+
"404":
73+
$ref: '#/components/responses/Generic404'
74+
"422":
75+
$ref: '#/components/responses/Generic422'
76+
77+
components:
78+
securitySchemes:
79+
openId:
80+
type: openIdConnect
81+
openIdConnectUrl: https://example.com/.well-known/openid-configuration
82+
83+
headers:
84+
X-Correlator:
85+
description: Correlation id for the different services
86+
schema:
87+
type: string
88+
pattern: ^[a-zA-Z0-9-]{0,55}$
89+
90+
schemas:
91+
Tenure:
92+
description: Specifies date from which continuous tenure of the identified mobile subscriber is required to be confirmed
93+
type: object
94+
properties:
95+
tenureDate:
96+
type: string
97+
description: The date, in RFC 3339 / ISO 8601 compliant format "YYYY-MM-DD", from which continuous tenure of the identified network subscriber is required to be confirmed
98+
format: date
99+
example: "2023-07-03"
100+
required:
101+
- tenureDate
102+
103+
TenureInfo:
104+
properties:
105+
tenureDateCheck:
106+
description: |
107+
`true` when the identified mobile subscription has had valid tenure since `tenureDate`, otherwise `false`
108+
example: true
109+
type: boolean
110+
contractType:
111+
description: |
112+
If exists, populated with:
113+
- `PAYG` - prepaid (pay-as-you-go) account
114+
- `PAYM` - contract account
115+
- `Business` - Business (enterprise) account
116+
117+
This attribute may be omitted from the response set if the information is not available
118+
example: "PAYM"
119+
type: string
120+
enum: ["PAYG", "PAYM", "Business"]
121+
required:
122+
- tenureDateCheck
123+
124+
ErrorInfo:
125+
type: object
126+
required:
127+
- message
128+
- status
129+
- code
130+
properties:
131+
message:
132+
type: string
133+
description: A human readable description of what the event represent
134+
status:
135+
type: integer
136+
description: HTTP response status code
137+
code:
138+
type: string
139+
description: Friendly Code to describe the error
140+
141+
responses:
142+
Generic400:
143+
description: Bad Request
144+
content:
145+
application/json:
146+
schema:
147+
allOf:
148+
- $ref: "#/components/schemas/ErrorInfo"
149+
- type: object
150+
properties:
151+
status:
152+
enum:
153+
- 400
154+
code:
155+
enum:
156+
- INVALID_ARGUMENT
157+
- OUT_OF_RANGE
158+
examples:
159+
GENERIC_400_INVALID_ARGUMENT:
160+
description: Invalid Argument. Generic Syntax Exception
161+
value:
162+
status: 400
163+
code: INVALID_ARGUMENT
164+
message: Client specified an invalid argument, request body or query param.
165+
GENERIC_400_OUT_OF_RANGE:
166+
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
167+
value:
168+
status: 400
169+
code: OUT_OF_RANGE
170+
message: Client specified an invalid range.
171+
172+
Generic401:
173+
description: Unauthorized
174+
content:
175+
application/json:
176+
schema:
177+
allOf:
178+
- $ref: "#/components/schemas/ErrorInfo"
179+
- type: object
180+
properties:
181+
status:
182+
enum:
183+
- 401
184+
code:
185+
enum:
186+
- UNAUTHENTICATED
187+
- AUTHENTICATION_REQUIRED
188+
examples:
189+
GENERIC_401_UNAUTHENTICATED:
190+
description: Request cannot be authenticated
191+
value:
192+
status: 401
193+
code: UNAUTHENTICATED
194+
message: Request not authenticated due to missing, invalid, or expired credentials.
195+
GENERIC_401_AUTHENTICATION_REQUIRED:
196+
description: New authentication is needed, authentication is no longer valid
197+
value:
198+
status: 401
199+
code: AUTHENTICATION_REQUIRED
200+
message: New authentication is required.
201+
202+
Generic403:
203+
description: Forbidden
204+
content:
205+
application/json:
206+
schema:
207+
allOf:
208+
- $ref: "#/components/schemas/ErrorInfo"
209+
- type: object
210+
properties:
211+
status:
212+
enum:
213+
- 403
214+
code:
215+
enum:
216+
- PERMISSION_DENIED
217+
examples:
218+
GENERIC_403_PERMISSION_DENIED:
219+
description: Permission denied. OAuth2 token access does not have the required scope or when the user fails operational security
220+
value:
221+
status: 403
222+
code: PERMISSION_DENIED
223+
message: Client does not have sufficient permissions to perform this action.
224+
225+
Generic404:
226+
description: Not found
227+
content:
228+
application/json:
229+
schema:
230+
allOf:
231+
- $ref: "#/components/schemas/ErrorInfo"
232+
- type: object
233+
properties:
234+
status:
235+
enum:
236+
- 404
237+
code:
238+
enum:
239+
- IDENTIFIER_NOT_FOUND
240+
examples:
241+
GENERIC_404_IDENTIFIER_NOT_FOUND:
242+
description: The phone number is not associated with a CSP customer account
243+
value:
244+
status: 404
245+
code: IDENTIFIER_NOT_FOUND
246+
message: The phone number provided is not associated with a customer account
247+
248+
Generic422:
249+
description: Unprocessable Content
250+
content:
251+
application/json:
252+
schema:
253+
allOf:
254+
- $ref: "#/components/schemas/ErrorInfo"
255+
- type: object
256+
properties:
257+
status:
258+
enum:
259+
- 422
260+
code:
261+
enum:
262+
- SERVICE_NOT_APPLICABLE
263+
- MISSING_IDENTIFIER
264+
- UNNECESSARY_IDENTIFIER
265+
examples:
266+
GENERIC_422_SERVICE_NOT_APPLICABLE:
267+
description: Service is not applicable for the provided phone number
268+
value:
269+
status: 422
270+
code: SERVICE_NOT_APPLICABLE
271+
message: The service is not applicable for the provided phone number
272+
GENERIC_422_MISSING_IDENTIFIER:
273+
description: No phone number has been provided either explicitly or associated with the access token
274+
value:
275+
status: 422
276+
code: MISSING_IDENTIFIER
277+
message: No phone number has been provided
278+
GENERIC_422_UNNECESSARY_IDENTIFIER:
279+
description: An explicit phone number has been provided when one is already associated with the access token
280+
value:
281+
status: 422
282+
code: UNNECESSARY_IDENTIFIER
283+
message: An explicit phone number has been provided when one is already associated with the access token

0 commit comments

Comments
 (0)