bookingAppointment を更新する
[アーティクル]
04/11/2022
3 人の共同作成者
この記事の内容
名前空間: microsoft.graph
重要
Microsoft Graph のバージョンの /beta API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 API が v1.0 で使用できるかどうかを確認するには、 バージョン セレクターを使用します。
指定した bookingBusiness 内の bookingAppointment オブジェクトのプロパティを更新します。
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可 」を参照してください。
アクセス許可の種類
アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント)
BookingsAppointment.ReadWrite.All, Bookings。ReadWrite.All、Bookings。Manage.All
委任 (個人用 Microsoft アカウント)
サポートされていません。
アプリケーション
BookingsAppointment.ReadWrite.All, Bookings。Read.All
注意
アプリケーションのアクセス許可を使用してカスタム アプリを作成する場合は、 ビジネス ルールの検証 に従う必要があります。
HTTP 要求
PATCH /bookingBusinesses/{id}/appointments/{id}
名前
説明
Authorization
ベアラー {code}。必須。
要求本文
要求本文では、更新する必要があるプロパティの値 のみ を指定します。要求本文に含まれていない既存のプロパティは、以前の値を保持するか、他のプロパティ値の変更に基づいて再計算されます。
次の表に、更新できるプロパティを示します。
プロパティ
型
説明
customerEmailAddress
String
予定を予約している bookingCustomer の SMTP アドレス。
customerId
String
この 予定の bookingCustomer の ID。 予定の作成時に ID が指定されていない場合は、新しい bookingCustomer オブジェクトが作成されます。 設定したら、 customerId を変更できないと考える必要があります。
customerLocation
location
予定を予約している bookingCustomer の 位置情報を表します。
customerName
String
顧客の名前。
customerNotes
String
この予定に関連付けられている顧客からのメモ。 この値は、ID でこの bookingAppointment を 読み取る場合にのみ取得できます。 このプロパティは、最初に新しい顧客との予定を作成する場合にのみ設定できます。 その後、 customerId で表される顧客から値が計算されます。
customerPhone
String
顧客の電話番号。
顧客
bookingCustomerInformation コレクション
予定の顧客プロパティが一覧表示されます。 予定には顧客情報の一覧が含まれており、各ユニットはその予定の一部である顧客のプロパティを示します。 オプション。
customerTimeZone
String
顧客のタイム ゾーン。 使用可能な値の一覧については、「 dateTimeTimeZone 」を参照してください。
duration
期間
ISO8601 形式で示される予定の長さ。
end
dateTimeTimeZone
予定が終了する日付、時刻、タイム ゾーン。
invoiceAmount
倍精度浮動小数点数
請求書の請求金額。
invoiceDate
dateTimeTimeZone
この予定の請求書の日付、時刻、タイム ゾーン。
invoiceId
String
請求書の ID。
invoiceStatus
文字列
請求書の状態。 使用可能な値: draft、reviewing、open、canceled、paid、corrective。
invoiceUrl
String
Microsoft Bookingsの請求書の URL。
filledAttendeesCount
Int32
予定の現在の顧客数。 必須です。
isLocationOnline
Boolean
True は、予定がオンラインで保持されることを示します。 既定値は False です。
maximumAttendeesCount
Int32
予定で許可される顧客の最大数。 必須です。
optOutOfCustomerEmail
Boolean
True は、この 予定の bookingCustomer がこの予定の確認を受け取りたくないことを示します。
postBuffer
期間
例として、予定が終了した後に予約する時間 (クリーンアップ用) を指定します。 値は ISO8601 形式で表されます。
preBuffer
期間
準備のために、予定が開始される前に予約する時間を例に示します。 値は ISO8601 形式で表されます。
価格
倍精度浮動小数点数
指定した bookingService の予定の通常価格。
priceType
bookingPriceType
サービスの価格構造に柔軟性を提供する設定。 可能な値は、undefined、fixedPrice、startingAt、hourly、free、priceVaries、callUs、notSet、unknownFutureValue です。
アラーム
bookingReminder コレクション
この予定に対して送信された顧客のリマインダーのコレクション。 このプロパティの値は、ID でこの bookingAppointment を 読み取る場合にのみ使用できます。
selfServiceAppointmentId
String
顧客の代わりにスタッフが行うのではなく、スケジュール 設定ページで顧客によって直接予定が作成された場合、予定の追加の追跡 ID。
serviceId
String
この予定に関連付けられている bookingService の ID。
serviceLocation
location
サービスが配信される場所。
serviceName
String
この予定に関連付けられている bookingService の名前。 このプロパティは、新しい予定を作成するときに省略可能です。 指定しない場合は、予定に関連付けられているサービスから serviceId プロパティによって計算されます。
serviceNotes
String
bookingStaffMember からのメモ。 このプロパティの値は、ID でこの bookingAppointment を 読み取る場合にのみ使用できます。
smsNotificationsEnabled
Boolean
True は、SMS 通知が予定の顧客に送信されることを示します。 既定値は False です。
staffMemberIds
String collection
この予定でスケジュールされている各 bookingStaffMember の ID。
開始
dateTimeTimeZone
予定が開始される日付、時刻、タイム ゾーン。
注意
サービス で許可される顧客の最大数 (maximumAttedeesCount ) が 1 より大きい場合:
Booking Calendar に顧客が存在することを確認します。 作成しない場合は、 BookingCustomer の作成操作を 使用して作成します。
予定を作成または更新するときに、有効な顧客 ID を渡します。 顧客 ID が無効な場合、その顧客は予定オブジェクトに含まれません。
応答
成功した場合、このメソッドは 204 No Content 応答コードを返します。 応答本文には何も返されません。
例
要求
次の例では、サービスの日付を 1 日ずつ変更し、請求書の日付を更新します。
PATCH https://graph.microsoft.com/beta/bookingBusinesses/Contosolunchdelivery@contoso.onmicrosoft.com/appointments/AAMkADKnAAA=
Content-type: application/json
{
"@odata.type":"#microsoft.graph.bookingAppointment",
"end":{
"@odata.type":"#microsoft.graph.dateTimeTimeZone",
"dateTime":"2018-05-06T12:30:00.0000000+00:00",
"timeZone":"UTC"
},
"invoiceDate":{
"@odata.type":"#microsoft.graph.dateTimeTimeZone",
"dateTime":"2018-05-06T12:30:00.0000000+00:00",
"timeZone":"UTC"
},
"start":{
"@odata.type":"#microsoft.graph.dateTimeTimeZone",
"dateTime":"2018-05-06T12:00:00.0000000+00:00",
"timeZone":"UTC"
}
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var bookingAppointment = new BookingAppointment
{
End = new DateTimeTimeZone
{
DateTime = "2018-05-06T12:30:00+00:00",
TimeZone = "UTC"
},
InvoiceDate = new DateTimeTimeZone
{
DateTime = "2018-05-06T12:30:00+00:00",
TimeZone = "UTC"
},
Start = new DateTimeTimeZone
{
DateTime = "2018-05-06T12:00:00+00:00",
TimeZone = "UTC"
}
};
await graphClient.BookingBusinesses["{bookingBusiness-id}"].Appointments["{bookingAppointment-id}"]
.Request()
.UpdateAsync(bookingAppointment);
const options = {
authProvider,
};
const client = Client.init(options);
const bookingAppointment = {
'@odata.type':'#microsoft.graph.bookingAppointment',
end: {
'@odata.type':'#microsoft.graph.dateTimeTimeZone',
dateTime: '2018-05-06T12:30:00.0000000+00:00',
timeZone: 'UTC'
},
invoiceDate: {
'@odata.type':'#microsoft.graph.dateTimeTimeZone',
dateTime: '2018-05-06T12:30:00.0000000+00:00',
timeZone: 'UTC'
},
start: {
'@odata.type':'#microsoft.graph.dateTimeTimeZone',
dateTime: '2018-05-06T12:00:00.0000000+00:00',
timeZone: 'UTC'
}
};
await client.api('/bookingBusinesses/Contosolunchdelivery@contoso.onmicrosoft.com/appointments/AAMkADKnAAA=')
.version('beta')
.update(bookingAppointment);
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/bookingBusinesses/Contosolunchdelivery@contoso.onmicrosoft.com/appointments/AAMkADKnAAA="]]];
[urlRequest setHTTPMethod:@"PATCH"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphBookingAppointment *bookingAppointment = [[MSGraphBookingAppointment alloc] init];
MSGraphDateTimeTimeZone *end = [[MSGraphDateTimeTimeZone alloc] init];
[end setDateTime: "2018-05-06T12:30:00+00:00"];
[end setTimeZone:@"UTC"];
[bookingAppointment setEnd:end];
MSGraphDateTimeTimeZone *invoiceDate = [[MSGraphDateTimeTimeZone alloc] init];
[invoiceDate setDateTime: "2018-05-06T12:30:00+00:00"];
[invoiceDate setTimeZone:@"UTC"];
[bookingAppointment setInvoiceDate:invoiceDate];
MSGraphDateTimeTimeZone *start = [[MSGraphDateTimeTimeZone alloc] init];
[start setDateTime: "2018-05-06T12:00:00+00:00"];
[start setTimeZone:@"UTC"];
[bookingAppointment setStart:start];
NSError *error;
NSData *bookingAppointmentData = [bookingAppointment getSerializedDataWithError:&error];
[urlRequest setHTTPBody:bookingAppointmentData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
BookingAppointment bookingAppointment = new BookingAppointment();
DateTimeTimeZone end = new DateTimeTimeZone();
end.dateTime = "2018-05-06T12:30:00+00:00";
end.timeZone = "UTC";
bookingAppointment.end = end;
DateTimeTimeZone invoiceDate = new DateTimeTimeZone();
invoiceDate.dateTime = "2018-05-06T12:30:00+00:00";
invoiceDate.timeZone = "UTC";
bookingAppointment.invoiceDate = invoiceDate;
DateTimeTimeZone start = new DateTimeTimeZone();
start.dateTime = "2018-05-06T12:00:00+00:00";
start.timeZone = "UTC";
bookingAppointment.start = start;
graphClient.bookingBusinesses("Contosolunchdelivery@contoso.onmicrosoft.com").appointments("AAMkADKnAAA=")
.buildRequest()
.patch(bookingAppointment);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewBookingAppointment()
end := msgraphsdk.NewDateTimeTimeZone()
requestBody.SetEnd(end)
dateTime := "2018-05-06T12:30:00.0000000+00:00"
end.SetDateTime(&dateTime)
timeZone := "UTC"
end.SetTimeZone(&timeZone)
end.SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.dateTimeTimeZone",
}
invoiceDate := msgraphsdk.NewDateTimeTimeZone()
requestBody.SetInvoiceDate(invoiceDate)
dateTime := "2018-05-06T12:30:00.0000000+00:00"
invoiceDate.SetDateTime(&dateTime)
timeZone := "UTC"
invoiceDate.SetTimeZone(&timeZone)
invoiceDate.SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.dateTimeTimeZone",
}
start := msgraphsdk.NewDateTimeTimeZone()
requestBody.SetStart(start)
dateTime := "2018-05-06T12:00:00.0000000+00:00"
start.SetDateTime(&dateTime)
timeZone := "UTC"
start.SetTimeZone(&timeZone)
start.SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.dateTimeTimeZone",
}
requestBody.SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.bookingAppointment",
}
bookingBusinessId := "bookingBusiness-id"
bookingAppointmentId := "bookingAppointment-id"
graphClient.BookingBusinessesById(&bookingBusinessId).AppointmentsById(&bookingAppointmentId).Patch(requestBody)
Import-Module Microsoft.Graph.Bookings
$params = @{
"@odata.type" = "#microsoft.graph.bookingAppointment"
End = @{
"@odata.type" = "#microsoft.graph.dateTimeTimeZone"
DateTime = "2018-05-06T12:30:00.0000000+00:00"
TimeZone = "UTC"
}
InvoiceDate = @{
"@odata.type" = "#microsoft.graph.dateTimeTimeZone"
DateTime = "2018-05-06T12:30:00.0000000+00:00"
TimeZone = "UTC"
}
Start = @{
"@odata.type" = "#microsoft.graph.dateTimeTimeZone"
DateTime = "2018-05-06T12:00:00.0000000+00:00"
TimeZone = "UTC"
}
}
Update-MgBookingBusinessAppointment -BookingBusinessId $bookingBusinessId -BookingAppointmentId $bookingAppointmentId -BodyParameter $params
応答
応答の例を次に示します。
HTTP/1.1 204 No Content