APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new BookingCustomer
{
DisplayName = "Joni Sherman",
EmailAddress = "jonis@relecloud.com",
Addresses = new List<PhysicalAddress>
{
new PhysicalAddress
{
PostOfficeBox = "",
Street = "4567 Main Street",
City = "Buffalo",
State = "NY",
CountryOrRegion = "USA",
PostalCode = "98052",
Type = PhysicalAddressType.Home,
},
new PhysicalAddress
{
PostOfficeBox = "",
Street = "4570 Main Street",
City = "Buffalo",
State = "NY",
CountryOrRegion = "USA",
PostalCode = "98054",
Type = PhysicalAddressType.Business,
},
},
Phones = new List<Phone>
{
new Phone
{
Number = "206-555-0100",
Type = PhoneType.Home,
},
new Phone
{
Number = "206-555-0200",
Type = PhoneType.Business,
},
},
};
var result = await graphClient.BookingBusinesses["{bookingBusiness-id}"].Customers.PostAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
graphClient, err := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewBookingCustomer()
displayName := "Joni Sherman"
requestBody.SetDisplayName(&displayName)
emailAddress := "jonis@relecloud.com"
requestBody.SetEmailAddress(&emailAddress)
physicalAddress := graphmodels.NewPhysicalAddress()
postOfficeBox := ""
physicalAddress.SetPostOfficeBox(&postOfficeBox)
street := "4567 Main Street"
physicalAddress.SetStreet(&street)
city := "Buffalo"
physicalAddress.SetCity(&city)
state := "NY"
physicalAddress.SetState(&state)
countryOrRegion := "USA"
physicalAddress.SetCountryOrRegion(&countryOrRegion)
postalCode := "98052"
physicalAddress.SetPostalCode(&postalCode)
type := graphmodels.HOME_PHYSICALADDRESSTYPE
physicalAddress.SetType(&type)
physicalAddress1 := graphmodels.NewPhysicalAddress()
postOfficeBox := ""
physicalAddress1.SetPostOfficeBox(&postOfficeBox)
street := "4570 Main Street"
physicalAddress1.SetStreet(&street)
city := "Buffalo"
physicalAddress1.SetCity(&city)
state := "NY"
physicalAddress1.SetState(&state)
countryOrRegion := "USA"
physicalAddress1.SetCountryOrRegion(&countryOrRegion)
postalCode := "98054"
physicalAddress1.SetPostalCode(&postalCode)
type := graphmodels.BUSINESS_PHYSICALADDRESSTYPE
physicalAddress1.SetType(&type)
addresses := []graphmodels.PhysicalAddressable {
physicalAddress,
physicalAddress1,
}
requestBody.SetAddresses(addresses)
phone := graphmodels.NewPhone()
number := "206-555-0100"
phone.SetNumber(&number)
type := graphmodels.HOME_PHONETYPE
phone.SetType(&type)
phone1 := graphmodels.NewPhone()
number := "206-555-0200"
phone1.SetNumber(&number)
type := graphmodels.BUSINESS_PHONETYPE
phone1.SetType(&type)
phones := []graphmodels.Phoneable {
phone,
phone1,
}
requestBody.SetPhones(phones)
result, err := graphClient.BookingBusinesses().ByBookingBusinesseId("bookingBusiness-id").Customers().Post(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Import-Module Microsoft.Graph.Bookings
$params = @{
displayName = "Joni Sherman"
emailAddress = "jonis@relecloud.com"
addresses = @(
@{
postOfficeBox = ""
street = "4567 Main Street"
city = "Buffalo"
state = "NY"
countryOrRegion = "USA"
postalCode = "98052"
type = "home"
}
@{
postOfficeBox = ""
street = "4570 Main Street"
city = "Buffalo"
state = "NY"
countryOrRegion = "USA"
postalCode = "98054"
type = "business"
}
)
phones = @(
@{
number = "206-555-0100"
type = "home"
}
@{
number = "206-555-0200"
type = "business"
}
)
}
New-MgBookingBusinessCustomer -BookingBusinessId $bookingBusinessId -BodyParameter $params
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new BookingCustomer();
$requestBody->setDisplayName('Joni Sherman');
$requestBody->setEmailAddress('jonis@relecloud.com');
$addressesPhysicalAddress1 = new PhysicalAddress();
$addressesPhysicalAddress1->setPostOfficeBox('');
$addressesPhysicalAddress1->setStreet('4567 Main Street');
$addressesPhysicalAddress1->setCity('Buffalo');
$addressesPhysicalAddress1->setState('NY');
$addressesPhysicalAddress1->setCountryOrRegion('USA');
$addressesPhysicalAddress1->setPostalCode('98052');
$addressesPhysicalAddress1->setType(new PhysicalAddressType('home'));
$addressesArray []= $addressesPhysicalAddress1;
$addressesPhysicalAddress2 = new PhysicalAddress();
$addressesPhysicalAddress2->setPostOfficeBox('');
$addressesPhysicalAddress2->setStreet('4570 Main Street');
$addressesPhysicalAddress2->setCity('Buffalo');
$addressesPhysicalAddress2->setState('NY');
$addressesPhysicalAddress2->setCountryOrRegion('USA');
$addressesPhysicalAddress2->setPostalCode('98054');
$addressesPhysicalAddress2->setType(new PhysicalAddressType('business'));
$addressesArray []= $addressesPhysicalAddress2;
$requestBody->setAddresses($addressesArray);
$phonesPhone1 = new Phone();
$phonesPhone1->setNumber('206-555-0100');
$phonesPhone1->setType(new PhoneType('home'));
$phonesArray []= $phonesPhone1;
$phonesPhone2 = new Phone();
$phonesPhone2->setNumber('206-555-0200');
$phonesPhone2->setType(new PhoneType('business'));
$phonesArray []= $phonesPhone2;
$requestBody->setPhones($phonesArray);
$result = $graphServiceClient->bookingBusinesses()->byBookingBusinesseId('bookingBusiness-id')->customers()->post($requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.