PermissionDenied: 403 IAM permission 'dialogflow.sessions.detectIntent' on 'projects/XXXX-live/agent' denied.
I have used the DialogFlow client as a role while creating the service.
What could be the problem?
When I was playing around with permissions with service accounts, I also encountered the same problem. I created a completely new service account and then gave it the client role, and it worked for some unknown reason. I would suggest trying to create another account and then giving it the client role and seeing if it works for that account. Also, this isn't necessarily a kosher fix per say, but if you give the account the admin role, then your problem will also be solved.
Edit: At first I thought it might have to do with how the service accounts were created (cloud console vs. command-line), but it seems that's not the case. For some reason it's just the first service account that you create that a client role doesn't work for.
I faced the same issue while integrating Dialogflow with external client.
The root cause for my case was that even though I created the service account for my external client, I forgot to add the service account and give "Dialogflow API Admin' Role.
How I resolve: In GCP project, go to IAM > click the top "+ADD" button and search for the service account that you want to grant permission access, choose role type "Dialogflow API Admin"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With