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);
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc-beta users profile interests create --user-id {user-id} --body '{\
"categories": [\
"Sports"\
],\
"description": "World's greatest football club",\
"displayName": "Chelsea FC",\
"webUrl": "https://www.chelseafc.com"\
}\
'
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
// 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);
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\PersonInterest;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new PersonInterest();
$requestBody->setCategories(['Sports', ]);
$requestBody->setDescription('World\'s greatest football club');
$requestBody->setDisplayName('Chelsea FC');
$requestBody->setWebUrl('https://www.chelseafc.com');
$result = $graphServiceClient->me()->profile()->interests()->post($requestBody)->wait();
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
Import-Module Microsoft.Graph.Beta.People
$params = @{
categories = @(
"Sports"
)
description = "World's greatest football club"
displayName = "Chelsea FC"
webUrl = "https://www.chelseafc.com"
}
# A UPN can also be used as -UserId.
New-MgBetaUserProfileInterest -UserId $userId -BodyParameter $params
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
from msgraph import GraphServiceClient
from msgraph.generated.models.person_interest import PersonInterest
graph_client = GraphServiceClient(credentials, scopes)
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)
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。