Skip to content

Commit 4361e31

Browse files
authored
Merge pull request #28896 from microsoftgraph/main
Off schedule merge for Evan Park.
2 parents 6a33aae + 0ad0173 commit 4361e31

29 files changed

Lines changed: 1420 additions & 97 deletions

api-reference/beta/api/channel-completemigration.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Consider the following points when completing migration for new and existing cha
2020

2121
- When a channel is created in migration mode for the initial import flow, the property **migrationMode** for a [channel](../resources/channel.md) in a team is updated to `completed` instead of being dropped, and the state is permanently marked for chats or channels. Migration mode is a special state that prevents certain operations, such as sending messages and adding members, during the data migration process. The parent team isn't marked with migration mode, as teams can't enter migration mode; only their child channels (general, standard, private, and shared) can.
2222
- For *existing* channels that are already in migration mode, the API completes the message migration process by updating **migrationMode** to `completed` for a [channel](../resources/channel.md) in a team.
23+
- The application that calls **completeMigration** must be the same application that initiated the migration session by calling [startMigration](channel-startmigration.md) on the target channel. This is the same application that is allowed to call [import message](channel-post-messages.md#example-2-import-a-message) during the migration session.
24+
- Calling **completeMigration** removes the import mode banner visible to Teams client users, making the channel fully available again.
2325

2426
After a **completeMigration** request is made for existing or new channels, you can still import more messages into the team by calling [channel: startMigration](channel-startmigration.md).
2527

@@ -193,7 +195,7 @@ HTTP/1.1 400 Bad Request
193195
## Related content
194196

195197
- [channel: startMigration](channel-startmigration.md)
196-
- [Import message with older timestamp](channel-post-messages.md#example-2-import-messages).
198+
- [Import a message](channel-post-messages.md#example-2-import-a-message)
197199
- [Get channel migration status](channel-get.md#example-1-get-a-channel).
198200
- [chat: completeMigration](chat-completemigration.md)
199201
- [chat: startMigration](chat-startmigration.md)

api-reference/beta/api/channel-post-messages.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ Namespace: microsoft.graph
1616

1717
Send a new [chatMessage](../resources/chatmessage.md) in the specified [channel](../resources/channel.md).
1818

19-
> **Note**: It is a violation of the [terms of use](/legal/microsoft-apis/terms-of-use) to use Microsoft Teams as a log file. Only send messages that people will read.
19+
> **Notes**:
20+
> - We don't recommend that you use this API for data migration via the standard create message flow. For data migration scenarios, use the [import messages](/graph/teams-import-messages) flow instead.
21+
> - It's a violation of the [terms of use](/legal/microsoft-apis/terms-of-use) to use Microsoft Teams as a log file. Only send messages that people will read.
2022
2123
[!INCLUDE [national-cloud-support](../../includes/all-clouds.md)]
2224

@@ -172,13 +174,17 @@ Content-type: application/json
172174
}
173175
```
174176

175-
### Example 2: Import messages
177+
### Example 2: Import a message
178+
The following example shows how to import a message. For more information, see [Import messages into Microsoft Teams chats and channels using Microsoft Graph](/graph/teams-import-messages).
176179

177-
> **Note**: The permission scope `Teamwork.Migrate.All` is required for this scenario.
180+
> **Note**: The permission scope `Teamwork.Migrate.All` is required for this scenario. The target channel must be in migration mode. The **from** property attributes the message to a user in the same tenant as the authenticated application. The **createdDateTime** value must be later than the channel **createdDateTime** and must not be in the future.
181+
182+
> [!IMPORTANT]
183+
> The **createdDateTime** must be unique down to the millisecond within the target channel. If a message with the same **createdDateTime** exists, the request fails with `409 Conflict`. Adjust the **createdDateTime** and retry. For more information, see [Import messages into Microsoft Teams chats and channels using Microsoft Graph](/graph/teams-import-messages).
178184
179185
#### Request
180186

181-
The following example shows how to import back-in-time messages using the `createDateTime` and `from` keys in the request body.
187+
The following example shows how to import back-in-time messages using the **createdDateTime** and **from** properties in the request body.
182188

183189

184190
# [HTTP](#tab/http)
@@ -283,7 +289,7 @@ HTTP/1.1 200 OK
283289
}
284290
```
285291

286-
### Example 3: Import messages with inline images
292+
### Example 3: Import a message with inline images
287293

288294
> [!NOTE]
289295
> Currently, inline images are the only media type supported by the import message API schema.

api-reference/beta/api/channel-startmigration.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ Start the migration of external messages by enabling migration mode in an existi
1818

1919
Users are also allowed to define a minimum timestamp for content to be migrated, allowing them to import messages from the past. The provided timestamp must be older than the current **createdDateTime** for a [channel](../resources/channel.md). The provided timestamp is used to replace the existing **createdDateTime** of the [channel](../resources/channel.md).
2020

21+
> [!NOTE]
22+
> - The application that calls **startMigration** owns the migration session end to end. The same application must call [import message](channel-post-messages.md#example-2-import-a-message) and [completeMigration](channel-completemigration.md) for the same thread. No other application can invoke these APIs on the thread until the owning application completes the migration.
23+
> - Once a channel enters migration mode, a banner is displayed in the Teams client that indicates the conversation is in import mode. This banner remains visible until migration is completed by [completeMigration](channel-completemigration.md).
24+
2125
[!INCLUDE [channel-support](../../includes/supported-channels-for-import.md)]
2226

2327
[!INCLUDE [national-cloud-support](../../includes/global-only.md)]
@@ -191,7 +195,7 @@ HTTP/1.1 400 Bad Request
191195
## Related content
192196

193197
- [channel: completeMigration](channel-completemigration.md)
194-
- [Import message with older timestamp](channel-post-messages.md#example-2-import-messages).
198+
- [Import a message](channel-post-messages.md#example-2-import-a-message).
195199
- [Get channel migration status](channel-get.md#example-1-get-a-channel).
196200
- [chat: completeMigration](chat-completemigration.md)
197201
- [chat: startMigration](chat-startmigration.md)

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ Complete the migration of external messages by removing migration mode from a [c
1818

1919
After a **completeMigration** request is made for an existing or new chat, you can start a migration session by calling [chat: startMigration](chat-startmigration.md).
2020

21+
> [!NOTE]
22+
> - The application that calls **completeMigration** must be the same application that initiated the migration session by calling [startMigration](chat-startmigration.md) on the target chat. This is the same application that is allowed to call [import message](chat-post-messages.md#example-2-import-a-message) during the migration session.
23+
> - Calling **completeMigration** removes the import mode banner visible to Teams client users, making the chat fully available again.
24+
2125
[!INCLUDE [chat-support](../../includes/supported-chats-for-import.md)]
2226

2327
[!INCLUDE [national-cloud-support](../../includes/global-only.md)]
@@ -189,7 +193,7 @@ HTTP/1.1 400 Bad Request
189193
## Related content
190194

191195
- [chat: startMigration](chat-startmigration.md)
192-
- [Import message with older timestamp](channel-post-messages.md#example-2-import-messages)
196+
- [Import a message](chat-post-messages.md#example-2-import-a-message).
193197
- [Get message import status](chatmessage-get.md)
194198
- [channel: completeMigration](channel-completemigration.md)
195199
- [channel: startMigration](channel-startmigration.md)

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

Lines changed: 95 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Namespace: microsoft.graph
1616

1717
Send a new [chatMessage](../resources/chatmessage.md) in the specified [chat](../resources/chat.md). This API cannot create a new chat; you must use the [list chats](chat-list.md) method to retrieve the ID of an existing chat before creating a chat message.
1818

19-
> **Note**: We don't recommend that you use this API for data migration. It does not have the throughput necessary for a typical migration.
20-
21-
> **Note**: It is a violation of the [terms of use](/legal/microsoft-apis/terms-of-use) to use Microsoft Teams as a log file. Only send messages that people will read.
19+
> **Notes**:
20+
> - We don't recommend that you use this API for data migration via the standard create message flow. For data migration scenarios, use the [import messages](/graph/teams-import-messages) flow instead.
21+
> - It's a violation of the [terms of use](/legal/microsoft-apis/terms-of-use) to use Microsoft Teams as a log file. Only send messages that people will read.
2222
2323
[!INCLUDE [national-cloud-support](../../includes/all-clouds.md)]
2424

@@ -54,8 +54,8 @@ If successful, this method returns a `201 Created` response code and a new [chat
5454
## Examples
5555

5656
For a more comprehensive list of examples, see [Create chatMessage in a channel or a chat](chatmessage-post.md).
57-
58-
### Request
57+
### Example 1: Create a chatMessage
58+
#### Request
5959

6060
The following example shows a request.
6161

@@ -107,7 +107,7 @@ Content-type: application/json
107107

108108
---
109109

110-
### Response
110+
#### Response
111111

112112
The following example shows the response.
113113

@@ -162,6 +162,95 @@ Content-type: application/json
162162
}
163163
```
164164

165+
### Example 2: Import a message
166+
167+
The following example shows how to import a message. For more information, see [Import messages into Microsoft Teams chats and channels using Microsoft Graph](/graph/teams-import-messages).
168+
169+
> **Note**: The permission scope `Teamwork.Migrate.All` is required for this scenario. The target chat must be in migration mode.
170+
171+
> [!IMPORTANT]
172+
> The **createdDateTime** must be unique down to the millisecond within the target chat. If a message with the same **createdDateTime** exists, the request fails with `409 Conflict`. Adjust the **createdDateTime** and retry. For more information, see [Import messages into Microsoft Teams chats and channels using Microsoft Graph](/graph/teams-import-messages).
173+
174+
#### Request
175+
176+
The following example shows how to import a message into a chat on behalf of a user using the **createdDateTime** and **from** properties in the request body.
177+
178+
<!-- {
179+
"blockType": "request",
180+
"name": "import_chatmessage",
181+
"sampleKeys": ["19:4b6bed8d24574f6a9e436813cb2617d8@thread.tacv2"]
182+
}-->
183+
184+
```http
185+
POST https://graph.microsoft.com/beta/chats/19:4b6bed8d24574f6a9e436813cb2617d8@thread.tacv2/messages
186+
187+
{
188+
"createdDateTime": "2019-02-04T19:58:15.511Z",
189+
"from": {
190+
"user": {
191+
"id": "8ea0e38b-efb3-4757-924a-5f94061cf8c2",
192+
"displayName": "Robin Kline",
193+
"userIdentityType": "aadUser"
194+
}
195+
},
196+
"body": {
197+
"contentType": "html",
198+
"content": "Hello World"
199+
}
200+
}
201+
```
202+
203+
#### Response
204+
205+
The following example shows the response.
206+
207+
<!-- {
208+
"blockType": "response",
209+
"truncated": true,
210+
"@odata.type": "microsoft.graph.chatMessage"
211+
} -->
212+
213+
```http
214+
HTTP/1.1 200 OK
215+
216+
{
217+
"@odata.context": "https://graph.microsoft.com/beta/$metadata#chats('19%3A4b6bed8d24574f6a9e436813cb2617d8%40thread.tacv2')/messages/$entity",
218+
"id": "1616991463150",
219+
"replyToId": null,
220+
"etag": "1616991463150",
221+
"messageType": "message",
222+
"createdDateTime": "2019-02-04T19:58:15.511Z",
223+
"lastModifiedDateTime": null,
224+
"deletedDateTime": null,
225+
"subject": null,
226+
"summary": null,
227+
"chatId": "19:4b6bed8d24574f6a9e436813cb2617d8@thread.tacv2",
228+
"importance": "normal",
229+
"locale": "en-us",
230+
"webUrl": null,
231+
"channelIdentity": null,
232+
"policyViolation": null,
233+
"eventDetail": null,
234+
"from": {
235+
"application": null,
236+
"device": null,
237+
"conversation": null,
238+
"user": {
239+
"id": "8ea0e38b-efb3-4757-924a-5f94061cf8c2",
240+
"displayName": "Robin Kline",
241+
"userIdentityType": "aadUser"
242+
}
243+
},
244+
"body": {
245+
"contentType": "html",
246+
"content": "Hello World"
247+
},
248+
"attachments": [],
249+
"mentions": [],
250+
"reactions": []
251+
}
252+
```
253+
165254
<!-- uuid: 16cd6b66-4b1a-43a1-adaf-3a886856ed98
166255
2019-02-04 14:57:30 UTC -->
167256
<!-- {

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ You can define a minimum timestamp for content migration that enables the import
2121
- The **createdDateTime** can only be moved towards the past.
2222
- The **createdDateTime** can't be updated to a value newer than the current **createdDateTime**.
2323

24+
> [!NOTE]
25+
> - The application that calls **startMigration** owns the migration session end to end. The same application must call [import message](chat-post-messages.md#example-2-import-a-message) and [completeMigration](chat-completemigration.md) for the same thread. No other application can invoke these APIs on the thread until the owning application completes the migration.
26+
> - Once a chat enters migration mode, a banner is displayed in the Teams client that indicates the conversation is in import mode. This banner remains visible until migration is completed by [completeMigration](chat-completemigration.md).
27+
2428
[!INCLUDE [chat-support](../../includes/supported-chats-for-import.md)]
2529

2630
[!INCLUDE [national-cloud-support](../../includes/global-only.md)]
@@ -51,7 +55,7 @@ In the request body, supply a JSON representation of the following parameters.
5155

5256
| Parameter | Type | Description |
5357
|:---------------|:--------|:--------|
54-
|conversationCreationDateTime|DateTimeOffset|The minimum timestamp for the messages to be migrated. The timestamp must be older than the current **createdDateTime** of the channel. If not provided, the current date and time is used. Optional.|
58+
|conversationCreationDateTime|DateTimeOffset|The minimum timestamp for the messages to be migrated. The timestamp must be older than the current **createdDateTime** of the chat. If not provided, the current date and time is used. Optional.|
5559

5660
## Response
5761

@@ -197,7 +201,7 @@ HTTP/1.1 400 Bad Request
197201
## Related content
198202

199203
- [chat: completeMigration](chat-completemigration.md)
200-
- [Import message with older timestamp](channel-post-messages.md#example-2-import-messages)
204+
- [Import a message](chat-post-messages.md#example-2-import-a-message).
201205
- [Get message import status](chatmessage-get.md)
202206
- [channel: completeMigration](channel-completemigration.md)
203207
- [channel: startMigration](channel-startmigration.md)

api-reference/beta/api/chatmessage-post-replies.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ Namespace: microsoft.graph
1616

1717
Send a new reply to a [chatMessage](../resources/chatmessage.md) in a specified [channel](../resources/channel.md).
1818

19-
> **Note**: It is a violation of the [terms of use](/legal/microsoft-apis/terms-of-use) to use Microsoft Teams as a log file. Only send messages that people will read.
19+
> **Notes**:
20+
> - We don't recommend that you use this API for data migration via the standard create message flow. For data migration scenarios, use the [import messages](/graph/teams-import-messages) flow instead.
21+
> - It is a violation of the [terms of use](/legal/microsoft-apis/terms-of-use) to use Microsoft Teams as a log file. Only send messages that people will read.
2022
<!-- markdownlint-disable MD024 -->
2123
<!-- markdownlint-disable MD022 -->
2224
<!-- markdownlint-disable MD025 -->
@@ -168,8 +170,13 @@ Content-type: application/json
168170

169171
### Example 2: Import messages
170172

173+
The following example shows how to import a message reply. For more information, see [Import messages into Microsoft Teams chats and channels using Microsoft Graph](/graph/teams-import-messages).
174+
171175
> **Note**: The permission scope `Teamwork.Migrate.All` is required for this scenario.
172176
177+
> [!IMPORTANT]
178+
> The **createdDateTime** must be unique down to the millisecond within the target channel. If a message with the same **createdDateTime** exists, the request fails with `409 Conflict`. Adjust the **createdDateTime** and retry. For more information, see [Import messages into Microsoft Teams chats and channels using Microsoft Graph](/graph/teams-import-messages).
179+
173180
#### Request
174181

175182
The following example shows how to import back-in-time messages using the `createDateTime` and `from` keys in the request body.

0 commit comments

Comments
 (0)