命名空间:microsoft.graph.callRecords
获取 callRecord 对象及其属性的列表。 可以选择使用 $filterstartDateTime 和参与者 ID 属性上的查询参数筛选结果。 请注意,列出的通话记录不包括可展开的关系,例如 会话 和 participants_v2。 可以使用获取特定记录的 callRecord 扩展这些关系。
警告
通话记录在通话或会议结束后创建,并保留 30 天。 此 API 不会返回超过 30 天的呼叫记录。
此 API 可用于以下国家级云部署。
| 全局服务 |
美国政府 L4 |
美国政府 L5 (DOD) |
由世纪互联运营的中国 |
| ✅ |
✅ |
✅ |
❌ |
权限
为此 API 选择标记为最低特权的权限。
只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
| 权限类型 |
最低特权权限 |
更高特权权限 |
| 委派(工作或学校帐户) |
不支持。 |
不支持。 |
| 委派(个人 Microsoft 帐户) |
不支持。 |
不支持。 |
| 应用程序 |
CallRecords.Read.All |
不可用。 |
HTTP 请求
GET /communications/callRecords
可选的查询参数
此方法支持以下 OData 查询参数来帮助自定义响应。 若要了解一般信息,请参阅 OData 查询参数。
| 名称 |
说明 |
| $select |
使用 $select 查询参数返回一组不同于单个资源的默认集或资源集合的属性。 |
| $filter |
使用 $filter 查询参数,以仅检索集合的子集。 仅支持 startDateTime (lt、le、gtge) 和参与者 participants_v2.id (eq) 属性。 |
| 名称 |
说明 |
| Authorization |
持有者 {token}。 必填。 详细了解 身份验证和授权。 |
| 首选:odata.maxpagesize={x} |
指定分页结果的首选整数 {x} 页大小。 此值必须等于或小于允许的最大页面大小。 可选。 |
| 首选:include-unknown-enum-members |
启用超出 sentinel 值的可演变枚举值。 有关详细信息,请参阅 使用 Microsoft Graph 的最佳做法。 可选。 |
| 首选:omit-values=nulls |
从响应中删除 null 或空值。 可选。 |
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法在 200 OK 响应正文中返回响应代码和 microsoft.graph.callRecords.callRecord 对象的集合。
当一个结果集跨越多个页面时,Microsoft Graph 在包含指向下一页结果的 URL 的响应中使用 @odata.nextLink 属性返回该页面。 如果该属性存在,请继续在每个响应中使用 @odata.nextLink URL 发出其他请求,直到返回所有结果。 有关详细信息,请参阅在应用中对 Microsoft Graph 数据进行分页。 呼叫记录的默认页面大小为 60 个条目。
示例
示例 1:列出所有记录
以下示例演示如何获取所有 callRecord 对象。
请求
以下示例显示了一个请求。
GET https://graph.microsoft.com/v1.0/communications/callRecords
// 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.Communications.CallRecords.GetAsync();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
callRecords, err := graphClient.Communications().CallRecords().Get(context.Background(), nil)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.callrecords.CallRecordCollectionResponse result = graphClient.communications().callRecords().get();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
let callRecords = await client.api('/communications/callRecords')
.get();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->communications()->callRecords()->get()->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.communications.call_records.get()
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords",
"value": [
{
"id": "3cf3bbc8-b21d-4f2e-bfd0-b13603ae6c65",
"version": 2,
"type": "unknown",
"modalities": [
"audio"
],
"lastModifiedDateTime": "2023-09-25T10:36:40Z",
"startDateTime": "2023-09-25T09:28:38Z",
"endDateTime": "2023-09-25T09:28:41Z",
"organizer": {
"user": {
"id": "821809f5-0000-0000-0000-3b5136c0e777",
"displayName": "Abbie Wilkins",
"tenantId": "dc368399-474c-4d40-900c-6265431fd81f"
}
},
"organizer_v2@odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords('3cf3bbc8-b21d-4f2e-bfd0-b13603ae6c65')/organizer_v2/$entity",
"organizer_v2": {
"id": "821809f5-0000-0000-0000-3b5136c0e777",
"identity": {
"user": {
"id": "821809f5-0000-0000-0000-3b5136c0e777",
"displayName": "Abbie Wilkins",
"tenantId": "dc368399-474c-4d40-900c-6265431fd81f"
}
}
}
},
{
"id": "c3ad8c4b-4a87-4ab1-bef0-284d2f40ed9f",
"version": 2,
"type": "unknown",
"modalities": [
"audio"
],
"lastModifiedDateTime": "2023-09-25T14:18:13Z",
"startDateTime": "2023-09-25T14:03:36Z",
"endDateTime": "2023-09-25T14:03:40Z",
"organizer": {
"user": {
"id": "821809f5-0000-0000-0000-3b5136c0e777",
"displayName": "Abbie Wilkins",
"tenantId": "dc368399-474c-4d40-900c-6265431fd81f"
}
},
"organizer_v2@odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords('c3ad8c4b-4a87-4ab1-bef0-284d2f40ed9f')/organizer_v2/$entity",
"organizer_v2": {
"id": "+5564981205182",
"identity": {
"user": null,
"acsUser": null,
"spoolUser": null,
"phone": {
"id": "+5564981205182",
"displayName": null,
"tenantId": null
}
}
}
}
]
}
示例 2:按 startDateTime 筛选
以下示例演示如何获取由 startDateTime 属性筛选的 callRecord 对象。
请求
以下示例显示了一个请求。
GET https://graph.microsoft.com/v1.0/communications/callRecords?$filter=startDateTime ge 2023-09-25T09:25:00Z and startDateTime lt 2023-09-25T09:30:00Z
// 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.Communications.CallRecords.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "startDateTime ge 2023-09-25T09:25:00Z and startDateTime lt 2023-09-25T09:30:00Z";
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphcommunications "github.com/microsoftgraph/msgraph-sdk-go/communications"
//other-imports
)
requestFilter := "startDateTime ge 2023-09-25T09:25:00Z and startDateTime lt 2023-09-25T09:30:00Z"
requestParameters := &graphcommunications.CommunicationsCallRecordsRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &graphcommunications.CommunicationsCallRecordsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
callRecords, err := graphClient.Communications().CallRecords().Get(context.Background(), configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.callrecords.CallRecordCollectionResponse result = graphClient.communications().callRecords().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "startDateTime ge 2023-09-25T09:25:00Z and startDateTime lt 2023-09-25T09:30:00Z";
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
let callRecords = await client.api('/communications/callRecords')
.filter('startDateTime ge 2023-09-25T09:25:00Z and startDateTime lt 2023-09-25T09:30:00Z')
.get();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Communications\CallRecords\CallRecordsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new CallRecordsRequestBuilderGetRequestConfiguration();
$queryParameters = CallRecordsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->filter = "startDateTime ge 2023-09-25T09:25:00Z and startDateTime lt 2023-09-25T09:30:00Z";
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->communications()->callRecords()->get($requestConfiguration)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.communications.call_records.call_records_request_builder import CallRecordsRequestBuilder
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 = CallRecordsRequestBuilder.CallRecordsRequestBuilderGetQueryParameters(
filter = "startDateTime ge 2023-09-25T09:25:00Z and startDateTime lt 2023-09-25T09:30:00Z",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.communications.call_records.get(request_configuration = request_configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords",
"value": [
{
"id": "3cf3bbc8-b21d-4f2e-bfd0-b13603ae6c65",
"version": 2,
"type": "unknown",
"modalities": [
"audio"
],
"lastModifiedDateTime": "2023-09-25T10:36:40Z",
"startDateTime": "2023-09-25T09:28:38Z",
"endDateTime": "2023-09-25T09:28:41Z",
"organizer": {
"user": {
"id": "821809f5-0000-0000-0000-3b5136c0e777",
"displayName": "Abbie Wilkins",
"tenantId": "dc368399-474c-4d40-900c-6265431fd81f"
}
},
"organizer_v2@odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords('3cf3bbc8-b21d-4f2e-bfd0-b13603ae6c65')/organizer_v2/$entity",
"organizer_v2": {
"id": "821809f5-0000-0000-0000-3b5136c0e777",
"identity": {
"user": {
"id": "821809f5-0000-0000-0000-3b5136c0e777",
"displayName": "Abbie Wilkins",
"tenantId": "dc368399-474c-4d40-900c-6265431fd81f"
}
}
}
}
]
}
示例 3:按参与者 ID 进行筛选
以下示例演示如何获取按参与者的 id 属性筛选的 callRecord 对象。
请求
以下示例显示了一个请求。
GET https://graph.microsoft.com/v1.0/communications/callRecords?$filter=participants_v2/any(p:p/id eq '821809f5-0000-0000-0000-3b5136c0e777')
// 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.Communications.CallRecords.GetAsync((requestConfiguration) =>
{
requestConfiguration.QueryParameters.Filter = "participants_v2/any(p:p/id eq '821809f5-0000-0000-0000-3b5136c0e777')";
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphcommunications "github.com/microsoftgraph/msgraph-sdk-go/communications"
//other-imports
)
requestFilter := "participants_v2/any(p:p/id eq '821809f5-0000-0000-0000-3b5136c0e777')"
requestParameters := &graphcommunications.CommunicationsCallRecordsRequestBuilderGetQueryParameters{
Filter: &requestFilter,
}
configuration := &graphcommunications.CommunicationsCallRecordsRequestBuilderGetRequestConfiguration{
QueryParameters: requestParameters,
}
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
callRecords, err := graphClient.Communications().CallRecords().Get(context.Background(), configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.models.callrecords.CallRecordCollectionResponse result = graphClient.communications().callRecords().get(requestConfiguration -> {
requestConfiguration.queryParameters.filter = "participants_v2/any(p:p/id eq '821809f5-0000-0000-0000-3b5136c0e777')";
});
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
const options = {
authProvider,
};
const client = Client.init(options);
let callRecords = await client.api('/communications/callRecords')
.filter('participants_v2/any(p:p/id eq \'821809f5-0000-0000-0000-3b5136c0e777\')')
.get();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Communications\CallRecords\CallRecordsRequestBuilderGetRequestConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestConfiguration = new CallRecordsRequestBuilderGetRequestConfiguration();
$queryParameters = CallRecordsRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->filter = "participants_v2/any(p:p/id eq '821809f5-0000-0000-0000-3b5136c0e777')";
$requestConfiguration->queryParameters = $queryParameters;
$result = $graphServiceClient->communications()->callRecords()->get($requestConfiguration)->wait();
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.communications.call_records.call_records_request_builder import CallRecordsRequestBuilder
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 = CallRecordsRequestBuilder.CallRecordsRequestBuilderGetQueryParameters(
filter = "participants_v2/any(p:p/id eq '821809f5-0000-0000-0000-3b5136c0e777')",
)
request_configuration = RequestConfiguration(
query_parameters = query_params,
)
result = await graph_client.communications.call_records.get(request_configuration = request_configuration)
有关如何将 SDK 添加到项目并创建 authProvider 实例的详细信息,请参阅 SDK 文档。
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords",
"value": [
{
"id": "3cf3bbc8-b21d-4f2e-bfd0-b13603ae6c65",
"version": 2,
"type": "unknown",
"modalities": [
"audio"
],
"lastModifiedDateTime": "2023-09-25T10:36:40Z",
"startDateTime": "2023-09-25T09:28:38Z",
"endDateTime": "2023-09-25T09:28:41Z",
"organizer": {
"user": {
"id": "821809f5-0000-0000-0000-3b5136c0e777",
"displayName": "Abbie Wilkins",
"tenantId": "dc368399-474c-4d40-900c-6265431fd81f"
}
},
"organizer_v2@odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords('3cf3bbc8-b21d-4f2e-bfd0-b13603ae6c65')/organizer_v2/$entity",
"organizer_v2": {
"id": "821809f5-0000-0000-0000-3b5136c0e777",
"identity": {
"user": {
"id": "821809f5-0000-0000-0000-3b5136c0e777",
"displayName": "Abbie Wilkins",
"tenantId": "dc368399-474c-4d40-900c-6265431fd81f"
}
}
}
}
]
}
另请参阅
有关使用呼叫记录的详细信息,请参阅 callRecord。