Skip to content

Commit 146cc17

Browse files
alexandra142Alexandra Lamiova Pistrakova
andauthored
Add new version 2021-03-31-preview1 for ACS Auth (Azure#13965)
* Add new version 2021-03-31-preview * Set required body * Add all paths to new version * Update description for property of TeamsAccessTokenRequest model * Change version from 2021-03-31-preview to 2021-03-31-preview1 following standards https://skype.visualstudio.com/SPOOL/_wiki/wikis/SPOOL.wiki/16790/Versioning * Rename folder * Update method description * remove Turn endpoint * Add examples * Update readme * Omit the word "skypetoken" from swagger * Link example * Update description and path for a new endpoint Co-authored-by: Alexandra Lamiova Pistrakova <[email protected]>
1 parent 0cfe59f commit 146cc17

File tree

7 files changed

+467
-0
lines changed

7 files changed

+467
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,372 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "CommunicationIdentityClient",
5+
"description": "Azure Communication Identity Service",
6+
"version": "2021-03-31-preview1"
7+
},
8+
"paths": {
9+
"/identities": {
10+
"post": {
11+
"tags": [
12+
"Identity"
13+
],
14+
"summary": "Create a new identity.",
15+
"operationId": "CommunicationIdentity_Create",
16+
"consumes": [
17+
"application/json"
18+
],
19+
"produces": [
20+
"application/json"
21+
],
22+
"parameters": [
23+
{
24+
"$ref": "#/parameters/ApiVersionParameter"
25+
},
26+
{
27+
"in": "body",
28+
"name": "body",
29+
"schema": {
30+
"$ref": "#/definitions/CommunicationIdentityCreateRequest"
31+
}
32+
}
33+
],
34+
"responses": {
35+
"default": {
36+
"description": "Error",
37+
"schema": {
38+
"$ref": "../../../Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#/definitions/CommunicationErrorResponse"
39+
}
40+
},
41+
"201": {
42+
"description": "Created - Returns the created identity.",
43+
"schema": {
44+
"$ref": "#/definitions/CommunicationIdentityAccessTokenResult"
45+
}
46+
}
47+
},
48+
"x-ms-examples": {
49+
"Create an Identity": {
50+
"$ref": "./examples/CreateIdentity.json"
51+
}
52+
}
53+
}
54+
},
55+
"/identities/{id}": {
56+
"delete": {
57+
"tags": [
58+
"Identity"
59+
],
60+
"summary": "Delete the identity, revoke all tokens for the identity and delete all associated data.",
61+
"operationId": "CommunicationIdentity_Delete",
62+
"produces": [
63+
"application/json"
64+
],
65+
"parameters": [
66+
{
67+
"in": "path",
68+
"name": "id",
69+
"description": "Identifier of the identity to be deleted.",
70+
"required": true,
71+
"type": "string"
72+
},
73+
{
74+
"$ref": "#/parameters/ApiVersionParameter"
75+
}
76+
],
77+
"responses": {
78+
"default": {
79+
"description": "Error",
80+
"schema": {
81+
"$ref": "../../../Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#/definitions/CommunicationErrorResponse"
82+
}
83+
},
84+
"204": {
85+
"description": "Success"
86+
}
87+
},
88+
"x-ms-examples": {
89+
"Delete an identity": {
90+
"$ref": "./examples/DeleteIdentity.json"
91+
}
92+
}
93+
}
94+
},
95+
"/identities/{id}/:revokeAccessTokens": {
96+
"post": {
97+
"tags": [
98+
"Identity"
99+
],
100+
"summary": "Revoke all access tokens for the specific identity.",
101+
"operationId": "CommunicationIdentity_RevokeAccessTokens",
102+
"produces": [
103+
"application/json"
104+
],
105+
"parameters": [
106+
{
107+
"in": "path",
108+
"name": "id",
109+
"description": "Identifier of the identity.",
110+
"required": true,
111+
"type": "string"
112+
},
113+
{
114+
"$ref": "#/parameters/ApiVersionParameter"
115+
}
116+
],
117+
"responses": {
118+
"default": {
119+
"description": "Error",
120+
"schema": {
121+
"$ref": "../../../Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#/definitions/CommunicationErrorResponse"
122+
}
123+
},
124+
"204": {
125+
"description": "Success"
126+
}
127+
},
128+
"x-ms-examples": {
129+
"Revoke access tokens": {
130+
"$ref": "./examples/RevokeAccessTokens.json"
131+
}
132+
}
133+
}
134+
},
135+
"/teams/me/:issueAccessToken": {
136+
"post": {
137+
"tags": [
138+
"TeamsToken"
139+
],
140+
"summary": "Issue a new token for a Teams user.",
141+
"operationId": "CommunicationIdentity_IssueTeamsToken",
142+
"consumes": [
143+
"application/json"
144+
],
145+
"produces": [
146+
"application/json"
147+
],
148+
"parameters": [
149+
{
150+
"$ref": "#/parameters/ApiVersionParameter"
151+
},
152+
{
153+
"in": "body",
154+
"name": "body",
155+
"required": true,
156+
"schema": {
157+
"$ref": "#/definitions/TeamsAccessTokenRequest"
158+
}
159+
}
160+
],
161+
"responses": {
162+
"default": {
163+
"description": "Error",
164+
"schema": {
165+
"$ref": "../../../Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#/definitions/CommunicationErrorResponse"
166+
}
167+
},
168+
"200": {
169+
"description": "Success",
170+
"schema": {
171+
"$ref": "#/definitions/CommunicationIdentityAccessToken"
172+
}
173+
}
174+
},
175+
"x-ms-examples": {
176+
"Issue Teams token": {
177+
"$ref": "./examples/IssueTeamsToken.json"
178+
}
179+
}
180+
}
181+
},
182+
"/identities/{id}/:issueAccessToken": {
183+
"post": {
184+
"tags": [
185+
"Token"
186+
],
187+
"summary": "Issue a new token for an identity.",
188+
"operationId": "CommunicationIdentity_IssueAccessToken",
189+
"consumes": [
190+
"application/json"
191+
],
192+
"produces": [
193+
"application/json"
194+
],
195+
"parameters": [
196+
{
197+
"in": "path",
198+
"name": "id",
199+
"description": "Identifier of the identity to issue token for.",
200+
"required": true,
201+
"type": "string"
202+
},
203+
{
204+
"$ref": "#/parameters/ApiVersionParameter"
205+
},
206+
{
207+
"in": "body",
208+
"name": "body",
209+
"description": "Requesting scopes for the new token.",
210+
"required": true,
211+
"schema": {
212+
"$ref": "#/definitions/CommunicationIdentityAccessTokenRequest"
213+
}
214+
}
215+
],
216+
"responses": {
217+
"default": {
218+
"description": "Error",
219+
"schema": {
220+
"$ref": "../../../Microsoft.CommunicationServicesCommon/stable/2021-03-07/common.json#/definitions/CommunicationErrorResponse"
221+
}
222+
},
223+
"200": {
224+
"description": "Success",
225+
"schema": {
226+
"$ref": "#/definitions/CommunicationIdentityAccessToken"
227+
}
228+
}
229+
},
230+
"x-ms-examples": {
231+
"Issue an access token": {
232+
"$ref": "./examples/IssueAccessToken.json"
233+
}
234+
}
235+
}
236+
}
237+
},
238+
"definitions": {
239+
"CommunicationIdentityTokenScope": {
240+
"description": "List of scopes for an access token.",
241+
"enum": [
242+
"chat",
243+
"voip"
244+
],
245+
"type": "string",
246+
"x-ms-enum": {
247+
"name": "CommunicationIdentityTokenScope",
248+
"modelAsString": true
249+
}
250+
},
251+
"CommunicationIdentityCreateRequest": {
252+
"type": "object",
253+
"properties": {
254+
"createTokenWithScopes": {
255+
"description": "Also create access token for the created identity.",
256+
"type": "array",
257+
"items": {
258+
"$ref": "#/definitions/CommunicationIdentityTokenScope"
259+
}
260+
}
261+
}
262+
},
263+
"CommunicationIdentity": {
264+
"description": "A communication identity.",
265+
"required": [
266+
"id"
267+
],
268+
"type": "object",
269+
"properties": {
270+
"id": {
271+
"description": "Identifier of the identity.",
272+
"type": "string"
273+
}
274+
}
275+
},
276+
"CommunicationIdentityAccessToken": {
277+
"description": "An access token.",
278+
"required": [
279+
"expiresOn",
280+
"token"
281+
],
282+
"type": "object",
283+
"properties": {
284+
"token": {
285+
"description": "The access token issued for the identity.",
286+
"type": "string"
287+
},
288+
"expiresOn": {
289+
"format": "date-time",
290+
"description": "The expiry time of the token.",
291+
"type": "string"
292+
}
293+
}
294+
},
295+
"CommunicationIdentityAccessTokenResult": {
296+
"description": "A communication identity with access token.",
297+
"required": [
298+
"identity"
299+
],
300+
"type": "object",
301+
"properties": {
302+
"identity": {
303+
"$ref": "#/definitions/CommunicationIdentity"
304+
},
305+
"accessToken": {
306+
"$ref": "#/definitions/CommunicationIdentityAccessToken"
307+
}
308+
}
309+
},
310+
"TeamsAccessTokenRequest": {
311+
"required": [
312+
"token"
313+
],
314+
"type": "object",
315+
"properties": {
316+
"token": {
317+
"description": "Azure Active Directory access token to acquire a new M365 access token.",
318+
"type": "string"
319+
}
320+
}
321+
},
322+
"CommunicationIdentityAccessTokenRequest": {
323+
"required": [
324+
"scopes"
325+
],
326+
"type": "object",
327+
"properties": {
328+
"scopes": {
329+
"description": "List of scopes attached to the token.",
330+
"type": "array",
331+
"items": {
332+
"$ref": "#/definitions/CommunicationIdentityTokenScope"
333+
}
334+
}
335+
}
336+
}
337+
},
338+
"parameters": {
339+
"ApiVersionParameter": {
340+
"in": "query",
341+
"name": "api-version",
342+
"description": "Version of API to invoke.",
343+
"required": true,
344+
"type": "string"
345+
}
346+
},
347+
"securityDefinitions": {
348+
"azure_auth": {
349+
"type": "oauth2",
350+
"flow": "implicit",
351+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
352+
"scopes": {
353+
"user_impersonation": "impersonate your user account"
354+
}
355+
}
356+
},
357+
"x-ms-parameterized-host": {
358+
"hostTemplate": "{endpoint}",
359+
"useSchemePrefix": false,
360+
"parameters": [
361+
{
362+
"name": "endpoint",
363+
"description": "The communication resource, for example https://my-resource.communication.azure.com",
364+
"required": true,
365+
"type": "string",
366+
"in": "path",
367+
"x-ms-skip-url-encoding": true,
368+
"x-ms-parameter-location": "client"
369+
}
370+
]
371+
}
372+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"parameters": {
3+
"api-version": "2021-03-31-preview1",
4+
"content-type": "application/json",
5+
"endpoint": "https://my-resource.communication.azure.com",
6+
"body": {
7+
"createTokenWithScopes": [
8+
"chat"
9+
]
10+
}
11+
},
12+
"responses": {
13+
"201": {
14+
"body": {
15+
"identity": {
16+
"id": "8:acs:2dee53b4-368b-45b4-ab52-8493fb117652_00000005-14a2-493b-8a72-5a3a0d000081"
17+
},
18+
"accessToken": {
19+
"token": "token",
20+
"expiresOn": "2020-09-10T21:39:39.3244584+00:00"
21+
}
22+
}
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)