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 = "[email protected]";
            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 
[email protected] ...
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

-- 
You received this message because you are subscribed to the Google Groups 
"Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-apps-mgmt-apis/-/im6gAkeaZ38J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-apps-mgmt-apis?hl=en.

Reply via email to