Namespace: microsoft.graph
Important
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.
Update the properties of a bookingBusiness object.
This API is available in the following national cloud deployments.
Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
✅ |
✅ |
✅ |
❌ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type |
Least privileged permissions |
Higher privileged permissions |
Delegated (work or school account) |
Bookings.ReadWrite.All |
Bookings.Manage.All |
Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
Application |
Bookings.ReadWrite.All |
Bookings.Manage.All |
HTTP request
PATCH /solutions/bookingbusinesses/{id}
Request body
In the request body, supply the values for relevant fields that should be updated. Existing properties that aren't included in the request body maintains their previous values or are recalculated based on changes to other property values. For best performance, you shouldn't include existing values that haven't changed.
Property |
Type |
Description |
address |
physicalAddress |
The street address of the business. |
businessHours |
bookingWorkHours collection |
The hours of operation for the business. |
businessType |
String |
The type of business. |
defaultCurrencyIso |
String |
The code for the currency that the business operates in on Microsoft Bookings. |
displayName |
String |
A name for the business that interfaces with customers. |
email |
String |
The email address for the business. |
languageTag |
String |
The language of the self service booking page. |
phone |
String |
The telephone number for the business. |
schedulingPolicy |
bookingSchedulingPolicy |
Specifies how bookings can be created for this business. |
webSiteUrl |
String |
The URL of the business web site. |
Response
If successful, this method returns a 204, No Content
response code. It doesn't return anything in the response body.
Example
Request
The following example updates the business email address and scheduling policy, to change the business default booking time slot to an hour, and advance booking up to 30 days.
PATCH https://graph.microsoft.com/beta/solutions/bookingbusinesses/fabrikam@contoso.com
Content-type: application/json
{
"email": "admin@fabrikam.com",
"schedulingPolicy": {
"timeSlotInterval": "PT60M",
"minimumLeadTime": "P1D",
"maximumAdvance": "P30D",
"sendConfirmationsToOwner": true,
"allowStaffSelection": true
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new BookingBusiness
{
Email = "admin@fabrikam.com",
SchedulingPolicy = new BookingSchedulingPolicy
{
TimeSlotInterval = TimeSpan.Parse("PT60M"),
MinimumLeadTime = TimeSpan.Parse("P1D"),
MaximumAdvance = TimeSpan.Parse("P30D"),
SendConfirmationsToOwner = true,
AllowStaffSelection = true,
},
};
// 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}"].PatchAsync(requestBody);
mgc-beta solutions booking-businesses patch --booking-business-id {bookingBusiness-id} --body '{\
"email": "admin@fabrikam.com",\
"schedulingPolicy": {\
"timeSlotInterval": "PT60M",\
"minimumLeadTime": "P1D",\
"maximumAdvance": "P30D",\
"sendConfirmationsToOwner": true,\
"allowStaffSelection": true\
}\
}\
'
// 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.NewBookingBusiness()
email := "admin@fabrikam.com"
requestBody.SetEmail(&email)
schedulingPolicy := graphmodels.NewBookingSchedulingPolicy()
timeSlotInterval , err := abstractions.ParseISODuration("PT60M")
schedulingPolicy.SetTimeSlotInterval(&timeSlotInterval)
minimumLeadTime , err := abstractions.ParseISODuration("P1D")
schedulingPolicy.SetMinimumLeadTime(&minimumLeadTime)
maximumAdvance , err := abstractions.ParseISODuration("P30D")
schedulingPolicy.SetMaximumAdvance(&maximumAdvance)
sendConfirmationsToOwner := true
schedulingPolicy.SetSendConfirmationsToOwner(&sendConfirmationsToOwner)
allowStaffSelection := true
schedulingPolicy.SetAllowStaffSelection(&allowStaffSelection)
requestBody.SetSchedulingPolicy(schedulingPolicy)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
bookingBusinesses, err := graphClient.Solutions().BookingBusinesses().ByBookingBusinessId("bookingBusiness-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
BookingBusiness bookingBusiness = new BookingBusiness();
bookingBusiness.setEmail("admin@fabrikam.com");
BookingSchedulingPolicy schedulingPolicy = new BookingSchedulingPolicy();
PeriodAndDuration timeSlotInterval = PeriodAndDuration.ofDuration(Duration.parse("PT60M"));
schedulingPolicy.setTimeSlotInterval(timeSlotInterval);
PeriodAndDuration minimumLeadTime = PeriodAndDuration.ofDuration(Duration.parse("P1D"));
schedulingPolicy.setMinimumLeadTime(minimumLeadTime);
PeriodAndDuration maximumAdvance = PeriodAndDuration.ofDuration(Duration.parse("P30D"));
schedulingPolicy.setMaximumAdvance(maximumAdvance);
schedulingPolicy.setSendConfirmationsToOwner(true);
schedulingPolicy.setAllowStaffSelection(true);
bookingBusiness.setSchedulingPolicy(schedulingPolicy);
BookingBusiness result = graphClient.solutions().bookingBusinesses().byBookingBusinessId("{bookingBusiness-id}").patch(bookingBusiness);
const options = {
authProvider,
};
const client = Client.init(options);
const bookingBusiness = {
email: 'admin@fabrikam.com',
schedulingPolicy: {
timeSlotInterval: 'PT60M',
minimumLeadTime: 'P1D',
maximumAdvance: 'P30D',
sendConfirmationsToOwner: true,
allowStaffSelection: true
}
};
await client.api('/solutions/bookingbusinesses/fabrikam@contoso.com')
.version('beta')
.update(bookingBusiness);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\BookingBusiness;
use Microsoft\Graph\Beta\Generated\Models\BookingSchedulingPolicy;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new BookingBusiness();
$requestBody->setEmail('admin@fabrikam.com');
$schedulingPolicy = new BookingSchedulingPolicy();
$schedulingPolicy->setTimeSlotInterval(new \DateInterval('PT60M'));
$schedulingPolicy->setMinimumLeadTime(new \DateInterval('P1D'));
$schedulingPolicy->setMaximumAdvance(new \DateInterval('P30D'));
$schedulingPolicy->setSendConfirmationsToOwner(true);
$schedulingPolicy->setAllowStaffSelection(true);
$requestBody->setSchedulingPolicy($schedulingPolicy);
$result = $graphServiceClient->solutions()->bookingBusinesses()->byBookingBusinessId('bookingBusiness-id')->patch($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.booking_business import BookingBusiness
from msgraph_beta.generated.models.booking_scheduling_policy import BookingSchedulingPolicy
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = BookingBusiness(
email = "admin@fabrikam.com",
scheduling_policy = BookingSchedulingPolicy(
time_slot_interval = "PT60M",
minimum_lead_time = "P1D",
maximum_advance = "P30D",
send_confirmations_to_owner = True,
allow_staff_selection = True,
),
)
result = await graph_client.solutions.booking_businesses.by_booking_business_id('bookingBusiness-id').patch(request_body)
Response
The following example shows the response. Note: The response object shown here might be shortened for readability.
HTTP/1.1 204 No Content