Les API sous la version /beta dans Microsoft Graph sont susceptibles d’être modifiées. L’utilisation de ces API dans des applications de production n’est pas prise en charge. Pour déterminer si une API est disponible dans v1.0, utilisez le sélecteur Version .
Utilisez cette API pour créer un workPosition dans le profil d’un utilisateur.
Dans le corps de la demande, fournissez une représentation JSON de l’objet workPosition .
Le tableau suivant indique les propriétés qu’il est possible de définir lorsque vous créez un objet workPosition dans le profil d’un utilisateur.
Propriété
Type
Description
allowedAudiences
Chaîne
Audiences qui peuvent voir les valeurs contenues dans l’entité. Hérité de itemFacet. Les valeurs possibles sont les suivantes : me, family, contacts, groupMembers, organization, federatedOrganizations, everyone et unknownFutureValue.
categories
String collection
Catégories que l’utilisateur a associées à cette position.
// 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)