0

I am using gmail-api I am getting insufficient permission for deleting mails.

I had the scope as { GmailScopes.GMAIL_LABELS,GmailScopes.GMAIL_INSERT,GmailScopes.GMAIL_MODIFY,GmailScopes.GMAIL_COMPOSE,GmailScopes.MAIL_GOOGLE_COM };

After seeing answer for same issue, i tried changing to

SCOPES = { GmailScopes.GMAIL_LABELS,GmailScopes.GMAIL_INSERT,GmailScopes.GMAIL_MODIFY,GmailScopes.GMAIL_COMPOSE,"https://mail.google.com/" };

but gets same issue

When i check for apps permissions at https://security.google.com/settings/security/permissions?pli=1

it says app doesnt have permission to delete mails. It has other permissions and other operations are working as expected. Please help

png
  • 4,368
  • 7
  • 69
  • 118
  • You need to get a new `refresh_token`, since your last one has not run out yet. You can [force a prompt](http://stackoverflow.com/questions/8942340/get-refresh-token-google-api) or delete the one you already have. – Tholle May 10 '16 at 08:43
  • i dont use any access token in my code. i have registered my app with the package name and sha1 – png May 10 '16 at 10:08
  • Have you tried or checked if you have the correct format of setting the scopes of the API? Kindly check this [Gmail API: Insufficient Permission](http://stackoverflow.com/questions/30661489/gmail-api-insufficient-permission?rq=1) for formatting purpose? I hope this helps. Goodluck – Mr.Rebot May 11 '16 at 06:35
  • yes, thats exactly what i tried by replacing GmailScopes.MAIL_GOOGLE_COM with "https://mail.google.com/" . but it didnt help . – png May 11 '16 at 08:38
  • can you get it to work here: https://developers.google.com/apis-explorer/#p/gmail/v1/gmail.users.messages.delete – Tony BenBrahim May 26 '16 at 13:58
  • No even that is not working. It ask me to authorize , there the scope selected is "https://mail.google.com/" . But i am getting invalid id error.I got message id from the mail option "show original" and the id for eg is Message-ID: <2.25696a43c4dd66f090f9@NY-WEB01> . I tried <2.25696a43c4dd66f090f9@NY-WEB01> and without <> also. But got response "code": 400, "message": "Invalid id value" – png May 30 '16 at 06:44
  • It s working . I got the ids using messages.list api , and then tried. Then its successfully deleted . And the permission was only https://mail.google.com/ – png May 31 '16 at 12:57
  • but for the same account it s not working when i try from my app – png Jun 01 '16 at 07:14

0 Answers0