I use golang, following the quickstart.go at https://developers.google.com/gmail/api/quickstart/go.
Firstly, it worked fine to list lables. But I found it no ways to grant permission for sending emails, so I revoke the token and try to keep everything reset. After revoking the token, I cannot grant permissions again. It always results in the following error:
Get https://www.googleapis.com/gmail/v1/users/me/labels?alt=json: oauth2: cannot fetch token: 400 Bad Request Response: { "error" : "invalid_grant", "error_description" : "Token has been revoked." }
How can I fix this. Please help me. Thank you.