名前空間: microsoft.graph
ユーザーの チャット へのアクセスを削除します。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
✅ |
✅ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
Chat.ReadWrite.All |
注意事項なし。 |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
サポートされていません。 |
サポートされていません。 |
HTTP 要求
POST /chats/{chatsId}/removeAllAccessForUser
| 名前 |
説明 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
| Content-Type |
application/json. 必須です。 |
要求本文
要求本文で、次のパラメーターを含む JSON オブジェクトを指定します。
応答
成功した場合、このアクションは 204 No Content 応答コードを返します。
例
要求
次の例は要求を示しています。
POST https://graph.microsoft.com/v1.0/chats/{chatsId}/removeAllAccessForUser
Content-Type: application/json
{
"user": {
"@odata.type": "microsoft.graph.teamworkUserIdentity",
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"tenantId": "a1b2c3d4-e5f6-7890-1234-567890abcdef"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Chats.Item.RemoveAllAccessForUser;
using Microsoft.Graph.Models;
var requestBody = new RemoveAllAccessForUserPostRequestBody
{
User = new TeamworkUserIdentity
{
OdataType = "microsoft.graph.teamworkUserIdentity",
Id = "f47ac10b-58cc-4372-a567-0e02b2c3d479",
AdditionalData = new Dictionary<string, object>
{
{
"tenantId" , "a1b2c3d4-e5f6-7890-1234-567890abcdef"
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Chats["{chat-id}"].RemoveAllAccessForUser.PostAsync(requestBody);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphchats "github.com/microsoftgraph/msgraph-sdk-go/chats"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphchats.NewRemoveAllAccessForUserPostRequestBody()
user := graphmodels.NewTeamworkUserIdentity()
id := "f47ac10b-58cc-4372-a567-0e02b2c3d479"
user.SetId(&id)
additionalData := map[string]interface{}{
"tenantId" : "a1b2c3d4-e5f6-7890-1234-567890abcdef",
}
user.SetAdditionalData(additionalData)
requestBody.SetUser(user)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Chats().ByChatId("chat-id").RemoveAllAccessForUser().Post(context.Background(), requestBody, nil)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.chats.item.removeallaccessforuser.RemoveAllAccessForUserPostRequestBody removeAllAccessForUserPostRequestBody = new com.microsoft.graph.chats.item.removeallaccessforuser.RemoveAllAccessForUserPostRequestBody();
TeamworkUserIdentity user = new TeamworkUserIdentity();
user.setOdataType("microsoft.graph.teamworkUserIdentity");
user.setId("f47ac10b-58cc-4372-a567-0e02b2c3d479");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("tenantId", "a1b2c3d4-e5f6-7890-1234-567890abcdef");
user.setAdditionalData(additionalData);
removeAllAccessForUserPostRequestBody.setUser(user);
graphClient.chats().byChatId("{chat-id}").removeAllAccessForUser().post(removeAllAccessForUserPostRequestBody);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const removeAllAccessForUser = {
user: {
'@odata.type': 'microsoft.graph.teamworkUserIdentity',
id: 'f47ac10b-58cc-4372-a567-0e02b2c3d479',
tenantId: 'a1b2c3d4-e5f6-7890-1234-567890abcdef'
}
};
await client.api('/chats/{chatsId}/removeAllAccessForUser')
.post(removeAllAccessForUser);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Chats\Item\RemoveAllAccessForUser\RemoveAllAccessForUserPostRequestBody;
use Microsoft\Graph\Generated\Models\TeamworkUserIdentity;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new RemoveAllAccessForUserPostRequestBody();
$user = new TeamworkUserIdentity();
$user->setOdataType('microsoft.graph.teamworkUserIdentity');
$user->setId('f47ac10b-58cc-4372-a567-0e02b2c3d479');
$additionalData = [
'tenantId' => 'a1b2c3d4-e5f6-7890-1234-567890abcdef',
];
$user->setAdditionalData($additionalData);
$requestBody->setUser($user);
$graphServiceClient->chats()->byChatId('chat-id')->removeAllAccessForUser()->post($requestBody)->wait();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
Import-Module Microsoft.Graph.Teams
$params = @{
user = @{
"@odata.type" = "microsoft.graph.teamworkUserIdentity"
id = "f47ac10b-58cc-4372-a567-0e02b2c3d479"
tenantId = "a1b2c3d4-e5f6-7890-1234-567890abcdef"
}
}
Remove-MgChatAccessForUser -ChatId $chatId -BodyParameter $params
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.chats.item.remove_all_access_for_user.remove_all_access_for_user_post_request_body import RemoveAllAccessForUserPostRequestBody
from msgraph.generated.models.teamwork_user_identity import TeamworkUserIdentity
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = RemoveAllAccessForUserPostRequestBody(
user = TeamworkUserIdentity(
odata_type = "microsoft.graph.teamworkUserIdentity",
id = "f47ac10b-58cc-4372-a567-0e02b2c3d479",
additional_data = {
"tenant_id" : "a1b2c3d4-e5f6-7890-1234-567890abcdef",
}
),
)
await graph_client.chats.by_chat_id('chat-id').remove_all_access_for_user.post(request_body)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
次の例は応答を示しています。
HTTP/1.1 204 No Content