名前空間: microsoft.graph
グループ チャットおよびチャネルで特定のユーザーに送信された すべてのターゲット メッセージを 取得します。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス | 米国政府機関 L4 | 米国政府機関 L5 (DOD) | 21Vianet が運営する中国 |
|---|---|---|---|
| ✅ | ❌ | ❌ | ❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。 アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 | 最小特権アクセス許可 | より高い特権のアクセス許可 |
|---|---|---|
| 委任 (職場または学校のアカウント) | サポートされていません。 | サポートされていません。 |
| 委任 (個人用 Microsoft アカウント) | サポートされていません。 | サポートされていません。 |
| アプリケーション | TeamworkTargetedMessage.Read.All | 注意事項なし。 |
HTTP 要求
GET /users/{user-id | userPrincipalName}/teamwork/getAllTargetedMessages
オプションのクエリ パラメーター
このメソッドでは、応答をカスタマイズするために次の OData クエリ パラメーターがサポートされています。 一般的な情報については、「OData クエリ パラメーター」を参照してください。
| 名前 | 説明 |
|---|---|
| $filter | $filter クエリ パラメーターは、日付範囲パラメーターを使用した lastModifiedDateTime プロパティの日付と時刻の範囲のクエリをサポートします。 |
| $top | $top クエリ パラメーターを使用して、応答あたりの項目数を制御します。 |
サポートされている$filter演算子
次のフィルター式がサポートされています。
-
lastModifiedDateTime gt {datetime}- 指定した日時以降に変更されたメッセージを返します。 -
lastModifiedDateTime lt {datetime}- 指定された日時より前に変更されたメッセージを返します。 -
from/application/id eq '{id}'- 特定のアプリケーション ID によって送信されたメッセージを返します。
and演算子を使用して複数のフィルター式を組み合わせることができます。 例:
GET /users/{user-id | userPrincipalName}/teamwork/getAllTargetedMessages?$filter=lastModifiedDateTime gt 2024-01-01T00:00:00Z and lastModifiedDateTime lt 2024-12-31T23:59:59Z
要求ヘッダー
| 名前 | 説明 |
|---|---|
| Authorization | ベアラー {token}。 必須です。 認証と認可についての詳細をご覧ください。 |
要求本文
このメソッドには、要求本文を指定しません。
応答
成功した場合、この関数は応答本文で 200 OK 応答コードと targetedChatMessage オブジェクトのコレクションを返します。
応答には、ページネーション用の @odata.nextLink プロパティとデルタ追跡用の @odata.deltaLink プロパティ (該当する場合) が含まれます。
例
例 1: ユーザーのすべてのターゲット メッセージを取得する
次の例は、ユーザーのすべてのターゲット メッセージを取得する方法を示しています。
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/v1.0/users/f47b5f54-6968-4706-a522-31e842b12345/teamwork/getAllTargetedMessages
応答
次の例は、チャットとチャネル コンテキストを対象としたメッセージの両方を含む応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(targetedChatMessage)",
"@odata.count": 2,
"@odata.nextLink": "https://graph.microsoft.com/v1.0/users/f47b5f54-6968-4706-a522-31e842b12345/teamwork/getAllTargetedMessages?$top=2&$skiptoken=U2tpcFZhbHVlPTIjTWFpbGJveEZvbGRlcj1NYWlsRm9sZGVycy9UZWFtc01lc3NhZ2VzRGF0YQ",
"value": [
{
"id": "1580849738240",
"@odata.type": "#microsoft.graph.targetedChatMessage",
"replyToId": null,
"etag": "1580849738240",
"chatId": "19:eeaa4e946d674c4f8d4dded613780f45@thread.v2",
"channelIdentity": null,
"messageType": "message",
"createdDateTime": "2020-02-04T20:55:38.24Z",
"lastModifiedDateTime": null,
"deletedDateTime": null,
"subject": null,
"summary": null,
"importance": "normal",
"locale": "en-us",
"webUrl": null,
"policyViolation": null,
"from": {
"device": null,
"user": null,
"application": {
"@odata.type": "#microsoft.graph.teamworkApplicationIdentity",
"id": "6d23e712-527b-406f-8d59-d02927885918",
"displayName": "Breakthru",
"applicationIdentityType": "bot"
}
},
"body": {
"contentType": "text",
"content": "hello"
},
"attachments": [],
"mentions": [],
"reactions": [],
"recipient": {
"@odata.type": "#microsoft.graph.identity",
"id": "1273a016-201d-4f95-8083-1b7f99b3edeb",
"displayName": "Adele Vance"
}
},
{
"id": "1580849738241",
"@odata.type": "#microsoft.graph.targetedChatMessage",
"replyToId": null,
"etag": "1580849738241",
"chatId": null,
"channelIdentity": {
"channelId": "19:eeaa4e946d674c4f8d4dded613780f45@thread.v2",
"teamId": "3Aeeaa4e946d674c4f8d4dded613780f45@thread.v2"
},
"messageType": "message",
"createdDateTime": "2020-02-04T20:55:38.24Z",
"lastModifiedDateTime": null,
"deletedDateTime": null,
"subject": null,
"summary": null,
"importance": "normal",
"locale": "en-us",
"webUrl": null,
"policyViolation": null,
"from": {
"device": null,
"user": null,
"application": {
"@odata.type": "#microsoft.graph.teamworkApplicationIdentity",
"id": "6d23e712-527b-406f-8d59-d02927885918",
"displayName": "Breakthru",
"applicationIdentityType": "bot"
}
},
"body": {
"contentType": "text",
"content": "hello"
},
"attachments": [],
"mentions": [],
"reactions": [],
"recipient": {
"@odata.type": "#microsoft.graph.identity",
"id": "1273a016-201d-4f95-8083-1b7f99b3edeb",
"displayName": "Adele Vance"
}
}
]
}
例 2:対象のメッセージを日付範囲でフィルター処理する
次の例は、特定の日付範囲内のターゲット メッセージを取得する方法を示しています。
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/v1.0/users/f47b5f54-6968-4706-a522-31e842b12345/teamwork/getAllTargetedMessages?$filter=lastModifiedDateTime gt 2024-01-01T00:00:00Z and lastModifiedDateTime lt 2024-12-31T23:59:59Z
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(targetedChatMessage)",
"@odata.count": 1,
"value": [
{
"id": "1704067200000",
"@odata.type": "#microsoft.graph.targetedChatMessage",
"replyToId": null,
"etag": "1704067200000",
"chatId": "19:eeaa4e946d674c4f8d4dded613780f45@thread.v2",
"channelIdentity": null,
"messageType": "message",
"createdDateTime": "2024-01-01T00:00:00Z",
"lastModifiedDateTime": "2024-01-01T00:00:00Z",
"deletedDateTime": null,
"subject": null,
"summary": null,
"importance": "normal",
"locale": "en-us",
"webUrl": null,
"policyViolation": null,
"from": {
"device": null,
"user": null,
"application": {
"@odata.type": "#microsoft.graph.teamworkApplicationIdentity",
"id": "6d23e712-527b-406f-8d59-d02927885918",
"displayName": "Breakthru",
"applicationIdentityType": "bot"
}
},
"body": {
"contentType": "text",
"content": "Filtered message content"
},
"attachments": [],
"mentions": [],
"reactions": [],
"recipient": {
"@odata.type": "#microsoft.graph.identity",
"id": "1273a016-201d-4f95-8083-1b7f99b3edeb",
"displayName": "Adele Vance"
}
}
]
}
例 3: アプリケーションの送信者別にターゲット メッセージを取得する
次の例では、特定のアプリケーションによって送信されたターゲット メッセージを取得します。
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/v1.0/users/f47b5f54-6968-4706-a522-31e842b12345/teamwork/getAllTargetedMessages?$filter=from/application/id eq '6d23e712-527b-406f-8d59-d02927885918'
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(targetedChatMessage)",
"@odata.count": 1,
"value": [
{
"@odata.type": "#microsoft.graph.targetedChatMessage",
"id": "1580849738240",
"replyToId": null,
"etag": "1580849738240",
"chatId": "19:eeaa4e946d674c4f8d4dded613780f45@thread.v2",
"channelIdentity": null,
"messageType": "message",
"createdDateTime": "2020-02-04T20:55:38.24Z",
"lastModifiedDateTime": "2020-02-04T20:55:38.24Z",
"deletedDateTime": null,
"subject": null,
"summary": null,
"importance": "normal",
"locale": "en-us",
"webUrl": null,
"policyViolation": null,
"from": {
"device": null,
"user": null,
"application": {
"@odata.type": "#microsoft.graph.teamworkApplicationIdentity",
"id": "6d23e712-527b-406f-8d59-d02927885918",
"displayName": "Breakthru",
"applicationIdentityType": "bot"
}
},
"body": {
"contentType": "text",
"content": "hello"
},
"attachments": [],
"mentions": [],
"reactions": [],
"recipient": {
"@odata.type": "#microsoft.graph.identity",
"id": "1273a016-201d-4f95-8083-1b7f99b3edeb",
"displayName": "Adele Vance"
}
}
]
}