PermissionDenied:403 IAM 权限“dialogflow.intents.list" [英] PermissionDenied: 403 IAM permission 'dialogflow.intents.list'
问题描述
我正在尝试使用 Dialogflow 的 V2 API 获取我的 Dialogflow 代理中的意图列表,但出现以下错误:
I'm trying to get the list of the intents in my Dialogflow agent using Dialogflow's V2 APIs but have been getting the following error:
PermissionDenied:projects/xxxx/agent"上的 403 IAM 权限dialogflow.intents.list"被拒绝.
我采取了以下步骤:
- 我为它创建了一个新代理(启用了 V2 API)和一个新服务帐户.
- 我下载了 JSON 密钥并将我的 GOOGLE_APPLICATION_CREDENTIALS 变量设置为其路径.
以下是我的代码:
import dialogflow_v2 as dialogflow
os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="/home/user/folder/service-account-key.json"
client=dialogflow.IntentsClient()
parent = client.project_agent_path('[PROJECT_ID]')
for element in client.list_intents(parent):
pass
我创建了各种代理和服务帐户,甚至将角色从管理员更改为客户端,但找不到任何解决方案.我尝试了以下解决方案,但没有成功
I have made various agents and service accounts and even changed the role from Admin to Client but can't figure out any solution. I tried the following solution but didnt' work
尝试的解决方案:DialogFlow PermissionDenied:403 IAM 权限 'dialogflow.sessions.detectIntent'
推荐答案
无需创建新的 Agent.您可以编辑现有的代理 IAM.
There is no need for creating a new Agent. You can edit the existing agents IAM.
- 在 Dialogflow 的控制台中,转到设置 ⚙ > 在常规选项卡下,您会看到项目 ID 部分,其中包含用于打开 Google Cloud 控制台的 Google Cloud 链接 > 打开 Google Cloud.
- 在谷歌云中,转至成员选项卡下的 IAM 管理 > IAM.找到您的代理的名称,然后单击编辑.
- 向代理授予管理员权限以授予列出意图的权限.
这篇关于PermissionDenied:403 IAM 权限“dialogflow.intents.list"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!