Redigera

Dela via


chat resource type

Namespace: microsoft.graph

A chat is a collection of chatMessages between one or more participants. Participants can be users or apps.

Note: If the chat is associated with an onlineMeeting instance, then some of the listed methods will transitively impact the meeting.

Methods

Method Return Type Description
Chat management
Create chat chat Create a new chat.
Get chat chat Read properties and relationships of the chat.
Update chat chat Update properties of the chat.
Delete None Delete a chat.
List members conversationMember collection Get the list of all users in the chat.
Add member Location header Add a user to the chat.
Get member conversationMember Get a single user in the chat.
Remove member None Remove a user from the chat.
Get chat between user and app chat Get one-on-one chat between user and the app
Messages
List messages in a chat chatMessage Get messages in a chat.
Get message reply chatMessage Get a single message in a chat.
Get messages across all chats chat collection Get messages from all chats that a user is a participant in.
Get retained messages across all chats chatMessage collection Get all retained messages from all chats that a user is a participant in, including one-on-one chats, group chats, and meeting chats.
Get delta chat messages for user chatMessage collection Get the list of messages from all chats in which a user is a participant, including one-on-one chats, group chats, and meeting chats.
Apps
List apps in chat teamsAppInstallation collection List apps installed in a chat (and associated meeting).
Get app installed in chat teamsAppInstallation Get a specific app installed in a chat (and associated meeting).
Add app in chat Add (install) an app in a chat (and associated meeting).
Upgrade app installed in chat None Update to the latest version of the app installed in chat (and associated meeting).
Remove app from chat None Remove (uninstall) app from a chat (and associated meeting).
List permission grants resourceSpecificPermissionGrant collection List permissions granted to the apps in this chat.
Tabs
List tabs in chat teamsTab List tabs pinned to a chat (and associated meeting).
Get tab in chat teamsTab Get a specific tab pinned to a chat (and associated meeting).
Add tab to chat teamsTab Add (pin) a tab to a chat (and associated meeting).
Update tab in chat teamsTab Update the properties of a tab in a chat (and associated meeting).
Remove tab from chat None Remove (unpin) a tab from a chat (and associated meeting).
Pinned messages
List pinned messages pinnedChatMessageInfo collection Get a list of pinned messages in a chat.
Pin message pinnedChatMessageInfo Pin a chat message in a chat.
Unpin message None Unpin a message from a chat.

Note: When using application permissions, be sure you know how to get the chat ID. Because listing chats with application permissions is not supported, not all scenarios are possible. It is possible to get chat IDs with delegated permissions, and from change notifications for /chats/getAllMessages with application permissions.

Properties

Property Type Description
chatType chatType Specifies the type of chat. Possible values are: group, oneOnOne, meeting, unknownFutureValue.
createdDateTime dateTimeOffset Date and time at which the chat was created. Read-only.
id String The chat's unique identifier. Read-only.
lastUpdatedDateTime dateTimeOffset Date and time at which the chat was renamed or the list of members was last changed. Read-only.
onlineMeetingInfo teamworkOnlineMeetingInfo Represents details about an online meeting. If the chat isn't associated with an online meeting, the property is empty. Read-only.
tenantId String The identifier of the tenant in which the chat was created. Read-only.
topic String (Optional) Subject or topic for the chat. Only available for group chats.
viewpoint chatViewpoint Represents caller-specific information about the chat, such as the last message read date and time. This property is populated only when the request is made in a delegated context.
webUrl String The URL for the chat in Microsoft Teams. The URL should be treated as an opaque blob, and not parsed. Read-only.

chatType values

Member Value Description
oneOnOne 0 Indicates that the chat is a 1:1 chat. The roster size is fixed for this type of chat; members can't be removed/added.
group 1 Indicates that the chat is a group chat. The roster size (of at least two people) can be updated for this type of chat. Members can be removed/added later.
meeting 2 Indicates that the chat is associated with an online meeting. This type of chat is only created as part of the creation of an online meeting.
unknownFutureValue 3 Evolvable enumeration sentinel value. Don't use.

Relationships

Relationship Type Description
installedApps teamsAppInstallation collection A collection of all the apps in the chat. Nullable.
lastMessagePreview chatMessageInfo Preview of the last message sent in the chat. Null if no messages were sent in the chat. Currently, only the list chats operation supports this property.
members conversationMember collection A collection of all the members in the chat. Nullable.
messages chatMessage collection A collection of all the messages in the chat. Nullable.
permissionGrants resourceSpecificPermissionGrant collection A collection of permissions granted to apps for the chat.
pinnedMessages pinnedChatMessageInfo collection A collection of all the pinned messages in the chat. Nullable.
tabs teamsTab collection A collection of all the tabs in the chat. Nullable.

JSON representation

The following JSON representation shows the resource type.

{
  "createdDateTime": "dateTimeOffset",
  "chatType": "string",
  "id": "string (identifier)",
  "lastUpdatedDateTime": "dateTimeOffset",
  "onlineMeetingInfo": {
    "@odata.type": "microsoft.graph.teamworkOnlineMeetingInfo"
  },
  "tenantId": "string",
  "topic": "string",
  
  "viewpoint": {
    "@odata.type": "microsoft.graph.chatViewpoint"
  },
  "webUrl": "string",
}