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.
Hi @Miracle-N,
Welcome to Google Cloud Community!
I'm sorry to hear that you're still getting 403 error even after adding the required permissions. To isolate its possible root cause, please check if the API key on the URL is the same as the API key in your project. Also, if you have just added the serviceusage.serviceUsageConsumer role, changes may take a while for it to be applied in your project.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
Hi @cassandramae,
I have checked again, the API key in the project matches that of the URL. Where else should I add serviceusage.serviceUsageConsumer role? I have added it to my user account and I'm both an Editor and Owner on the project. If I remember correctly, I read somewhere in the docs that API Keys identify projects and they're not directly linked to a service or user account, idk. Please where else should I grant the roles/serviceusage.serviceUsageConsumer role?
I am experiencing the same and I am extremely frustrated as well. I have wasted more than 5 hours today trying to figure this out and still didn't get anything.