2015-10-06 77 views
1

我們正試圖添加一個新的電子表格到Google文檔。創建在谷歌文檔新的電子表格

我們使用的.Net 4.0.5和2.2.0 GData.Documents

最近,我們改變了我們的驗證方法到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("[email protected]", "PASSWORD"); 
    entry.Title.Text = "AddingNewSpreadsheet"; 
    entry.Categories.Add(DocumentEntry.SPREADSHEET_CATEGORY); 
    DocumentEntry newEntry = service.Insert(DocumentsListQuery.documentsBaseUri, entry); 

我們試圖根據新authe更改代碼但是我們的嘗試都沒有成功(400個錯誤的請求)。

回答

1

這不再是在谷歌API表提供(請參閱本link)。通過Google Drive API創建新的電子表格文件。

我建議服用驅動API文檔中看看參考文件Create Files。 .NET示例代碼中有一些示例可以指導您完成此任務。希望這可以幫助。