// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new PersonInterest
{
Categories = new List<string>
{
"Sports",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.Profile.Interests["{personInterest-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewPersonInterest()
categories := []string {
"Sports",
}
requestBody.SetCategories(categories)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
interests, err := graphClient.Me().Profile().Interests().ByPersonInterestId("personInterest-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
PersonInterest personInterest = new PersonInterest();
LinkedList<String> categories = new LinkedList<String>();
categories.add("Sports");
personInterest.setCategories(categories);
PersonInterest result = graphClient.me().profile().interests().byPersonInterestId("{personInterest-id}").patch(personInterest);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\PersonInterest;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new PersonInterest();
$requestBody->setCategories(['Sports', ]);
$result = $graphServiceClient->me()->profile()->interests()->byPersonInterestId('personInterest-id')->patch($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.People
$params = @{
categories = @(
"Sports"
)
}
# A UPN can also be used as -UserId.
Update-MgBetaUserProfileInterest -UserId $userId -PersonInterestId $personInterestId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.person_interest import PersonInterest
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = PersonInterest(
categories = [
"Sports",
],
)
result = await graph_client.me.profile.interests.by_person_interest_id('personInterest-id').patch(request_body)