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

PERMISSION_DENIE 'cloudmessaging.messages.create' denied on resource

FCM http v1 :  Getting  error  https://fcm.googleapis.com/v1/projects/mynpstpushnotify/messages:send

through postman or resttemplate  getting below error

403 FORBIDDEN - {
"error": {
"code": 403,
"message": "Permission 'cloudmessaging.messages.create' denied on resource '//cloudresourcemanager.googleapis.com/projects/mynpstpushnotify' (or it may not exist).",
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "IAM_PERMISSION_DENIED",
"domain": "cloudresourcemanager.googleapis.com",
"metadata": {
"resource": "projects/mynpstpushnotify",
"permission": "cloudmessaging.messages.create"
}
}
]
}

1 4 3,950
4 REPLIES 4

You should check if the service account or user making the request has the right permissions, like the Firebase Cloud Messaging Sender role. Also, make sure your project actually exists and is set up correctly in the Google Cloud Console, and that the FCM API is enabled. If you're using a service account, double-check that the key is correct and not expired. If you're on a trial account, there might be some limitations, so upgrading could help. If none of this works, reaching out to Google Cloud support might be your best bet.

Hi @arunagirinathan. Thank you for posting your question. And thank you @yrhsk for providing some guidance. Wanted to follow up to make sure you got what you needed. Let us know how we can support you. 

I encounter this issue before. I fixed this by creating a new service account at FCM Service Accounts.

After creating a new service account, Manage it's permission and assign it's role to Owner as seen in the image below:

error image

Then after assigning it's role, go back to FCM Service Accounts, in the right hand side click the three dot menu and proceed to Manage Keys.

Once you are there you can generate a new key and save it as JSON. Replace your current JSON file and then try to initiate your application.

Hope this helps!

I encounter this issue before. I fixed this by creating a new service account at FCM Service Accounts.

After creating a new service account, Manage it's permission and assign it's role to Owner as seen in the image below:

1E3ix.png

 

Then after assigning it's role, go back to FCM Service Accounts, in the right hand side click the three dot menu and proceed to Manage Keys.

Once you are there you can generate a new key and save it as JSON. Replace your current JSON file and then try to initiate your application.

Hope this helps!