// 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);
// 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);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.work_position import WorkPosition
from msgraph_beta.generated.models.position_detail import PositionDetail
from msgraph_beta.generated.models.company_detail import CompanyDetail
from msgraph_beta.generated.models.physical_address import PhysicalAddress
from msgraph_beta.generated.models.physical_address_type import PhysicalAddressType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
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)