Skip to content

Commit 86672d0

Browse files
authored
Merge pull request #25948 from microsoftgraph/doc-improvement-create-chat
[Doc Improvement][Added note for chat post][4143374]
2 parents 6164cc5 + 11e9149 commit 86672d0

File tree

3 files changed

+193
-11
lines changed

3 files changed

+193
-11
lines changed

api-reference/beta/api/chat-post.md

Lines changed: 67 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,70 @@ Location: /chats('19:82fe7758-5bb3-4f0d-a43f-e555fd399c6f_bfb5bb25-3a8d-487d-982
361361

362362
The async operation is initiated, and the response contains a Location header, which includes a link to the [teamsAsyncOperation](../resources/teamsasyncoperation.md). The link can be used to get the operation status and details. For details, see [Get operation on chat](teamsasyncoperation-get.md#example-get-operation-on-chat).
363363

364-
### Example 4: Create a one-on-one chat using user principal name
364+
### Example 4: Create a one-on-one chat with RSC-granted apps
365+
366+
The following example shows how to create a one-on-one chat with installed apps that have resource-specific consent (RSC) permissions.
367+
368+
#### Request
369+
370+
The following example shows a request.
371+
372+
<!-- {
373+
"blockType": "request",
374+
"name": "create_chat_oneonone_with_rsc_granted_apps"
375+
}
376+
-->
377+
``` http
378+
POST https://graph.microsoft.com/beta/chats
379+
Content-Type: application/json
380+
381+
{
382+
"chatType": "oneOnOne",
383+
"members": [
384+
{
385+
"@odata.type": "#microsoft.graph.aadUserConversationMember",
386+
"roles": ["owner"],
387+
"user@odata.bind": "https://graph.microsoft.com/beta/users('4b822dfc-2864-44e6-aa1e-7e0e8552168f')"
388+
},
389+
{
390+
"@odata.type": "#microsoft.graph.aadUserConversationMember",
391+
"roles": ["owner"],
392+
"user@odata.bind": "https://graph.microsoft.com/beta/users('6d1e1501-7a3d-45b7-b71b-68d372e5ce14')"
393+
}
394+
],
395+
"installedApps": [
396+
{
397+
"teamsApp@odata.bind": "https://graph.microsoft.com/beta/appCatalogs/teamsApps/8e55a7b1-6766-4f0a-8610-ecacfe3d569a",
398+
"consentedPermissionSet": {
399+
"resourceSpecificPermissions": [
400+
{
401+
"permissionValue": "ChatMessage.Read.Chat",
402+
"permissionType": "application"
403+
},
404+
{
405+
"permissionValue": "OnlineMeeting.ReadBasic.Chat",
406+
"permissionType": "application"
407+
}
408+
]
409+
}
410+
}
411+
]
412+
}
413+
```
414+
415+
#### Response
416+
The following example shows the response.
417+
<!-- {
418+
"blockType": "response"
419+
}
420+
-->
421+
```http
422+
HTTP/1.1 202 Accepted
423+
Content-Type: application/json
424+
Location: /chats('19:82fe7758-5bb3-4f0d-a43f-e555fd399c6f_bfb5bb25-3a8d-487d-9828-7875ced51a30@unq.gbl.spaces')/operations('2432b57b-0abd-43db-aa7b-16eadd115d34-861f06db-0208-4815-b67a-965df0d28b7f-10adc8a6-60db-42e2-9761-e56a7e4c7bc9')
425+
```
426+
427+
### Example 5: Create a one-on-one chat using user principal name
365428

366429
#### Request
367430

@@ -465,7 +528,7 @@ Content-Type: application/json
465528
}
466529
```
467530

468-
### Example 5: Create a group chat with in-tenant guest
531+
### Example 6: Create a group chat with in-tenant guest
469532

470533
#### Request
471534

@@ -574,7 +637,7 @@ Content-Type: application/json
574637
}
575638
```
576639

577-
### Example 6: Create a one-on-one chat with a federated user (outside of own organization)
640+
### Example 7: Create a one-on-one chat with a federated user (outside of own organization)
578641

579642
#### Request
580643

@@ -655,7 +718,7 @@ HTTP/1.1 201 Created
655718
Content-Type: application/json
656719
657720
{
658-
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#chats/$entity",
721+
"@odata.context": "https://graph.microsoft.com/beta/$metadata#chats/$entity",
659722
"id": "19:82af01c5-f7cc-4a2e-a728-3a5df21afd9d_8b081ef6-4792-4def-b2c9-c363a1bf41d5@unq.gbl.spaces",
660723
"topic": null,
661724
"createdDateTime": "2020-12-04T23:10:28.51Z",

api-reference/v1.0/api/chat-post.md

Lines changed: 119 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,123 @@ Content-Type: application/json
239239
}
240240
```
241241

242-
### Example 3: Create a one-on-one chat using user principal name
242+
### Example 3: Create a one-on-one chat with installed apps
243+
244+
The following example shows how to create a one-on-one chat with installed apps.
245+
246+
#### Request
247+
248+
The following example shows a request.
249+
250+
<!-- {
251+
"blockType": "request",
252+
"name": "create_chat_oneonone_with_installed_apps"
253+
}
254+
-->
255+
``` http
256+
POST https://graph.microsoft.com/v1.0/chats
257+
Content-Type: application/json
258+
259+
{
260+
"chatType": "oneOnOne",
261+
"members": [
262+
{
263+
"@odata.type": "#microsoft.graph.aadUserConversationMember",
264+
"roles": ["owner"],
265+
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('8b081ef6-4792-4def-b2c9-c363a1bf41d5')"
266+
},
267+
{
268+
"@odata.type": "#microsoft.graph.aadUserConversationMember",
269+
"roles": ["owner"],
270+
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('82af01c5-f7cc-4a2e-a728-3a5df21afd9d')"
271+
}
272+
],
273+
"installedApps": [
274+
{
275+
"teamsApp@odata.bind":"https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/05F59CEC-A742-4A50-A62E-202A57E478A4"
276+
}
277+
]
278+
}
279+
```
280+
281+
#### Response
282+
283+
The following example shows the response.
284+
285+
<!-- {
286+
"blockType": "response"
287+
}
288+
-->
289+
``` http
290+
HTTP/1.1 202 Accepted
291+
Content-Type: application/json
292+
Location: /chats('19:82fe7758-5bb3-4f0d-a43f-e555fd399c6f_bfb5bb25-3a8d-487d-9828-7875ced51a30@unq.gbl.spaces')/operations('2432b57b-0abd-43db-aa7b-16eadd115d34-861f06db-0208-4815-b67a-965df0d28b7f-10adc8a6-60db-42e2-9761-e56a7e4c7bc9')
293+
```
294+
295+
### Example 4: Create a one-on-one chat with RSC-granted apps
296+
297+
The following example shows how to create a one-on-one chat with installed apps that have resource-specific consent (RSC) permissions.
298+
299+
#### Request
300+
301+
The following example shows a request.
302+
303+
<!-- {
304+
"blockType": "request",
305+
"name": "create_chat_oneonone_with_rsc_granted_apps"
306+
}
307+
-->
308+
``` http
309+
POST https://graph.microsoft.com/v1.0/chats
310+
Content-Type: application/json
311+
312+
{
313+
"chatType": "oneOnOne",
314+
"members": [
315+
{
316+
"@odata.type": "#microsoft.graph.aadUserConversationMember",
317+
"roles": ["owner"],
318+
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('4b822dfc-2864-44e6-aa1e-7e0e8552168f')"
319+
},
320+
{
321+
"@odata.type": "#microsoft.graph.aadUserConversationMember",
322+
"roles": ["owner"],
323+
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('6d1e1501-7a3d-45b7-b71b-68d372e5ce14')"
324+
}
325+
],
326+
"installedApps": [
327+
{
328+
"teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps/8e55a7b1-6766-4f0a-8610-ecacfe3d569a",
329+
"consentedPermissionSet": {
330+
"resourceSpecificPermissions": [
331+
{
332+
"permissionValue": "ChatMessage.Read.Chat",
333+
"permissionType": "application"
334+
},
335+
{
336+
"permissionValue": "OnlineMeeting.ReadBasic.Chat",
337+
"permissionType": "application"
338+
}
339+
]
340+
}
341+
}
342+
]
343+
}
344+
```
345+
346+
#### Response
347+
The following example shows the response.
348+
<!-- {
349+
"blockType": "response"
350+
}
351+
-->
352+
```http
353+
HTTP/1.1 202 Accepted
354+
Content-Type: application/json
355+
Location: /chats('19:82fe7758-5bb3-4f0d-a43f-e555fd399c6f_bfb5bb25-3a8d-487d-9828-7875ced51a30@unq.gbl.spaces')/operations('2432b57b-0abd-43db-aa7b-16eadd115d34-861f06db-0208-4815-b67a-965df0d28b7f-10adc8a6-60db-42e2-9761-e56a7e4c7bc9')
356+
```
357+
358+
### Example 5: Create a one-on-one chat using user principal name
243359

244360
#### Request
245361

@@ -327,7 +443,7 @@ Content-Type: application/json
327443
}
328444
```
329445

330-
### Example 4: Create a group chat with tenant guest user
446+
### Example 6: Create a group chat with tenant guest user
331447

332448
#### Request
333449

@@ -421,7 +537,7 @@ Content-Type: application/json
421537
}
422538
```
423539

424-
### Example 5: Create a one-on-one chat with a federated user (outside of own organization)
540+
### Example 7: Create a one-on-one chat with a federated user (outside of own organization)
425541

426542
#### Request
427543

concepts/whats-new-overview.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ Added [teamsMessageEvidence](/graph/api/resources/security-teamsmessageevidence)
3030

3131
### Teamwork and communications | Messaging
3232

33-
[Get](/graph/api/channel-list-allmembers) all members from a channel, including direct and indirect members of a shared channel.
33+
- [Get](/graph/api/channel-list-allmembers) all members from a channel, including direct and indirect members of a shared channel.
34+
- [Create](/graph/api/chat-post#example-3-create-a-one-on-one-chat-with-installed-apps) a one-on-one chat with installed apps.
35+
- [Create](/graph/api/chat-post#example-4-create-a-one-on-one-chat-with-rsc-granted-apps) a one-on-one chat with RSC-granted apps.
3436

3537
## February 2025: New in preview only
3638

@@ -80,9 +82,10 @@ Enabled the **allowRecording**, **allowTranscription**, **anonymizeIdentityForRo
8082

8183
### Teamwork and communications | Messaging
8284

83-
Introduced the following more granular delegated and application permissions for retrieving all members of a channel:
84-
- Use the `ChannelMember.Read.All` delegated permission instead of the `Group.Read.All` delegated permission.
85-
- Use the `ChannelMember.Read.Group` and `ChannelMember.ReadWrite.Group` application permissions for resource-specific consent.
85+
- Introduced the following more granular delegated and application permissions for retrieving all members of a channel:
86+
- Use the `ChannelMember.Read.All` delegated permission instead of the `Group.Read.All` delegated permission.
87+
- Use the `ChannelMember.Read.Group` and `ChannelMember.ReadWrite.Group` application permissions for resource-specific consent.
88+
- [Create](/graph/api/chat-post?view=graph-rest-beta&preserve-view=true#example-4-create-a-one-on-one-chat-with-rsc-granted-apps) a one-on-one chat with RSC-granted apps.
8689

8790
## January 2025: New and generally available
8891

0 commit comments

Comments
 (0)