Skip to content

Commit 7155231

Browse files
Merge pull request #5637 from AfraHussaindeen/master_resend-docs
Add verification code management API docs
2 parents e63d9f7 + 55c8ffe commit 7155231

14 files changed

+1093
-0
lines changed
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
openapi: 3.1.0
2+
info:
3+
title: Verification Code Management API
4+
description: |
5+
This API manages verification codes for various verification scenarios including validation and resending.
6+
version: 1.0.0
7+
servers:
8+
- url: https://api.asgardeo.io/t/{organization-name}/o/api/identity/user/v1.0
9+
security:
10+
- OAuth2: []
11+
paths:
12+
/validate-code:
13+
post:
14+
tags:
15+
- Verification Code
16+
summary: Validate code
17+
description: |
18+
This API is used to validate the code generated during the verification process associated with a user.
19+
20+
<b>Scope(Permission) required:</b> `internal_org_user_code_mgt_create`
21+
operationId: validateCode
22+
requestBody:
23+
description: The validation code retrieved for the verification scenario, and optional property parameters.
24+
required: true
25+
content:
26+
application/json:
27+
schema:
28+
$ref: '#/components/schemas/CodeValidationRequest'
29+
responses:
30+
'202':
31+
description: Accepted
32+
content: {}
33+
'400':
34+
description: Bad Request
35+
content:
36+
application/json:
37+
schema:
38+
$ref: '#/components/schemas/Error'
39+
'401':
40+
description: Unauthorized
41+
content:
42+
application/json:
43+
schema:
44+
$ref: '#/components/schemas/Error'
45+
'500':
46+
description: Server Error
47+
content:
48+
application/json:
49+
schema:
50+
$ref: '#/components/schemas/Error'
51+
x-codeSamples:
52+
- lang: Curl
53+
source: |
54+
curl -X POST \
55+
-H "Authorization: Bearer <bearer_token>" \
56+
-H "Content-Type: application/json" \
57+
-d '{
58+
"code": "string",
59+
"properties": []
60+
}' \
61+
"https://api.asgardeo.io/t/{organization-name}/o/api/identity/user/v1.0/validate-code"
62+
/resend-code:
63+
post:
64+
tags:
65+
- Verification Code
66+
summary: Resend code
67+
description: |
68+
This API is used to resend the confirmation code if it is missing.
69+
70+
<b>Scope(Permission) required:</b> `internal_org_user_code_mgt_create`
71+
operationId: resendCode
72+
requestBody:
73+
description: User information and optional property parameters to resend the verification code.
74+
required: true
75+
content:
76+
application/json:
77+
schema:
78+
$ref: '#/components/schemas/ResendCodeRequest'
79+
responses:
80+
'201':
81+
description: Created
82+
content: {}
83+
'400':
84+
description: Bad Request
85+
content:
86+
application/json:
87+
schema:
88+
$ref: '#/components/schemas/Error'
89+
'401':
90+
description: Unauthorized
91+
content:
92+
application/json:
93+
schema:
94+
$ref: '#/components/schemas/Error'
95+
'500':
96+
description: Server Error
97+
content:
98+
application/json:
99+
schema:
100+
$ref: '#/components/schemas/Error'
101+
x-codeSamples:
102+
- lang: Curl
103+
source: |
104+
curl -X POST \
105+
-H 'Authorization: Bearer <bearer_token>' \
106+
-H 'Content-Type: application/json' \
107+
-d '{
108+
"user": {
109+
"username": "string",
110+
"realm": "string"
111+
},
112+
"properties": [
113+
{
114+
"key": "string",
115+
"value": "string"
116+
}
117+
]
118+
}' \
119+
'https://api.asgardeo.io/t/{organization-name}/o/api/identity/user/v1.0/resend-code'
120+
components:
121+
schemas:
122+
CodeValidationRequest:
123+
type: object
124+
properties:
125+
code:
126+
type: string
127+
properties:
128+
type: array
129+
items:
130+
$ref: '#/components/schemas/Property'
131+
Error:
132+
type: object
133+
properties:
134+
code:
135+
type: string
136+
message:
137+
type: string
138+
description:
139+
type: string
140+
traceId:
141+
type: string
142+
Property:
143+
type: object
144+
properties:
145+
key:
146+
type: string
147+
value:
148+
type: string
149+
ResendCodeRequest:
150+
type: object
151+
properties:
152+
user:
153+
$ref: '#/components/schemas/User'
154+
properties:
155+
type: array
156+
items:
157+
$ref: '#/components/schemas/Property'
158+
User:
159+
type: object
160+
properties:
161+
username:
162+
type: string
163+
realm:
164+
type: string
165+
securitySchemes:
166+
OAuth2:
167+
type: oauth2
168+
flows:
169+
authorizationCode:
170+
authorizationUrl: 'https://api.asgardeo.io/t/{organization-name}/oauth2/authorize'
171+
tokenUrl: 'https://api.asgardeo.io/t/{organization-name}/oauth2/token'
172+
scopes: {
173+
internal_org_user_code_mgt_create: Grants create access to user code management in the organization
174+
}
175+
description: "**Authorization code OAuth flow** + **Organization Switch**"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
template: templates/redoc.html
3+
---
4+
5+
<redoc spec-url="{{base_path}}/apis/organization-apis/restapis/verification-code-management.yaml"theme='{{redoc_theme}}'></redoc>
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
openapi: 3.1.0
2+
info:
3+
title: Verification Code Management Me API
4+
description: |
5+
This API provides endpoints for the authenticated user to manage verification codes.
6+
version: 1.0.0
7+
servers:
8+
- url: https://api.asgardeo.io/t/{organization-name}/api/identity/user/v1.0
9+
security:
10+
- OAuth2: []
11+
tags:
12+
- name: me
13+
description: Operations for the authenticated user
14+
paths:
15+
/me/validate-code:
16+
post:
17+
tags:
18+
- me
19+
summary: Validate code
20+
description: |
21+
This API is used by the authenticated user to validate a verification code.
22+
23+
<b>Scope(Permission) required:</b> `internal_login`
24+
operationId: meValidateCode
25+
requestBody:
26+
description: The validation code retrieved for the verification scenario and optional properties.
27+
required: true
28+
content:
29+
application/json:
30+
schema:
31+
$ref: '#/components/schemas/MeCodeValidationRequest'
32+
responses:
33+
'202':
34+
description: Accepted
35+
content: {}
36+
'400':
37+
description: Bad Request
38+
content:
39+
application/json:
40+
schema:
41+
$ref: '#/components/schemas/Error'
42+
'401':
43+
description: Unauthorized
44+
content:
45+
application/json:
46+
schema:
47+
$ref: '#/components/schemas/Error'
48+
'500':
49+
description: Server Error
50+
content:
51+
application/json:
52+
schema:
53+
$ref: '#/components/schemas/Error'
54+
x-codeSamples:
55+
- lang: Curl
56+
source: |
57+
curl -X POST \
58+
-H "Authorization: Bearer <bearer_token>" \
59+
-H "Content-Type: application/json" \
60+
-d '{
61+
"code": "string",
62+
"properties": []
63+
}' \
64+
"https://api.asgardeo.io/t/{organization-name}/api/identity/user/v1.0/me/validate-code"
65+
/me/resend-code:
66+
post:
67+
tags:
68+
- me
69+
summary: Resend code
70+
description: |
71+
This API is used by the authenticated user to resend a verification code.
72+
73+
<b>Scope(Permission) required:</b> `internal_login`
74+
operationId: meResendCode
75+
requestBody:
76+
description: Optional property parameters.
77+
required: true
78+
content:
79+
application/json:
80+
schema:
81+
$ref: '#/components/schemas/MeResendCodeRequest'
82+
responses:
83+
'201':
84+
description: Created
85+
content: {}
86+
'400':
87+
description: Bad Request
88+
content:
89+
application/json:
90+
schema:
91+
$ref: '#/components/schemas/Error'
92+
'401':
93+
description: Unauthorized
94+
content:
95+
application/json:
96+
schema:
97+
$ref: '#/components/schemas/Error'
98+
'500':
99+
description: Server Error
100+
content:
101+
application/json:
102+
schema:
103+
$ref: '#/components/schemas/Error'
104+
x-codeSamples:
105+
- lang: Curl
106+
source: |
107+
curl -X POST \
108+
-H "Authorization: Bearer <bearer_token>" \
109+
-H "Content-Type: application/json" \
110+
-d '{
111+
"properties": [
112+
{
113+
"key": "string",
114+
"value": "string"
115+
}
116+
]
117+
}' \
118+
"https://api.asgardeo.io/t/{organization-name}/api/identity/user/v1.0/me/resend-code"
119+
components:
120+
schemas:
121+
MeCodeValidationRequest:
122+
type: object
123+
required:
124+
- code
125+
properties:
126+
code:
127+
type: string
128+
properties:
129+
type: array
130+
items:
131+
$ref: '#/components/schemas/Property'
132+
MeResendCodeRequest:
133+
type: object
134+
required:
135+
- properties
136+
properties:
137+
properties:
138+
type: array
139+
items:
140+
$ref: '#/components/schemas/Property'
141+
Property:
142+
type: object
143+
properties:
144+
key:
145+
type: string
146+
value:
147+
type: string
148+
Error:
149+
type: object
150+
properties:
151+
code:
152+
type: string
153+
message:
154+
type: string
155+
description:
156+
type: string
157+
traceId:
158+
type: string
159+
securitySchemes:
160+
OAuth2:
161+
type: oauth2
162+
flows:
163+
authorizationCode:
164+
authorizationUrl: 'https://api.asgardeo.io/t/{organization-name}/oauth2/authorize'
165+
tokenUrl: 'https://api.asgardeo.io/t/{organization-name}/oauth2/token'
166+
scopes:
167+
internal_login: Grant permission for an authenticated user for self management.

0 commit comments

Comments
 (0)