// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new PendingExternalUserProfile
{
PhoneNumber = "+15555555555",
DisplayName = "Bob Henry",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Directory.PendingExternalUserProfiles.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.NewPendingExternalUserProfile()
phoneNumber := "+15555555555"
requestBody.SetPhoneNumber(&phoneNumber)
displayName := "Bob Henry"
requestBody.SetDisplayName(&displayName)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
pendingExternalUserProfiles, err := graphClient.Directory().PendingExternalUserProfiles().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
PendingExternalUserProfile pendingExternalUserProfile = new PendingExternalUserProfile();
pendingExternalUserProfile.setPhoneNumber("+15555555555");
pendingExternalUserProfile.setDisplayName("Bob Henry");
PendingExternalUserProfile result = graphClient.directory().pendingExternalUserProfiles().post(pendingExternalUserProfile);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\PendingExternalUserProfile;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new PendingExternalUserProfile();
$requestBody->setPhoneNumber('+15555555555');
$requestBody->setDisplayName('Bob Henry');
$result = $graphServiceClient->directory()->pendingExternalUserProfiles()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.pending_external_user_profile import PendingExternalUserProfile
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = PendingExternalUserProfile(
phone_number = "+15555555555",
display_name = "Bob Henry",
)
result = await graph_client.directory.pending_external_user_profiles.post(request_body)