【问题标题】:Creating a new spreadsheet in google docs在谷歌文档中创建一个新的电子表格
【发布时间】:2016-01-03 06:02:07
【问题描述】:

我们正在尝试向谷歌文档添加一个新的电子表格。

我们使用 .Net 4.0.5 和 GData.Documents 2.2.0

我们最近将身份验证方法更改为 OAuth2,我们可以执行查询电子表格等操作。

我们的范围是https:// spreadsheets.google.com/feeds https:// docs.google.com/feeds https:// www.googleapis.com/auth/drive

我们创建电子表格的旧代码是:

   DocumentsService docService = new DocumentsService("Application");
   DocumentEntry entry = new DocumentEntry();
   docService.setUserCredentials("my_email@gmail.com", "PASSWORD");
   entry.Title.Text = "AddingNewSpreadsheet";
   entry.Categories.Add(DocumentEntry.SPREADSHEET_CATEGORY);
   DocumentEntry newEntry =   service.Insert(DocumentsListQuery.documentsBaseUri, entry);

我们尝试根据新的身份验证方法更改代码,但我们的尝试都没有成功(400 bad request)。

【问题讨论】:

    标签: c# gdata google-docs-api


    【解决方案1】:

    这在 Google Sheets API 中不再可用(请参阅此link)。通过 Google Drive API 创建一个新的电子表格文件。

    我建议您查看 Drive API 文档中Create Files 的参考文档。有一些带有 .NET 示例代码的示例可以指导您完成此操作。希望这可以帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-30
      • 2017-04-28
      • 1970-01-01
      • 2014-07-01
      相关资源
      最近更新 更多