Las API de la versión /beta de Microsoft Graph están sujetas a cambios. No se admite el uso de estas API en aplicaciones de producción. Para determinar si una API está disponible en la versión 1.0, use el selector de Versión.
Elija el permiso o los permisos marcados como con privilegios mínimos para esta API. Use un permiso o permisos con privilegios superiores solo si la aplicación lo requiere. Para obtener más información sobre los permisos delegados y de aplicación, consulte Tipos de permisos. Para obtener más información sobre estos permisos, consulte la referencia de permisos.
Tipo de permiso
Permisos con privilegios mínimos
Permisos con privilegios más altos
Delegado (cuenta profesional o educativa)
BookingsAppointment.ReadWrite.All
Bookings. Manage.All, Bookings. ReadWrite.All
Delegado (cuenta personal de Microsoft)
No admitida.
No admitida.
Aplicación
BookingsAppointment.ReadWrite.All
Bookings. Manage.All, Bookings. ReadWrite.All
Solicitud HTTP
POST /solutions/bookingbusinesses/{id}/customers
Encabezados de solicitud
Nombre
Descripción
Autorización
{code} del portador. Necesario.
Cuerpo de la solicitud
En el cuerpo de la solicitud, proporcione una representación JSON de un objeto bookingCustomer .
Respuesta
Si se ejecuta correctamente, este método devuelve un 201 Created código de respuesta y un objeto bookingCustomer en el cuerpo de la respuesta.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
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,
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Solutions.BookingBusinesses["{bookingBusiness-id}"].Customers.PostAsync(requestBody);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// 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.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)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
customers, err := graphClient.Solutions().BookingBusinesses().ByBookingBusinessId("bookingBusiness-id").Customers().Post(context.Background(), requestBody, nil)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
BookingCustomer bookingCustomer = new BookingCustomer();
bookingCustomer.setDisplayName("Joni Sherman");
bookingCustomer.setEmailAddress("jonis@relecloud.com");
LinkedList<PhysicalAddress> addresses = new LinkedList<PhysicalAddress>();
PhysicalAddress physicalAddress = new PhysicalAddress();
physicalAddress.setPostOfficeBox("");
physicalAddress.setStreet("4567 Main Street");
physicalAddress.setCity("Buffalo");
physicalAddress.setState("NY");
physicalAddress.setCountryOrRegion("USA");
physicalAddress.setPostalCode("98052");
physicalAddress.setType(PhysicalAddressType.Home);
addresses.add(physicalAddress);
PhysicalAddress physicalAddress1 = new PhysicalAddress();
physicalAddress1.setPostOfficeBox("");
physicalAddress1.setStreet("4570 Main Street");
physicalAddress1.setCity("Buffalo");
physicalAddress1.setState("NY");
physicalAddress1.setCountryOrRegion("USA");
physicalAddress1.setPostalCode("98054");
physicalAddress1.setType(PhysicalAddressType.Business);
addresses.add(physicalAddress1);
bookingCustomer.setAddresses(addresses);
LinkedList<Phone> phones = new LinkedList<Phone>();
Phone phone = new Phone();
phone.setNumber("206-555-0100");
phone.setType(PhoneType.Home);
phones.add(phone);
Phone phone1 = new Phone();
phone1.setNumber("206-555-0200");
phone1.setType(PhoneType.Business);
phones.add(phone1);
bookingCustomer.setPhones(phones);
BookingCustomer result = graphClient.solutions().bookingBusinesses().byBookingBusinessId("{bookingBusiness-id}").customers().post(bookingCustomer);
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\BookingCustomer;
use Microsoft\Graph\Beta\Generated\Models\PhysicalAddress;
use Microsoft\Graph\Beta\Generated\Models\PhysicalAddressType;
use Microsoft\Graph\Beta\Generated\Models\Phone;
use Microsoft\Graph\Beta\Generated\Models\PhoneType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$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->solutions()->bookingBusinesses()->byBookingBusinessId('bookingBusiness-id')->customers()->post($requestBody)->wait();
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.booking_customer import BookingCustomer
from msgraph_beta.generated.models.physical_address import PhysicalAddress
from msgraph_beta.generated.models.physical_address_type import PhysicalAddressType
from msgraph_beta.generated.models.phone import Phone
from msgraph_beta.generated.models.phone_type import PhoneType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = BookingCustomer(
display_name = "Joni Sherman",
email_address = "jonis@relecloud.com",
addresses = [
PhysicalAddress(
post_office_box = "",
street = "4567 Main Street",
city = "Buffalo",
state = "NY",
country_or_region = "USA",
postal_code = "98052",
type = PhysicalAddressType.Home,
),
PhysicalAddress(
post_office_box = "",
street = "4570 Main Street",
city = "Buffalo",
state = "NY",
country_or_region = "USA",
postal_code = "98054",
type = PhysicalAddressType.Business,
),
],
phones = [
Phone(
number = "206-555-0100",
type = PhoneType.Home,
),
Phone(
number = "206-555-0200",
type = PhoneType.Business,
),
],
)
result = await graph_client.solutions.booking_businesses.by_booking_business_id('bookingBusiness-id').customers.post(request_body)
Importante
Los SDK de Microsoft Graph usan la versión v1.0 de la API de manera predeterminada y no admiten todos los tipos, propiedades y API disponibles en la versión beta. Para obtener más información sobre cómo acceder a la API beta con el SDK, consulte Uso de los SDK de Microsoft Graph con la API beta.