获取 callRecord

命名空间:microsoft.graph.callRecords

检索 callRecord 对象的属性和关系。

可以通过两种方式获取 callRecordID

  • 订阅终结点的/communications/callRecords更改通知
  • 使用调用callChainId 属性。 只有在关联的调用完成后,呼叫记录才可用。

警告

通话记录在通话或会议结束后创建,并保留 30 天。 此 API 不会返回超过 30 天的调用记录,并且对此类记录的请求会导致 404 Not Found 响应代码。

此 API 可用于以下国家级云部署

全局服务 美国政府 L4 美国政府 L5 (DOD) 由世纪互联运营的中国

权限

为此 API 选择标记为最低特权的权限。 只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考

权限类型 最低特权权限 更高特权权限
委派(工作或学校帐户) 不支持。 不支持。
委派(个人 Microsoft 帐户) 不支持。 不支持。
应用程序 CallRecords.Read.All 不可用。

HTTP 请求

GET /communications/callRecords/{id}

可选的查询参数

此方法支持以下 OData 查询参数来帮助自定义响应。 若要了解一般信息,请参阅 OData 查询参数

名称 说明
$select 使用 $select 查询参数返回一组不同于单个资源的默认集或资源集合的属性。 仅支持 callRecord会话 资源。
$expand $expand使用查询参数可以包含单个关系引用的扩展资源或集合, (结果中) participants_v2会话。 有关示例,请参阅 获取会话和段详细信息

请求标头

名称 说明
Authorization 持有者 {token}。 必填。 详细了解 身份验证和授权
首选:odata.maxpagesize={x} 指定分页结果的首选整数 {x} 页大小。 可选。 此值必须等于或小于允许的最大页面大小。
首选:include-unknown-enum-members 启用超出 sentinel 值的可演变枚举值。 有关详细信息,请参阅 使用 Microsoft Graph 的最佳做法。 可选。
首选:omit-values=nulls 从响应中删除 null 或空值。 可选。

请求正文

请勿提供此方法的请求正文。

响应

如果成功,此方法在 200 OK 响应正文中返回响应代码和 microsoft.graph.callRecords.callRecord 对象。 对超过 30 天的呼叫记录的请求将 404 Not Found 返回响应代码。

当结果集跨越多个页面时,Microsoft Graph 在响应中包含指向下一页结果的 URL 的@odata.nextLink 属性返回该页面。 如果该属性存在,请继续在每个响应中使用 @odata.nextLink URL 发出其他请求,直到返回所有结果。 有关详细信息,请参阅在应用中对 Microsoft Graph 数据进行分页。 最大页面大小:参与者为 130 个条目,会话为 60 个条目。

示例

示例 1:获取基本详细信息

以下示例演示如何从 callRecord 获取基本详细信息。

请求

以下示例显示了一个请求。

GET https://graph.microsoft.com/v1.0/communications/callRecords/e523d2ed-2966-4b6b-925b-754a88034cc5

响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 200 OK
Content-type: application/json

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords/$entity",
  "version": 1,
  "type": "peerToPeer",
  "modalities": [
    "audio"
  ],
  "lastModifiedDateTime": "2020-02-25T19:00:24.582757Z",
  "startDateTime": "2020-02-25T18:52:21.2169889Z",
  "endDateTime": "2020-02-25T18:52:46.7640013Z",
  "id": "e523d2ed-2966-4b6b-925b-754a88034cc5",
  "organizer_v2@odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords('e523d2ed-2966-4b6b-925b-754a88034cc5')/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"
      }
    }
  },
  "participants_v2@odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords('e523d2ed-2966-4b6b-925b-754a88034cc5')/participants_v2/$entity"
}

示例 2:获取会话和段详细信息

以下示例演示如何从 callRecord 获取完整的会话和段详细信息。

请求

以下示例显示了一个请求。

GET https://graph.microsoft.com/v1.0/communications/callRecords/e523d2ed-2966-4b6b-925b-754a88034cc5?$expand=sessions($expand=segments)

响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 200 OK
Content-type: application/json

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords(sessions(segments()))/$entity",
  "version": 1,
  "type": "peerToPeer",
  "modalities": [
    "audio"
  ],
  "lastModifiedDateTime": "2020-02-25T19:00:24.582757Z",
  "startDateTime": "2020-02-25T18:52:21.2169889Z",
  "endDateTime": "2020-02-25T18:52:46.7640013Z",
  "id": "e523d2ed-2966-4b6b-925b-754a88034cc5",
  "organizer_v2@odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords('e523d2ed-2966-4b6b-925b-754a88034cc5')/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"
      }
    }
  },
  "participants_v2@odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords('e523d2ed-2966-4b6b-925b-754a88034cc5')/participants_v2/$entity",
  "sessions": [
    {
      "modalities": [
        "audio"
      ],
      "startDateTime": "2020-02-25T18:52:21.2169889Z",
      "endDateTime": "2020-02-25T18:52:46.7640013Z",
      "id": "e523d2ed-2966-4b6b-925b-754a88034cc5",
      "isTest": false,
      "caller": {
        "@odata.type": "#microsoft.graph.callRecords.participantEndpoint",
        "name": "machineName_2",
        "userAgent": {
          "@odata.type": "#microsoft.graph.callRecords.clientUserAgent",
          "headerValue": "RTCC/7.0.0.0 UCWA/7.0.0.0 AndroidLync/6.25.0.27 (SM-G930U Android 8.0.0)",
          "platform": "android",
          "productFamily": "skypeForBusiness"
        },
        "associatedIdentity": {
          "id": "821809f5-0000-0000-0000-3b5136c0e777",
          "displayName": "Abbie Wilkins",
          "tenantId": "dc368399-474c-4d40-900c-6265431fd81f",
          "userPrincipalName": "abbie.wilkins@contoso.com"
        }
      },
      "callee": {
        "@odata.type": "#microsoft.graph.callRecords.participantEndpoint",
        "name": "machineName_4",
        "userAgent": {
          "@odata.type": "#microsoft.graph.callRecords.clientUserAgent",
          "headerValue": "UCCAPI/16.0.12527.20122 OC/16.0.12527.20194 (Skype for Business)",
          "platform": "windows",
          "productFamily": "skypeForBusiness"
        },
        "associatedIdentity": {
          "id": "f69e2c00-0000-0000-0000-185e5f5f5d8a",
          "displayName": "Owen Franklin",
          "tenantId": "dc368399-474c-4d40-900c-6265431fd81f",
          "userPrincipalName": "owen.franklin@contoso.com"
        },
        "feedback": {
          "rating": "poor"
        }
      },
      "segments": [
        {
          "startDateTime": "2020-02-25T18:52:21.2169889Z",
          "endDateTime": "2020-02-25T18:52:46.7640013Z",
          "id": "e523d2ed-2966-4b6b-925b-754a88034cc5",
          "media": [
            {
              "label": "main-audio",
              "callerNetwork": {
                "ipAddress": "10.150.0.2",
                "subnet": "10.150.0.0",
                "linkSpeed": 54000000
              },
              "callerDevice": {
                "captureDeviceName": "Default input device",
                "renderDeviceName": "Default output device",
                "receivedSignalLevel": -10
              },
              "streams": [
                {
                  "streamId": "1504545584",
                  "streamDirection": "callerToCallee",
                  "averageAudioDegradation": null,
                  "averageJitter": "PT0.016S"
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "sessions@odata.nextLink": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords('e523d2ed-2966-4b6b-925b-754a88034cc5')/sessions?$expand=segments&$skiptoken=abc"
}

示例 3:获取参与者详细信息

以下示例演示如何展开 callRecord 的完整分页参与者列表。

请求

以下示例显示了一个请求。

GET https://graph.microsoft.com/v1.0/communications/callRecords/e523d2ed-2966-4b6b-925b-754a88034cc5?$expand=participants_v2

响应

以下示例显示了相应的响应。

注意:为了提高可读性,可能缩短了此处显示的响应对象。

HTTP/1.1 200 OK
Content-type: application/json

{
  "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords(participants_v2())/$entity",
  "version": 1,
  "type": "peerToPeer",
  "modalities": [
    "audio"
  ],
  "lastModifiedDateTime": "2020-02-25T19:00:24.582757Z",
  "startDateTime": "2020-02-25T18:52:21.2169889Z",
  "endDateTime": "2020-02-25T18:52:46.7640013Z",
  "id": "e523d2ed-2966-4b6b-925b-754a88034cc5",
  "organizer_v2@odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords('e523d2ed-2966-4b6b-925b-754a88034cc5')/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"
      }
    }
  },
  "participants_v2@odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords('e523d2ed-2966-4b6b-925b-754a88034cc5')/participants_v2/$entity",
  "participants_v2@odata.nextLink": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords('e523d2ed-2966-4b6b-925b-754a88034cc5')/participants_v2?$skiptoken=abc",
  "participants_v2": [
    {
      "id": "821809f5-0000-0000-0000-3b5136c0e777",
      "identity": {
        "user": {
          "id": "821809f5-0000-0000-0000-3b5136c0e777",
          "displayName": "Abbie Wilkins",
          "tenantId": "dc368399-474c-4d40-900c-6265431fd81f",
          "userPrincipalName": "abbie.wilkins@contoso.com"
        }
      }
    },
    {
      "id": "821809f5-0000-0000-0000-3b5136c0e777",
      "identity": {
        "user": {
          "id": "f69e2c00-0000-0000-0000-185e5f5f5d8a",
          "displayName": "Owen Franklin",
          "tenantId": "dc368399-474c-4d40-900c-6265431fd81f",
          "userPrincipalName": "owen.franklin@contoso.com"
        }
      }
    }
  ]
}