I want to create an empty label in Google apps using Google Mail API. Using Below code:
MailItemService mailItemService = new MailItemService(domain, "Sample Migration Application");
mailItemService.setUserCredentials(userEmail, password);
MailItemEntry[] entries = new MailItemEntry[1];
entries[0] = new MailItemEntry();
entries[0].Labels.Add(new LabelElement("Empty Label"));
entries[0].BatchData = new GDataBatchEntryData();
entries[0].BatchData.Id = "0";
MailItemFeed feed = mailItemService.Batch(domain, username, entries);
Above code is not giving any error but not creating 开发者_StackOverflow社区label also.
If i assign some more values to entries it work nicely but it result in cretion of mail inside Label (But i want empty label)
Can anyone help me out here?
Thanx
You should use the Email Settings API to create labels for an user:
http://code.google.com/googleapps/domain/email_settings/developers_guide_protocol.html#GA_email_label_main
精彩评论