名前空間: microsoft.graph
重要
Microsoft Graph の /beta
バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
Microsoft Bookings予定表のスタッフ メンバーの空き時間情報を取得します。
この API は、次の国内クラウド展開で使用できます。
グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
✅ |
✅ |
✅ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「 アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、 アクセス許可のリファレンスを参照してください。
アクセス許可の種類 |
最小特権アクセス許可 |
特権の高いアクセス許可 |
委任 (職場または学校のアカウント) |
サポートされていません。 |
サポートされていません。 |
委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
アプリケーション |
Bookings.Read.All |
Bookings。Manage.All、Bookings。ReadWrite.All、Calendars.Read、Calendars.ReadWrite |
HTTP 要求
POST /solutions/bookingbusinesses/{id}/getStaffAvailability
名前 |
説明 |
Authorization |
ベアラー {code}。 必須です。 |
Content-Type |
application/json. 必須です。 |
要求本文
要求本文で、スタッフ ID の一覧と、startDateTime と endDateTime という dateTimeTimeZone リソースの種類の他の 2 つのパラメーターを渡します。 これらは、スタッフの可用性が返される 2 つのタイムスタンプに対応します。
応答
成功した場合、このメソッドは 200 OK
応答コードと、応答本文の staffAvailabilityItem コレクションを返します。
例
要求
次の例は要求を示しています。
POST https://graph.microsoft.com/beta/solutions/bookingbusinesses/contosolunchdelivery@contoso.com/getStaffAvailability
Content-Type: application/json
{
"staffIds": [
"311a5454-08b2-4560-ba1c-f715e938cb79"
],
"startDateTime": {
"dateTime": "2022-01-25T00:00:00",
"timeZone": "India Standard Time"
},
"endDateTime": {
"dateTime": "2022-01-26T17:00:00",
"timeZone": "Pacific Standard Time"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Solutions.BookingBusinesses.Item.GetStaffAvailability;
using Microsoft.Graph.Beta.Models;
var requestBody = new GetStaffAvailabilityPostRequestBody
{
StaffIds = new List<string>
{
"311a5454-08b2-4560-ba1c-f715e938cb79",
},
StartDateTime = new DateTimeTimeZone
{
DateTime = "2022-01-25T00:00:00",
TimeZone = "India Standard Time",
},
EndDateTime = new DateTimeTimeZone
{
DateTime = "2022-01-26T17:00:00",
TimeZone = "Pacific Standard Time",
},
};
// 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}"].GetStaffAvailability.PostAsGetStaffAvailabilityPostResponseAsync(requestBody);
mgc-beta solutions booking-businesses get-staff-availability post --booking-business-id {bookingBusiness-id} --body '{\
"staffIds": [\
"311a5454-08b2-4560-ba1c-f715e938cb79"\
],\
"startDateTime": {\
"dateTime": "2022-01-25T00:00:00",\
"timeZone": "India Standard Time"\
},\
"endDateTime": {\
"dateTime": "2022-01-26T17:00:00",\
"timeZone": "Pacific Standard Time"\
}\
}\
'
// 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"
graphsolutions "github.com/microsoftgraph/msgraph-beta-sdk-go/solutions"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphsolutions.NewGetStaffAvailabilityPostRequestBody()
staffIds := []string {
"311a5454-08b2-4560-ba1c-f715e938cb79",
}
requestBody.SetStaffIds(staffIds)
startDateTime := graphmodels.NewDateTimeTimeZone()
dateTime := "2022-01-25T00:00:00"
startDateTime.SetDateTime(&dateTime)
timeZone := "India Standard Time"
startDateTime.SetTimeZone(&timeZone)
requestBody.SetStartDateTime(startDateTime)
endDateTime := graphmodels.NewDateTimeTimeZone()
dateTime := "2022-01-26T17:00:00"
endDateTime.SetDateTime(&dateTime)
timeZone := "Pacific Standard Time"
endDateTime.SetTimeZone(&timeZone)
requestBody.SetEndDateTime(endDateTime)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
getStaffAvailability, err := graphClient.Solutions().BookingBusinesses().ByBookingBusinessId("bookingBusiness-id").GetStaffAvailability().PostAsGetStaffAvailabilityPostResponse(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.solutions.bookingbusinesses.item.getstaffavailability.GetStaffAvailabilityPostRequestBody getStaffAvailabilityPostRequestBody = new com.microsoft.graph.beta.solutions.bookingbusinesses.item.getstaffavailability.GetStaffAvailabilityPostRequestBody();
LinkedList<String> staffIds = new LinkedList<String>();
staffIds.add("311a5454-08b2-4560-ba1c-f715e938cb79");
getStaffAvailabilityPostRequestBody.setStaffIds(staffIds);
DateTimeTimeZone startDateTime = new DateTimeTimeZone();
startDateTime.setDateTime("2022-01-25T00:00:00");
startDateTime.setTimeZone("India Standard Time");
getStaffAvailabilityPostRequestBody.setStartDateTime(startDateTime);
DateTimeTimeZone endDateTime = new DateTimeTimeZone();
endDateTime.setDateTime("2022-01-26T17:00:00");
endDateTime.setTimeZone("Pacific Standard Time");
getStaffAvailabilityPostRequestBody.setEndDateTime(endDateTime);
var result = graphClient.solutions().bookingBusinesses().byBookingBusinessId("{bookingBusiness-id}").getStaffAvailability().post(getStaffAvailabilityPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const staffAvailabilityItem = {
staffIds: [
'311a5454-08b2-4560-ba1c-f715e938cb79'
],
startDateTime: {
dateTime: '2022-01-25T00:00:00',
timeZone: 'India Standard Time'
},
endDateTime: {
dateTime: '2022-01-26T17:00:00',
timeZone: 'Pacific Standard Time'
}
};
await client.api('/solutions/bookingbusinesses/contosolunchdelivery@contoso.com/getStaffAvailability')
.version('beta')
.post(staffAvailabilityItem);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Solutions\BookingBusinesses\Item\GetStaffAvailability\GetStaffAvailabilityPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\DateTimeTimeZone;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new GetStaffAvailabilityPostRequestBody();
$requestBody->setStaffIds(['311a5454-08b2-4560-ba1c-f715e938cb79', ]);
$startDateTime = new DateTimeTimeZone();
$startDateTime->setDateTime('2022-01-25T00:00:00');
$startDateTime->setTimeZone('India Standard Time');
$requestBody->setStartDateTime($startDateTime);
$endDateTime = new DateTimeTimeZone();
$endDateTime->setDateTime('2022-01-26T17:00:00');
$endDateTime->setTimeZone('Pacific Standard Time');
$requestBody->setEndDateTime($endDateTime);
$result = $graphServiceClient->solutions()->bookingBusinesses()->byBookingBusinessId('bookingBusiness-id')->getStaffAvailability()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Bookings
$params = @{
staffIds = @(
"311a5454-08b2-4560-ba1c-f715e938cb79"
)
startDateTime = @{
dateTime = "2022-01-25T00:00:00"
timeZone = "India Standard Time"
}
endDateTime = @{
dateTime = "2022-01-26T17:00:00"
timeZone = "Pacific Standard Time"
}
}
Get-MgBetaBookingBusinessStaffAvailability -BookingBusinessId $bookingBusinessId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.solutions.bookingbusinesses.item.get_staff_availability.get_staff_availability_post_request_body import GetStaffAvailabilityPostRequestBody
from msgraph_beta.generated.models.date_time_time_zone import DateTimeTimeZone
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = GetStaffAvailabilityPostRequestBody(
staff_ids = [
"311a5454-08b2-4560-ba1c-f715e938cb79",
],
start_date_time = DateTimeTimeZone(
date_time = "2022-01-25T00:00:00",
time_zone = "India Standard Time",
),
end_date_time = DateTimeTimeZone(
date_time = "2022-01-26T17:00:00",
time_zone = "Pacific Standard Time",
),
)
result = await graph_client.solutions.booking_businesses.by_booking_business_id('bookingBusiness-id').get_staff_availability.post(request_body)
応答
次の例は応答を示しています。
HTTP/1.1 200 OK
Content-type: application/json
{
"staffAvailabilityItem": [
{
"staffId": "311a5454-08b2-4560-ba1c-f715e938cb79",
"availabilityItems": [
{
"status": "Available",
"startDateTime": {
"dateTime": "2022-01-24T08:00:00",
"timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
},
"endDateTime": {
"dateTime": "2022-01-24T15:00:00",
"timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
},
"serviceId": ""
},
{
"status": "Busy",
"startDateTime": {
"dateTime": "2022-01-24T15:00:00",
"timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
},
"endDateTime": {
"dateTime": "2022-01-24T16:00:00",
"timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
},
"serviceId": "57da6774-a087-4d69-b0e6-6fb82c339976"
},
{
"status": "Available",
"startDateTime": {
"dateTime": "2022-01-24T16:00:00",
"timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
},
"endDateTime": {
"dateTime": "2022-01-24T17:00:00",
"timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
},
"serviceId": ""
},
{
"status": "Available",
"startDateTime": {
"dateTime": "2022-01-25T08:00:00",
"timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
},
"endDateTime": {
"dateTime": "2022-01-25T17:00:00",
"timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
},
"serviceId": ""
},
{
"status": "Available",
"startDateTime": {
"dateTime": "2022-01-26T08:00:00",
"timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
},
"endDateTime": {
"dateTime": "2022-01-26T17:00:00",
"timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
},
"serviceId": ""
}
]
}
]
}