问题描述
|
我正在尝试使用Google Apps电子邮件迁移API开发winform应用程序。我也想使用2条腿的oAuth。
我已成功将2条腿式oAuth与通讯录数据API结合使用。为此,我在“管理客户端API访问权限”页面上设置了API范围\“ http:// s://www.google.com/m8/feeds/ \”。 (http://www.google.com/support/a/bin/answer.py?hl=zh_CN&answer=162106)
对于“电子邮件迁移API”,我将范围设置为\“ https://apps-apis.google.com/a/feeds/migration \”。但是我收到“ 401:未经授权的访问”错误。
我的代码是这样的:
GOAuthRequestFactory requestFactory = new GOAuthRequestFactory(\"MailItemService\",\"company-application-v1\");
requestFactory.ConsumerKey = \"domainname\";
requestFactory.ConsumerSecret = \"consumersecret\";
MailItemService mailItemService = new MailItemService(\"domainname\",\"company-application-v1\");
mailItemService.RequestFactory = requestFactory;
MailItemEntry entry = new MailItemEntry();
entry.Rfc822Msg = new Rfc822MsgElement(rfcTextOfMessage);
entry.MailItemProperties.Add(MailItemPropertyElement.STARRED);
entry.MailItemProperties.Add(MailItemPropertyElement.UNREAD);
entry.MailItemProperties.Add(MailItemPropertyElement.INBOX);
entry.Labels.Add(new LabelElement(\"Friends\"));
entry.Labels.Add(new LabelElement(\"Event Invitations\"));
entry.BatchData = new GDataBatchEntryData();
entry.BatchData.Id = \"0\";
MailItemEntry[] entries = new MailItemEntry[1];
entries[0] = entry;
MailItemFeed feed = mailItemService.Batch(\"domainname\",user,entries);
我们如何使用电子邮件迁移API实施2条腿的oAuth。
谢谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)