// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new WorkPosition
{
Detail = new PositionDetail
{
Company = new CompanyDetail
{
DisplayName = "Adventureworks Ltd.",
Department = "Consulting",
OfficeLocation = "AW23/344",
Address = new PhysicalAddress
{
Type = PhysicalAddressType.Business,
Street = "123 Patriachy Ponds",
City = "Moscow",
CountryOrRegion = "Russian Federation",
PostalCode = "RU-34621",
},
WebUrl = "https://www.adventureworks.com",
},
JobTitle = "Senior Product Branding Manager II",
Role = "consulting",
},
IsCurrent = true,
};
// 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.Positions.PostAsync(requestBody);
重要
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 を使用する」を参照してください。
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);
WorkPosition workPosition = new WorkPosition();
PositionDetail detail = new PositionDetail();
CompanyDetail company = new CompanyDetail();
company.setDisplayName("Adventureworks Ltd.");
company.setDepartment("Consulting");
company.setOfficeLocation("AW23/344");
PhysicalAddress address = new PhysicalAddress();
address.setType(PhysicalAddressType.Business);
address.setStreet("123 Patriachy Ponds");
address.setCity("Moscow");
address.setCountryOrRegion("Russian Federation");
address.setPostalCode("RU-34621");
company.setAddress(address);
company.setWebUrl("https://www.adventureworks.com");
detail.setCompany(company);
detail.setJobTitle("Senior Product Branding Manager II");
detail.setRole("consulting");
workPosition.setDetail(detail);
workPosition.setIsCurrent(true);
WorkPosition result = graphClient.me().profile().positions().post(workPosition);
重要
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\WorkPosition;
use Microsoft\Graph\Generated\Models\PositionDetail;
use Microsoft\Graph\Generated\Models\CompanyDetail;
use Microsoft\Graph\Generated\Models\PhysicalAddress;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new WorkPosition();
$detail = new PositionDetail();
$detailCompany = new CompanyDetail();
$detailCompany->setDisplayName('Adventureworks Ltd.');
$detailCompany->setDepartment('Consulting');
$detailCompany->setOfficeLocation('AW23/344');
$detailCompanyAddress = new PhysicalAddress();
$detailCompanyAddress->setType(new PhysicalAddressType('business'));
$detailCompanyAddress->setStreet('123 Patriachy Ponds');
$detailCompanyAddress->setCity('Moscow');
$detailCompanyAddress->setCountryOrRegion('Russian Federation');
$detailCompanyAddress->setPostalCode('RU-34621');
$detailCompany->setAddress($detailCompanyAddress);
$detailCompany->setWebUrl('https://www.adventureworks.com');
$detail->setCompany($detailCompany);
$detail->setJobTitle('Senior Product Branding Manager II');
$detail->setRole('consulting');
$requestBody->setDetail($detail);
$requestBody->setIsCurrent(true);
$result = $graphServiceClient->me()->profile()->positions()->post($requestBody)->wait();
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
Import-Module Microsoft.Graph.Beta.People
$params = @{
detail = @{
company = @{
displayName = "Adventureworks Ltd."
department = "Consulting"
officeLocation = "AW23/344"
address = @{
type = "business"
street = "123 Patriachy Ponds"
city = "Moscow"
countryOrRegion = "Russian Federation"
postalCode = "RU-34621"
}
webUrl = "https://www.adventureworks.com"
}
jobTitle = "Senior Product Branding Manager II"
role = "consulting"
}
isCurrent = $true
}
# A UPN can also be used as -UserId.
New-MgBetaUserProfilePosition -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.work_position import WorkPosition
from msgraph.generated.models.position_detail import PositionDetail
from msgraph.generated.models.company_detail import CompanyDetail
from msgraph.generated.models.physical_address import PhysicalAddress
graph_client = GraphServiceClient(credentials, scopes)
request_body = WorkPosition(
detail = PositionDetail(
company = CompanyDetail(
display_name = "Adventureworks Ltd.",
department = "Consulting",
office_location = "AW23/344",
address = PhysicalAddress(
type = PhysicalAddressType.Business,
street = "123 Patriachy Ponds",
city = "Moscow",
country_or_region = "Russian Federation",
postal_code = "RU-34621",
),
web_url = "https://www.adventureworks.com",
),
job_title = "Senior Product Branding Manager II",
role = "consulting",
),
is_current = True,
)
result = await graph_client.me.profile.positions.post(request_body)
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。