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:403对'projects / xxxx / agent'的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'
推荐答案
无需创建新的代理。您可以编辑现有的代理IAM。
There is no need for creating a new Agent. You can edit the existing agents IAM.
- 在Dialogflow的控制台中,转到常规标签下的设置⚙>,您将看到项目带有Google Cloud链接的ID部分,以打开Google Cloud控制台>打开Google Cloud。
- 在Google Cloud中,转到成员标签下的IAM管理员> IAM。找到您的代理商名称,然后单击编辑。
- 授予代理管理员权限以授予列出意图。
这篇关于PermissionDenied:403 IAM权限“ dialogflow.intents.list”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!