Scope doesn't match API for Email Settings

46 views
Skip to first unread message

ckarbass

unread,
Apr 10, 2011, 9:50:36 PM4/10/11
to google-app...@googlegroups.com
Is there a reason why the email setting scope is as follows:
https://apps-apis.google.com/a/feeds/email_settings/2.0/

But the base url for all requests has no underscore as follows:

When I follow both specifically, I get an authentication error.  However, when I change the scope url by removing the underscore, it seems to authenticate correctly.  Any thoughs?

Prashant Tiwari

unread,
Apr 11, 2011, 2:44:49 AM4/11/11
to google-app...@googlegroups.com
Hi,

That's a glaring mistake, the said scope is wrong and it should be


without the underscore. Thanks for pointing that out, we're going to fix it asap.

Prashant Tiwari | Google Developer Relations

Prashant Tiwari

unread,
Apr 16, 2011, 12:28:27 PM4/16/11
to google-app...@googlegroups.com
Just to send out an update: this change was done to the codesite. Please keep letting us know of such gotchas!

Thanks,
Prashant

khangulll

unread,
Aug 15, 2011, 6:23:10 AM8/15/11
to google-app...@googlegroups.com
Hello,
          I have a problem where I am getting a service forbidden exception 403 after running this piece of code. I want to change the language of my account, and ideally I would like to do it through an acquired token. I am getting the token and everything but to change the language it is not changing it.
Following is the basic code. could you please help since this is a critical task vital to our application

 public String changeLanguage()
    {
        try
        {
//            FacesContext.getCurrentInstance().getExternalContext().redirect("https://accounts.google.com/o/oauth2/auth?client_id=9999999.apps.googleusercontent.com&redirect_uri=http://localhost:8080/testproj/faces/googleConnect.xhtml&scope=https://apps-apis.google.com/a/feeds/emailsettings/2.0/&response_type=token");
            System.out.println("1");
            GmailSettingsService service = new GmailSettingsService("HamConnect", "gmail.com", "username", "password");
            System.out.println("2");
            List<String> list = new ArrayList<String>();
            System.out.println("3");
            String users = "user...@gmail.com";
            System.out.println("4");
            list.add(users);
            System.out.println("5");
            service.changeLanguage(list, "de");
            System.out.println("6");
        }
        catch(ServiceForbiddenException ex)
        {
            System.out.println("Why am I here?????????????");
            ex.printStackTrace();
        }
        catch(AuthenticationException ex)
        {
            ex.printStackTrace();
            Logger.getLogger(GoogleConnectMB.class.getName()).log(Level.SEVERE, null, ex);
        }
        catch(ServiceException ex)
        {
            ex.printStackTrace();
            Logger.getLogger(GoogleConnectMB.class.getName()).log(Level.SEVERE, null, ex);
        }
        catch (IOException ex)
        {
            Logger.getLogger(GoogleConnectMB.class.getName()).log(Level.SEVERE, null, ex);
        }
        return "";
    }

This is the out put for this code..

INFO: 1
INFO: 2
INFO: 3
INFO: 4
INFO: 5
INFO: Updating language settings ( language: ar ) for user user...@gmail.com ...
INFO: Why am I here?????????????
SEVERE: com.google.gdata.util.ServiceForbiddenException: Invalid domain.
<HTML>
<HEAD>
<TITLE>Invalid domain.</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Invalid domain.</H1>
<H2>Error 403</H2>
</BODY>
</HTML>



REgards
Reply all
Reply to author
Forward
0 new messages