[英]Insert rows into google spreadsheet
I need to insert rows into Google spreadsheet. 我需要在Google电子表格中插入行。 Below is the code which I am using but not able to insert rows.
下面是我正在使用但无法插入行的代码。 There is no build issue.
没有构建问题。 Compilation was successfull.
编译成功。
SpreadsheetsService GoogleExcelService = new SpreadsheetsService("GoogleSheet");
protected void Page_Load(object sender, EventArgs e)
{
//Pass Google credentials
GoogleExcelService.setUserCredentials("user@gmail.com", "password");
ListEntry entry = new ListEntry();
//Add new row data with productname bottles and quantity 100.
entry.Elements.Add(new ListEntry.Custom() { LocalName = "productname", Value = "Bottles" });
entry.Elements.Add(new ListEntry.Custom() { LocalName = "quantity", Value = "100" });
//AtomEntry retEntry = GoogleExcelService.Insert(
AtomEntry retEntry = GoogleExcelService.Insert(new Uri("***WHAT URI I SHOULD PROVIDE HERE"), entry);
}
}
I had already spent too much time on this to figure out the issue but no luck. 我已经花了很多时间来解决这个问题,但是没有运气。 I am getting the "Execution of authentication request returned unexpected result: 404" error.
我收到“执行身份验证请求返回了意外结果:404”错误。 Please help.
请帮忙。
Are you using OAuth1.0? 您正在使用OAuth1.0吗? Based on a ticket submitted last May 2015, OAuth1.0 is now deprecated (as of May 2015) and should be migrated to OAuth2.0 use.
根据2015年5月提交的票证 ,OAuth1.0现在(自2015年5月起)已弃用,应迁移到OAuth2.0使用。 It seems to return the same error message you're encountering.
似乎返回了您遇到的相同错误消息。
More information about OAuth2.0 usage can be seen on the developer page . 有关OAuth2.0使用情况的更多信息,请参见开发人员页面 。
Hope this helps! 希望这可以帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.