Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

I'm unable to access v2 Translation api with an API KEY over REST

For sometime now I've been trying to call this api https://translation.googleapis.com/language/translate/v2?key=AIzaSyC-... With the necessary headers and application/json body and yet I keep getting these set of errors.

{
    "error": {
        "code": 403,
        "message": "Caller does not have required permission to use project ...........-. Grant the caller the roles/serviceusage.serviceUsageConsumer role, or a custom role with the serviceusage.services.use permission, by visiting https://console.developers.google.com/iam-admin/iam/project?project=.......... and then retry. Propagation of the new permission may take a few minutes.",
        "errors": [
            {
                "message": "Caller does not have required permission to use project ........-. Grant the caller the roles/serviceusage.serviceUsageConsumer role, or a custom role with the serviceusage.services.use permission, by visiting https://console.developers.google.com/iam-admin/iam/project?project=........ and then retry. Propagation of the new permission may take a few minutes.",
                "domain": "global",
                "reason": "forbidden"
            }
        ],
        "status": "PERMISSION_DENIED",
        "details": [
            {
                "@type": "type.googleapis.com/google.rpc.Help",
                "links": [
                    {
                        "description": "Google developer console IAM admin",
                        "url": "https://console.developers.google.com/iam-admin/iam/project?project=..........."
                    }
                ]
            },
            {
                "@type": "type.googleapis.com/google.rpc.ErrorInfo",
                "reason": "USER_PROJECT_DENIED",
                "domain": "googleapis.com",
                "metadata": {
                    "service": "translate.googleapis.com",
                    "consumer": "projects/......"
                }
            }
        ]
    }
}

 What could be wrong? Because I'm so frustrated already. Note that on this project, I have enabled the Cloud Translation API, restricted the API Key to just the Cloud Translation API. I have enabled other services as well such as the Service Usage API, API Key Admin and Cloud Resource Management. What exactly could I be doing wrong? A billing account is linked to the project as well. I'm using cloud functions and Firebase Storage Bucket already.

0 3 347
3 REPLIES 3