BookingBusiness の作成
[アーティクル]
10/30/2023
9 人の共同作成者
フィードバック
この記事の内容
名前空間: microsoft.graph
テナントに新しいMicrosoft Bookings ビジネス を作成します。
これは、ビジネス表示名を指定する必要があるBookingsビジネスを設定する最初の手順です。 ビジネス アドレス、Web サイト アドレス、スケジュール ポリシーなどの他の情報を含めたり、bookingBusiness を更新して後でその情報を 設定したりできます。
この API は、次の国内クラウド展開 で使用できます。
グローバル サービス
米国政府機関 L4
米国政府機関 L5 (DOD)
21Vianet が運営する中国
✅
✅
✅
❌
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。 アプリで必要な場合にのみ 、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「 アクセス許可の種類 」を参照してください。 これらのアクセス許可の詳細については、 アクセス許可のリファレンスを参照してください 。
アクセス許可の種類
最小特権アクセス許可
特権の高いアクセス許可
委任 (職場または学校のアカウント)
Bookings.Manage.All
注意事項なし。
委任 (個人用 Microsoft アカウント)
サポートされていません。
サポートされていません。
アプリケーション
サポートされていません。
サポートされていません。
HTTP 要求
POST /solutions/bookingBusinesses
名前
説明
Authorization
Bearer {code}
要求本文
要求本文で、 bookingBusiness オブジェクトの JSON 表現を指定します。
応答
成功した場合、このメソッドは 201 Created
応答コードと bookingBusiness オブジェクトを応答本文に返します。
例
要求
次の例は要求を示しています。
POST https://graph.microsoft.com/v1.0/solutions/bookingBusinesses
Content-type: application/json
{
"displayName":"Fourth Coffee",
"address":{
"postOfficeBox":"P.O. Box 123",
"street":"4567 Main Street",
"city":"Buffalo",
"state":"NY",
"countryOrRegion":"USA",
"postalCode":"98052"
},
"phone":"206-555-0100",
"email":"manager@fourthcoffee.com",
"webSiteUrl":"https://www.fourthcoffee.com",
"defaultCurrencyIso":"USD"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new BookingBusiness
{
DisplayName = "Fourth Coffee",
Address = new PhysicalAddress
{
Street = "4567 Main Street",
City = "Buffalo",
State = "NY",
CountryOrRegion = "USA",
PostalCode = "98052",
AdditionalData = new Dictionary<string, object>
{
{
"postOfficeBox" , "P.O. Box 123"
},
},
},
Phone = "206-555-0100",
Email = "manager@fourthcoffee.com",
WebSiteUrl = "https://www.fourthcoffee.com",
DefaultCurrencyIso = "USD",
};
// 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.PostAsync(requestBody);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc solutions booking-businesses create --body '{\
"displayName":"Fourth Coffee",\
"address":{\
"postOfficeBox":"P.O. Box 123",\
"street":"4567 Main Street",\
"city":"Buffalo",\
"state":"NY",\
"countryOrRegion":"USA",\
"postalCode":"98052"\
},\
"phone":"206-555-0100",\
"email":"manager@fourthcoffee.com",\
"webSiteUrl":"https://www.fourthcoffee.com",\
"defaultCurrencyIso":"USD"\
}\
'
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewBookingBusiness()
displayName := "Fourth Coffee"
requestBody.SetDisplayName(&displayName)
address := graphmodels.NewPhysicalAddress()
street := "4567 Main Street"
address.SetStreet(&street)
city := "Buffalo"
address.SetCity(&city)
state := "NY"
address.SetState(&state)
countryOrRegion := "USA"
address.SetCountryOrRegion(&countryOrRegion)
postalCode := "98052"
address.SetPostalCode(&postalCode)
additionalData := map[string]interface{}{
"postOfficeBox" : "P.O. Box 123",
}
address.SetAdditionalData(additionalData)
requestBody.SetAddress(address)
phone := "206-555-0100"
requestBody.SetPhone(&phone)
email := "manager@fourthcoffee.com"
requestBody.SetEmail(&email)
webSiteUrl := "https://www.fourthcoffee.com"
requestBody.SetWebSiteUrl(&webSiteUrl)
defaultCurrencyIso := "USD"
requestBody.SetDefaultCurrencyIso(&defaultCurrencyIso)
bookingBusinesses, err := graphClient.Solutions().BookingBusinesses().Post(context.Background(), requestBody, nil)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
BookingBusiness bookingBusiness = new BookingBusiness();
bookingBusiness.setDisplayName("Fourth Coffee");
PhysicalAddress address = new PhysicalAddress();
address.setStreet("4567 Main Street");
address.setCity("Buffalo");
address.setState("NY");
address.setCountryOrRegion("USA");
address.setPostalCode("98052");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("postOfficeBox", "P.O. Box 123");
address.setAdditionalData(additionalData);
bookingBusiness.setAddress(address);
bookingBusiness.setPhone("206-555-0100");
bookingBusiness.setEmail("manager@fourthcoffee.com");
bookingBusiness.setWebSiteUrl("https://www.fourthcoffee.com");
bookingBusiness.setDefaultCurrencyIso("USD");
BookingBusiness result = graphClient.solutions().bookingBusinesses().post(bookingBusiness);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const bookingBusiness = {
displayName: 'Fourth Coffee',
address: {
postOfficeBox: 'P.O. Box 123',
street: '4567 Main Street',
city: 'Buffalo',
state: 'NY',
countryOrRegion: 'USA',
postalCode: '98052'
},
phone: '206-555-0100',
email: 'manager@fourthcoffee.com',
webSiteUrl: 'https://www.fourthcoffee.com',
defaultCurrencyIso: 'USD'
};
await client.api('/solutions/bookingBusinesses')
.post(bookingBusiness);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\BookingBusiness;
use Microsoft\Graph\Generated\Models\PhysicalAddress;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new BookingBusiness();
$requestBody->setDisplayName('Fourth Coffee');
$address = new PhysicalAddress();
$address->setStreet('4567 Main Street');
$address->setCity('Buffalo');
$address->setState('NY');
$address->setCountryOrRegion('USA');
$address->setPostalCode('98052');
$additionalData = [
'postOfficeBox' => 'P.O. Box 123',
];
$address->setAdditionalData($additionalData);
$requestBody->setAddress($address);
$requestBody->setPhone('206-555-0100');
$requestBody->setEmail('manager@fourthcoffee.com');
$requestBody->setWebSiteUrl('https://www.fourthcoffee.com');
$requestBody->setDefaultCurrencyIso('USD');
$result = $graphServiceClient->solutions()->bookingBusinesses()->post($requestBody)->wait();
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
Import-Module Microsoft.Graph.Bookings
$params = @{
displayName = "Fourth Coffee"
address = @{
postOfficeBox = "P.O. Box 123"
street = "4567 Main Street"
city = "Buffalo"
state = "NY"
countryOrRegion = "USA"
postalCode = "98052"
}
phone = "206-555-0100"
email = "manager@fourthcoffee.com"
webSiteUrl = "https://www.fourthcoffee.com"
defaultCurrencyIso = "USD"
}
New-MgBookingBusiness -BodyParameter $params
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
from msgraph import GraphServiceClient
from msgraph.generated.models.booking_business import BookingBusiness
from msgraph.generated.models.physical_address import PhysicalAddress
graph_client = GraphServiceClient(credentials, scopes)
request_body = BookingBusiness(
display_name = "Fourth Coffee",
address = PhysicalAddress(
street = "4567 Main Street",
city = "Buffalo",
state = "NY",
country_or_region = "USA",
postal_code = "98052",
additional_data = {
"post_office_box" : "P.O. Box 123",
}
),
phone = "206-555-0100",
email = "manager@fourthcoffee.com",
web_site_url = "https://www.fourthcoffee.com",
default_currency_iso = "USD",
)
result = await graph_client.solutions.booking_businesses.post(request_body)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
応答
次の例は応答を示しています。 注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 201 Created
Content-type: application/json
{
"@odata.context":"https://graph.microsoft.com/v1.0/solutions/$metadata#bookingBusinesses/$entity",
"id":"fourthcoffee@contoso.com",
"displayName":"Fourth Coffee",
"businessType":"",
"phone":"206-555-0100",
"email":"manager@fourthcoffee.com",
"webSiteUrl":"https://www.fourthcoffee.com",
"languageTag":"en-US",
"defaultCurrencyIso":"USD",
"isPublished":false,
"publicUrl":null,
"address":{
"postOfficeBox":"P.O. Box 123",
"street":"4567 Main Street",
"city":"Buffalo",
"state":"NY",
"countryOrRegion":"USA",
"postalCode":"98052"
},
"businessHours":[
{
"day":"monday",
"timeSlots":[
{
"startTime":"08:00:00.0000000",
"endTime":"17:00:00.0000000"
}
]
},
{
"day":"tuesday",
"timeSlots":[
{
"startTime":"08:00:00.0000000",
"endTime":"17:00:00.0000000"
}
]
},
{
"day":"wednesday",
"timeSlots":[
{
"startTime":"08:00:00.0000000",
"endTime":"17:00:00.0000000"
}
]
},
{
"day":"thursday",
"timeSlots":[
{
"startTime":"08:00:00.0000000",
"endTime":"17:00:00.0000000"
}
]
},
{
"day":"friday",
"timeSlots":[
{
"startTime":"08:00:00.0000000",
"endTime":"17:00:00.0000000"
}
]
},
{
"day":"saturday",
"timeSlots":[
]
},
{
"day":"sunday",
"timeSlots":[
]
}
],
"schedulingPolicy":{
"timeSlotInterval":"PT30M",
"minimumLeadTime":"P1D",
"maximumAdvance":"P365D",
"sendConfirmationsToOwner":true,
"allowStaffSelection":true
}
}