// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new OutlookCategory
{
Color = CategoryColor.Preset15,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.Outlook.MasterCategories["{outlookCategory-id}"].PatchAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc users outlook master-categories patch --user-id {user-id} --outlook-category-id {outlookCategory-id} --body '{\
"color":"preset15"\
}\
'
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
OutlookCategory outlookCategory = new OutlookCategory();
outlookCategory.setColor(CategoryColor.Preset15);
OutlookCategory result = graphClient.me().outlook().masterCategories().byOutlookCategoryId("{outlookCategory-id}").patch(outlookCategory);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\OutlookCategory;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new OutlookCategory();
$requestBody->setColor(new CategoryColor('preset15'));
$result = $graphServiceClient->me()->outlook()->masterCategories()->byOutlookCategoryId('outlookCategory-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Users
$params = @{
color = "preset15"
}
# A UPN can also be used as -UserId.
Update-MgUserOutlookMasterCategory -UserId $userId -OutlookCategoryId $outlookCategoryId -BodyParameter $params