chat: unhideForUser
Article
02/18/2023
2 minutes to read
2 contributors
Feedback
In this article
Namespace: microsoft.graph
Unhide a chat for a user.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions .
Permission type
Permissions (from least to most privileged)
Delegated (work or school account)
Chat.ReadWrite
Delegated (personal Microsoft account)
Not supported.
Application
Not supported.
HTTP request
POST /chats/{chatsId}/unhideForUser
Name
Description
Authorization
Bearer {token}. Required.
Content-Type
application/json. Required.
Request body
In the request body, supply a JSON representation of the parameters.
The following table shows the parameters that can be used with this action.
Parameter
Type
Description
user
teamworkUserIdentity
User to unhide the chat for. In delegated mode, users can only unhide a chat for themselves .
Response
If successful, this action returns a 204 No Content
response code.
Examples
Request
POST https://graph.microsoft.com/v1.0/chats/19:7d898072-792c-4006-bb10-5ca9f2590649_8ea0e38b-efb3-4757-924a-5f94061cf8c2@unq.gbl.spaces/unhideForUser
Content-Type: application/json
{
"user": {
"id" : "d864e79f-a516-4d0f-9fee-0eeb4d61fdc2",
"tenantId": "2a690434-97d9-4eed-83a6-f5f13600199a"
}
}
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Chats.Item.UnhideForUser.UnhideForUserPostRequestBody
{
User = new TeamworkUserIdentity
{
Id = "d864e79f-a516-4d0f-9fee-0eeb4d61fdc2",
AdditionalData = new Dictionary<string, object>
{
{
"tenantId" , "2a690434-97d9-4eed-83a6-f5f13600199a"
},
},
},
};
await graphClient.Chats["{chat-id}"].UnhideForUser.PostAsync(requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
const options = {
authProvider,
};
const client = Client.init(options);
const unhideForUser = {
user: {
id: 'd864e79f-a516-4d0f-9fee-0eeb4d61fdc2',
tenantId: '2a690434-97d9-4eed-83a6-f5f13600199a'
}
};
await client.api('/chats/19:7d898072-792c-4006-bb10-5ca9f2590649_8ea0e38b-efb3-4757-924a-5f94061cf8c2@unq.gbl.spaces/unhideForUser')
.post(unhideForUser);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/Chats/Item/UnhideForUser"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewUnhideForUserPostRequestBody()
user := graphmodels.NewTeamworkUserIdentity()
id := "d864e79f-a516-4d0f-9fee-0eeb4d61fdc2"
user.SetId(&id)
additionalData := map[string]interface{}{
"tenantId" : "2a690434-97d9-4eed-83a6-f5f13600199a",
}
user.SetAdditionalData(additionalData)
requestBody.SetUser(user)
graphClient.ChatsById("chat-id").UnhideForUser().Post(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Import-Module Microsoft.Graph.Teams
$params = @{
User = @{
Id = "d864e79f-a516-4d0f-9fee-0eeb4d61fdc2"
TenantId = "2a690434-97d9-4eed-83a6-f5f13600199a"
}
}
Invoke-MgGraphChat -ChatId $chatId -BodyParameter $params
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new UnhideForUserPostRequestBody();
$user = new TeamworkUserIdentity();
$user->setId('d864e79f-a516-4d0f-9fee-0eeb4d61fdc2');
$additionalData = [
'tenantId' => '2a690434-97d9-4eed-83a6-f5f13600199a',
];
$user->setAdditionalData($additionalData);
$requestBody->setUser($user);
$graphServiceClient->chatsById('chat-id')->unhideForUser()->post($requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
HTTP/1.1 204 No Content