为此 API 选择标记为最低特权的权限。
只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
权限类型
最低特权权限
更高特权权限
委派(工作或学校帐户)
Calendars.Read
Calendars.ReadBasic、Calendars.ReadWrite
委派(个人 Microsoft 帐户)
Calendars.Read
Calendars.ReadBasic、Calendars.ReadWrite
应用程序
Calendars.Read
Calendars.ReadBasic、Calendars.ReadWrite
HTTP 请求
GET /me/calendarView/delta?startDateTime={start_datetime}&endDateTime={end_datetime}
GET /users/{id}/calendarView/delta?startDateTime={start_datetime}&endDateTime={end_datetime}
GET https://graph.microsoft.com/v1.0/me/calendarView/delta?startdatetime={start_datetime}&enddatetime={end_datetime}
Prefer: odata.maxpagesize=2
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.CalendarView.Delta.GetAsDeltaGetResponseAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.StartDateTime = "{start_datetime}";
requestConfiguration.QueryParameters.EndDateTime = "{end_datetime}";
requestConfiguration.Headers.Add("Prefer", "odata.maxpagesize=2");
});
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
var result = graphClient.me().calendarView().delta().get(requestConfiguration -> {
requestConfiguration.queryParameters.startDateTime = "{start_datetime}";
requestConfiguration.queryParameters.endDateTime = "{end_datetime}";
requestConfiguration.headers.add("Prefer", "odata.maxpagesize=2");
});
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.users.item.calendar_view.delta.delta_request_builder import DeltaRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
query_params = DeltaRequestBuilder.DeltaRequestBuilderGetQueryParameters(
start_date_time = "{start_datetime}",
end_date_time = "{end_datetime}",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
request_configuration.headers.add("Prefer", "odata.maxpagesize=2")
result = await graph_client.me.calendar_view.delta.get(request_configuration = request_configuration)