/betaMicrosoft Graph のバージョンの api は変更される可能性があります。APIs under the /beta version in Microsoft Graph are subject to change.実稼働アプリケーションでこれらの API を使用することは、サポートされていません。Use of these APIs in production applications is not supported.API が v2.0 で利用できるかどうかを確認するには、 バージョン セレクターを使用します。To determine whether an API is available in v1.0, use the Version selector.
この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可」を参照してください。One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
アクセス許可の種類Permission type
アクセス許可 (特権の小さいものから大きいものへ)Permissions (from least to most privileged)
委任 (職場または学校のアカウント)Delegated (work or school account)
委任 (個人用 Microsoft アカウント)Delegated (personal Microsoft account)
サポートされていません。Not supported.
アプリケーションApplication
サポートされていません。Not supported.
HTTP 要求HTTP request
POST /bookingBusinesses/{id}/services
要求ヘッダーRequest headers
名前Name
説明Description
AuthorizationAuthorization
Bearer {code}Bearer {code}
要求本文Request body
要求本文で、 Bookingservice オブジェクトの JSON 表記を指定します。In the request body, supply a JSON representation of bookingService object.
応答Response
成功した場合、このメソッドは応答 201, Created コードと、応答本文で Bookingservice オブジェクトを返します。If successful, this method returns 201, Created response code and bookingService object in the response body.
例Example
要求Request
要求の例を次に示します。The following is an example of the request.
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var bookingService = new BookingService
{
DefaultDuration = new Duration("PT1H30M"),
DefaultLocation = new Location
{
Address = new PhysicalAddress
{
City = "Buffalo",
CountryOrRegion = "USA",
PostalCode = "98052",
PostOfficeBox = null,
State = "NY",
Street = "4567 First Street",
Type = null,
AdditionalData = new Dictionary<string, object>()
{
{"type@odata.type", "#microsoft.graph.physicalAddressType"}
}
},
Coordinates = null,
DisplayName = "Contoso Lunch Delivery",
LocationEmailAddress = null,
LocationType = null,
LocationUri = null,
UniqueId = null,
UniqueIdType = null,
AdditionalData = new Dictionary<string, object>()
{
{"locationType@odata.type", "#microsoft.graph.locationType"},
{"uniqueIdType@odata.type", "#microsoft.graph.locationUniqueIdType"}
}
},
DefaultPrice = 10,
DefaultPriceType = BookingPriceType.FixedPrice,
DefaultReminders = new List<BookingReminder>()
{
new BookingReminder
{
Message = "Please be reminded that this service is tomorrow.",
Offset = new Duration("P1D"),
Recipients = BookingReminderRecipients.AllAttendees,
AdditionalData = new Dictionary<string, object>()
{
{"recipients@odata.type", "#microsoft.graph.bookingReminderRecipients"}
}
}
},
Description = "Individual bento box lunch delivery",
DisplayName = "Bento",
IsHiddenFromCustomers = false,
Notes = "Home-cooked special",
PostBuffer = new Duration("PT10M"),
PreBuffer = new Duration("PT5M"),
SchedulingPolicy = new BookingSchedulingPolicy
{
AllowStaffSelection = true,
MaximumAdvance = new Duration("P10D"),
MinimumLeadTime = new Duration("PT10H"),
SendConfirmationsToOwner = true,
TimeSlotInterval = new Duration("PT1H")
},
StaffMemberIds = new List<String>()
{
"d90d1e8c-5cfe-48cf-a2d5-966267375b6a",
"2f5f8794-0b29-45b5-b56a-2eb5ff7aa880"
},
AdditionalData = new Dictionary<string, object>()
{
{"defaultPriceType@odata.type", "#microsoft.graph.bookingPriceType"},
{"defaultReminders@odata.type", "#Collection(microsoft.graph.bookingReminder)"},
{"staffMemberIds@odata.type", "#Collection(String)"}
}
};
await graphClient.BookingBusinesses["Contosolunchdelivery@M365B489948.onmicrosoft.com"].Services
.Request()
.AddAsync(bookingService);
重要
Microsoft Graph Sdk では、既定で v2.0 バージョンの API を使用しており、ベータ版で使用できるすべての型、プロパティ、および 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.SDK を使用したベータ API へのアクセスの詳細については、「 BETA api で Microsoft Graph sdk を使用する」を参照してください。For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph Sdk では、既定で v2.0 バージョンの API を使用しており、ベータ版で使用できるすべての型、プロパティ、および 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.SDK を使用したベータ API へのアクセスの詳細については、「 BETA api で Microsoft Graph sdk を使用する」を参照してください。For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph Sdk では、既定で v2.0 バージョンの API を使用しており、ベータ版で使用できるすべての型、プロパティ、および 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.SDK を使用したベータ API へのアクセスの詳細については、「 BETA api で Microsoft Graph sdk を使用する」を参照してください。For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
IGraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
BookingService bookingService = new BookingService();
bookingService.defaultDuration = DatatypeFactory.newInstance().newDuration("PT1H30M");
Location defaultLocation = new Location();
PhysicalAddress address = new PhysicalAddress();
address.city = "Buffalo";
address.countryOrRegion = "USA";
address.postalCode = "98052";
address.postOfficeBox = null;
address.state = "NY";
address.street = "4567 First Street";
address.additionalDataManager().put("type@odata.type", new JsonPrimitive("#microsoft.graph.physicalAddressType"));
address.type = null;
defaultLocation.address = address;
defaultLocation.coordinates = null;
defaultLocation.displayName = "Contoso Lunch Delivery";
defaultLocation.locationEmailAddress = null;
defaultLocation.additionalDataManager().put("locationType@odata.type", new JsonPrimitive("#microsoft.graph.locationType"));
defaultLocation.locationType = null;
defaultLocation.locationUri = null;
defaultLocation.uniqueId = null;
defaultLocation.additionalDataManager().put("uniqueIdType@odata.type", new JsonPrimitive("#microsoft.graph.locationUniqueIdType"));
defaultLocation.uniqueIdType = null;
bookingService.defaultLocation = defaultLocation;
bookingService.defaultPrice = 10.0d;
bookingService.additionalDataManager().put("defaultPriceType@odata.type", new JsonPrimitive("#microsoft.graph.bookingPriceType"));
bookingService.defaultPriceType = BookingPriceType.FIXED_PRICE;
bookingService.additionalDataManager().put("defaultReminders@odata.type", new JsonPrimitive("#Collection(microsoft.graph.bookingReminder)"));
LinkedList<BookingReminder> defaultRemindersList = new LinkedList<BookingReminder>();
BookingReminder defaultReminders = new BookingReminder();
defaultReminders.message = "Please be reminded that this service is tomorrow.";
defaultReminders.offset = DatatypeFactory.newInstance().newDuration("P1D");
defaultReminders.additionalDataManager().put("recipients@odata.type", new JsonPrimitive("#microsoft.graph.bookingReminderRecipients"));
defaultReminders.recipients = BookingReminderRecipients.ALL_ATTENDEES;
defaultRemindersList.add(defaultReminders);
bookingService.defaultReminders = defaultRemindersList;
bookingService.description = "Individual bento box lunch delivery";
bookingService.displayName = "Bento";
bookingService.isHiddenFromCustomers = false;
bookingService.notes = "Home-cooked special";
bookingService.postBuffer = DatatypeFactory.newInstance().newDuration("PT10M");
bookingService.preBuffer = DatatypeFactory.newInstance().newDuration("PT5M");
BookingSchedulingPolicy schedulingPolicy = new BookingSchedulingPolicy();
schedulingPolicy.allowStaffSelection = true;
schedulingPolicy.maximumAdvance = DatatypeFactory.newInstance().newDuration("P10D");
schedulingPolicy.minimumLeadTime = DatatypeFactory.newInstance().newDuration("PT10H");
schedulingPolicy.sendConfirmationsToOwner = true;
schedulingPolicy.timeSlotInterval = DatatypeFactory.newInstance().newDuration("PT1H");
bookingService.schedulingPolicy = schedulingPolicy;
bookingService.additionalDataManager().put("staffMemberIds@odata.type", new JsonPrimitive("#Collection(String)"));
LinkedList<String> staffMemberIdsList = new LinkedList<String>();
staffMemberIdsList.add("d90d1e8c-5cfe-48cf-a2d5-966267375b6a");
staffMemberIdsList.add("2f5f8794-0b29-45b5-b56a-2eb5ff7aa880");
bookingService.staffMemberIds = staffMemberIdsList;
graphClient.bookingBusinesses("Contosolunchdelivery@M365B489948.onmicrosoft.com").services()
.buildRequest()
.post(bookingService);
重要
Microsoft Graph Sdk では、既定で v2.0 バージョンの API を使用しており、ベータ版で使用できるすべての型、プロパティ、および 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.SDK を使用したベータ API へのアクセスの詳細については、「 BETA api で Microsoft Graph sdk を使用する」を参照してください。For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
要求本文で、 Bookingservice オブジェクトの JSON 表記を指定します。In the request body, supply a JSON representation of bookingService object.
応答Response
応答の例を次に示します。The following is an example of the response.注: 簡潔にするために、ここに示す応答オブジェクトは切り詰められている場合があります。Note: The response object shown here may be truncated for brevity.実際の呼び出しではすべてのプロパティが返されます。All of the properties will be returned from an actual call.