API Scopes for email filter- permission issue

160 views
Skip to first unread message

Krishan Rampersaud

unread,
May 1, 2017, 2:56:08 PM5/1/17
to gshell-discuss
Hi Guys 

I spent a full day trying to figure out so far. I can't get it working. I am trying to use New-GGmailFilter  with a service account. I have domain wide delegation enabled for the service account, and I've selected the  scopes below. 


I keep getting insufficient perm.  I went though https://developers.google.com/gmail/api/auth/scopes and I think i've selected the right scopes. Has anybody been able to get this working.?


Note: I am able to use get-gmailfilter using a service account to target another users mailbox and that works fine. 








Spencer Varney

unread,
May 8, 2017, 11:03:11 AM5/8/17
to Krishan Rampersaud, gshell-discuss
Hey Krishan,

Sorry for the delay. I don't know if anyone else reached out, but be careful of choosing too many scopes - I know from experience that some scopes that are more restrictive may overwrite the more broad scopes. For instance, if you look at the details for the https://www.googleapis.com/auth/gmail.settings.basic scope, it says:

Manage basic mail settings.  

This means that if you have chosen this scope, you may find that the more broad scope of https://www.googleapis.com/auth/gmail.settings.sharing is not working as expected. You'd have to play around to figure out exactly which scopes you need, but I suspect you could try using the https://mail.google.com/ scope for full access, see if it works with that and then work down from there to see if it is indeed a scope issue.

You can find more scope information for the Gmail APIs here.

Also, I found in my own personal use that the https://mail.google.com/ scope does not actually give you access to everything - I also had to include these for my purposes, though I forget the details and the use case:

Regards,

--
You received this message because you are subscribed to the Google Groups "gshell-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gshell-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages