Vacation Responder Date Setting

53 views
Skip to first unread message

Corry Dringenburg

unread,
Aug 25, 2011, 9:15:03 AM8/25/11
to google-app...@googlegroups.com
Hello, 

We have written an application that we can use to set the vacation responder settings on someones email account. After some testing, I have found a bug in the way the API works. When setting the start and the end date, it always sets them 1 day behind, i.e. if I set start date to Aug 23 and the end to Aug 27 in the app, it sets the actual dates in the Gmail settings to Aug 22 and Aug 26. And when I use the API to get the Entry back from the feed, the Entry says the start is Aug 23 and the end is Aug 27, like I set in the app. 

Another thing I noticed, if you set the start and/or end date in the Gmail Settings, the API will bring back the correct date, i.e. if I set start to Aug 23 in the Gmail settings and use the API to get the Entry from the feed, the Entry says the start is Aug 23.

Thanks,
Corry

Claudio Cherubino

unread,
Aug 25, 2011, 1:41:34 PM8/25/11
to google-app...@googlegroups.com
Hi Corry,

Which timezone are you in?
Can you show us your code and a capture of the XML request/response? 
Does the response contain the date you specified in the request or a different one?

Claudio

--
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/-/BPYh2n7kPCAJ.
To post to this group, send email to google-app...@googlegroups.com.
To unsubscribe from this group, send email to google-apps-mgmt...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-apps-mgmt-apis?hl=en.

Corry Dringenburg

unread,
Aug 25, 2011, 2:03:22 PM8/25/11
to google-app...@googlegroups.com
I am in EST, but it shouldn't matter because the dates are passed around as formatted strings.

Here is a test program I wrote in Java. Its sets the vacation responder with the API using a hardcoded entry, then pulls back the entry and prints it out: 


public class VacationTest {
    public static void main(String[] args) {
         System.out.println("Program start");
         setVacation();
         getVacation();
         System.out.println("Program finish");
    }
    
    public static void setVacation(){
        GmailSettingsService serv = null;

        try{
            serv = new GmailSettingsService("your-apps", "XXXXXX.XXX", "XXXXXX", "XXXXXX");
        }catch(Exception e){
            e.printStackTrace();
            System.out.println("new service threw exception");
        }
        System.out.println("Creating entry");
        GenericEntry ent = new GenericEntry();

        ent.addProperty("enable", "true");
        ent.addProperty("contactsOnly", "true");
        ent.addProperty("domainOnly", "false");
        ent.addProperty("subject", "Test");
        ent.addProperty("message", "test");
        ent.addProperty("startDate", "2011-08-23");
        ent.addProperty("endDate", "2011-08-27");
        
        ent.validate();
        
        URL url = null;
        try{
        }catch(Exception e){
            e.printStackTrace();
            System.out.println("new url threw exception");
        }

        try{
            System.out.println("Sending entry");
            serv.update(url, ent);
        }catch(Exception e){
            e.printStackTrace();
            System.out.println("update threw exception");
        }
    }
    
    public static void getVacation(){
         GmailSettingsService serv = null;

        try{
            serv = new GmailSettingsService("your-apps", "XXXXXX.XXX", "XXXXXX", "XXXXXX");
        }catch(Exception e){
            e.printStackTrace();
        }
        
        URL url = null;
        try{
            url = new URL("https://apps-apis.google.com/a/feeds/emailsettings/2.0/XXXXXX.XXX/XXXXXX/XXXXXX");
        }catch(Exception e){
            e.printStackTrace();
        }
        
        GenericEntry entry = null;
        
        try{
           entry = serv.getEntry(url, GenericEntry.class);
        }catch(Exception e){
            e.printStackTrace();
        }
        
        Map map = entry.getAllProperties();
        
        Iterator iterator = map.keySet().iterator();  
   
        System.out.println("Printing entry");
        while (iterator.hasNext()) {  
           String key = iterator.next().toString();  
           String value = map.get(key).toString();  

           System.out.println(key + " : " + value);  
        }  
    }
}


Here is a screen clip of my output window:


And here is a screen clip of the actual Gmail Settings page: 


Claudio Cherubino

unread,
Aug 25, 2011, 2:33:03 PM8/25/11
to google-app...@googlegroups.com
Hi Corry,

I managed to reproduce the issue in my test domain and I asked the engineers to investigate the issue.
I'll get back to you as soon as I get an update from them.
Thanks for reporting the issue and providing the sample code.

Claudio


--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
Reply all
Reply to author
Forward
0 new messages