// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Chats.Item.MarkChatUnreadForUser;
using Microsoft.Graph.Models;
var requestBody = new MarkChatUnreadForUserPostRequestBody
{
User = new TeamworkUserIdentity
{
Id = "d864e79f-a516-4d0f-9fee-0eeb4d61fdc2",
AdditionalData = new Dictionary<string, object>
{
{
"tenantId" , "2a690434-97d9-4eed-83a6-f5f13600199a"
},
},
},
LastMessageReadDateTime = DateTimeOffset.Parse("2021-05-27T22:13:01.577Z"),
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Chats["{chat-id}"].MarkChatUnreadForUser.PostAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc chats mark-chat-unread-for-user post --chat-id {chat-id} --body '{\
"user": {\
"id" : "d864e79f-a516-4d0f-9fee-0eeb4d61fdc2",\
"tenantId": "2a690434-97d9-4eed-83a6-f5f13600199a"\
},\
"lastMessageReadDateTime": "2021-05-27T22:13:01.577Z"\
}\
'
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.chats.item.markchatunreadforuser.MarkChatUnreadForUserPostRequestBody markChatUnreadForUserPostRequestBody = new com.microsoft.graph.chats.item.markchatunreadforuser.MarkChatUnreadForUserPostRequestBody();
TeamworkUserIdentity user = new TeamworkUserIdentity();
user.setId("d864e79f-a516-4d0f-9fee-0eeb4d61fdc2");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("tenantId", "2a690434-97d9-4eed-83a6-f5f13600199a");
user.setAdditionalData(additionalData);
markChatUnreadForUserPostRequestBody.setUser(user);
OffsetDateTime lastMessageReadDateTime = OffsetDateTime.parse("2021-05-27T22:13:01.577Z");
markChatUnreadForUserPostRequestBody.setLastMessageReadDateTime(lastMessageReadDateTime);
graphClient.chats().byChatId("{chat-id}").markChatUnreadForUser().post(markChatUnreadForUserPostRequestBody);
Bientôt disponible : tout au long de 2024, nous allons éliminer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d'informations, consultez : https://aka.ms/ContentUserFeedback.