The error message occurs when https://www.googleapis.com/auth/gmail.metadata
is included in the scopes. But in your scopes, it is not used. So please confirm the following points again.
- If the refresh token is retrieved in your script, please remove it and authorize again using the scopes without
https://www.googleapis.com/auth/gmail.metadata
.
- If you use Google APIs Explorer, please remove Google APIs Explorer at https://myaccount.google.com/permissions.
- Please login and remove it.
After you did above, please use the API of endpoint by authorizing using the scopes without https://www.googleapis.com/auth/gmail.metadata
.
If this was not useful for you, I'm sorry.