启用 Customer Experience Insights
在使用 Customer Experience Insights (CX Insights) 分析对话数据之前,您必须启用特定的 API。
在本快速入门中,您将完成以下操作:
启用 API:
- Cloud Speech-to-Text API:用于上传音频文件。
- Cloud Storage API:用于将对话数据注入到 CX Insights 中。
- Contact Center AI Insights API:用于使用 CX Insights。
- Dialogflow API:用于支持 Dialogflow 运行时集成 和主题建模。
- Sensitive Data Protection (DLP) API:用于执行 对音频或转录文件进行修订。
向 Contact Center AI Insights API 发送请求并接收响应。
(可选)将 CX Insights 与 VPC Service Controls 搭配使用。
准备工作
您的组织定义的安全限制条件可能会导致您无法完成以下步骤。如需了解相关问题排查信息,请参阅 在受限的环境中开发应用 Google Cloud 。
-
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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
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
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.
发送请求并接收响应
安装并设置 Google Cloud CLI。您可以在以下开发环境之一中设置 gcloud CLI:
Cloud Shell
如需使用已设置 gcloud CLI 的在线终端,请激活 Cloud Shell:
Cloud Shell 会话会在页面底部启动,并显示命令行提示符。该会话可能需要几秒钟来完成初始化。
本地 shell
如需使用本地开发环境,请按照以下步骤操作:
-
为您的用户账号创建本地身份验证凭证:
gcloud auth application-default login
如果返回了身份验证错误,并且您使用的是外部身份提供方 (IdP),请确认您已 使用联合身份登录 gcloud CLI。
运行以下命令以验证设置,该命令会列出您的所有 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 文档。