Slynus
Slynus

Reputation: 35

What is the IAM role needed for grant the IAM right "dialogflow.agents.restore" on GCP

I'm trying to use DialogFlow Agent API using HTTP calls but it seem that I didn't have the right to use it. I don't find the right IAM role for using it.

I've tried to give all IAM roles related to DialogFlow to the service account that I use but I always get an HTTP 403 error. I know that my authentification is correct because I can call others API from DialogFlow.

There is the curl request that I use.

curl -X POST \
  https://dialogflow.googleapis.com/v2/projects/<AGENT_NAME>/agent:restore \
  -H 'Authorization: <BEARER_TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
  "agentContent": "<ZIP_FILE_BASE64>"
}'

There is the response given by the API.

{
    "error": {
        "code": 403,
        "message": "IAM permission 'dialogflow.agents.restore' on 'projects/<AGENT_NAME>' denied.",
        "status": "PERMISSION_DENIED"
    }
}

Upvotes: 1

Views: 667

Answers (1)

Himal
Himal

Reputation: 3492

There are 4 roles which provide dialogflow.agents.restore.

enter image description here

You'll want to make sure the IAM owner of the token in the request has at least one of these roles assigned to it under the appropriate project.

Upvotes: 2

Related Questions