1
votes

I'm getting forbidden 403 error when hitting Gmail API get message through postman please help me how to solve this. error

https://www.googleapis.com/gmail/v1/users/userId/messages this url for getting message list

https://www.googleapis.com/gmail/v1/users/userId/messages/id this is for getting message for particular id

I can able to hit the get message list API but get Message API not working for me

I'M doing all these stuff through postman

error message :

{
"error": {
    "errors": [
        {
            "domain": "global",
            "reason": "forbidden",
            "message": "Metadata scope doesn't allow format FULL"
        }
    ],
    "code": 403,
    "message": "Metadata scope doesn't allow format FULL"
}

}

1
You likely didn't give proper credentials to the API.JacopoStanchi
According to my knowledge I'm giving all required credentials, if possible please mention credentials information.means what I have to use.@JacopoStanchiprahan
Have you checked the workaround here?MαπμQμαπkγVπ.0

1 Answers

0
votes

This is another disappointing design in the Gmail API. I resolved this issue with the following steps:

  1. Remove GmailScopes.GMAIL_METADATA from scopes setup.
  2. Remove the credential file from your local FileSystem. This file is generated by Google's Authorization Flow which store your credential locally.
  3. Re authorize your app by signing in again https://accounts.google.com/o/oauth2/auth?access_type=offline....

Hope this helps you guys out.