启用 Customer Experience Insights

在使用 Customer Experience Insights (CX Insights) 分析对话数据之前,您必须启用特定的 API。

在本快速入门中,您将完成以下操作:

  1. 启用 API:

  2. 向 Contact Center AI Insights API 发送请求并接收响应。

  3. (可选)将 CX Insights 与 VPC Service Controls 搭配使用。

准备工作

您的组织定义的安全限制条件可能会导致您无法完成以下步骤。如需了解相关问题排查信息,请参阅 在受限的环境中开发应用 Google Cloud 。

  1. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  2. Verify that billing is enabled for your Google Cloud project.

  3. Enable the Cloud Speech-to-Text, Cloud Storage, Contact Center AI Insights, Dialogflow, and Sensitive Data Protection (DLP) APIs.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

    Enable the APIs

发送请求并接收响应

  1. 安装并设置 Google Cloud CLI。您可以在以下开发环境之一中设置 gcloud CLI:

    Cloud Shell

    如需使用已设置 gcloud CLI 的在线终端,请激活 Cloud Shell:

    Cloud Shell 会话会在页面底部启动,并显示命令行提示符。该会话可能需要几秒钟来完成初始化。

    本地 shell

    如需使用本地开发环境,请按照以下步骤操作:

    1. 安装 gcloud CLI。
    2. 初始化 gcloud CLI。

  2. 为您的用户账号创建本地身份验证凭证:

    gcloud auth application-default login

    如果返回了身份验证错误,并且您使用的是外部身份提供方 (IdP),请确认您已 使用联合身份登录 gcloud CLI。

  3. 运行以下命令以验证设置,该命令会列出您的所有 CX Insights 对话。

    curl -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" "https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/conversations"
    

    替换以下内容:

    • PROJECT_ID:您的 Google Cloud 项目 ID。
    • LOCATION:您运行此请求的 区域。

    该命令应返回一个空字典:{}。

可选:将 CX Insights 与 VPC Service Controls 搭配使用

如需将 CX Insights 与 VPC Service Controls 搭配使用,请将 CX Insights 添加到您的安全边界。如需了解详情,请参阅 VPC Service Controls 文档。

后续步骤