POST https://graph.microsoft.com/beta/me/profile/interests
Content-type: application/json
{
"categories": [
"Sports"
],
"description": "World's greatest football club",
"displayName": "Chelsea FC",
"webUrl": "https://www.chelseafc.com"
}
// 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",
},
Description = "World's greatest football club",
DisplayName = "Chelsea FC",
WebUrl = "https://www.chelseafc.com",
};
// 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.PostAsync(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)
description := "World's greatest football club"
requestBody.SetDescription(&description)
displayName := "Chelsea FC"
requestBody.SetDisplayName(&displayName)
webUrl := "https://www.chelseafc.com"
requestBody.SetWebUrl(&webUrl)
// 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().Post(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.setDescription("World's greatest football club");
personInterest.setDisplayName("Chelsea FC");
personInterest.setWebUrl("https://www.chelseafc.com");
PersonInterest result = graphClient.me().profile().interests().post(personInterest);
# 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",
],
description = "World's greatest football club",
display_name = "Chelsea FC",
web_url = "https://www.chelseafc.com",
)
result = await graph_client.me.profile.interests.post(request_body)