如何从基于列表的Feed网址获取Google表格的网址?

时间:2016-01-01 23:24:13

标签: google-api google-sheets google-spreadsheet-api

在我的应用程序中,我使用Google表格API检索电子表格中工作表的基于列表的供稿网址。

是否可以在spreadsheets.google.com上获取可查看工作表的网址,以便我可以让我的应用程序将用户的默认网络浏览器启动到完全可编辑的工作表?

从我得到的API响应中,我发现link数组中rel值为alternate的第一个网址为我提供了电子表格的链接,但它打开了第一个工作表中的电子表格" tab"而不是我想要的实际工作表。我很好奇是否有办法获取工作表本身的URL。也就是说,我想基于我使用的列表提要打开一个新的浏览器到工作表,而不仅仅是第一个"标签"在电子表格中:

"link": [
  {
    "rel": "alternate",
    "type": "application/atom+xml",
    "href": "https://docs.google.com/spreadsheets/d/{unique_key}/edit"
  },
  {
    "rel": "http://schemas.google.com/g/2005#feed",
    "type": "application/atom+xml",
    "href": "https://spreadsheets.google.com/feeds/worksheets/{unique_key}/private/full"
  },
  {
    "rel": "http://schemas.google.com/g/2005#post",
    "type": "application/atom+xml",
    "href": "https://spreadsheets.google.com/feeds/worksheets/{unique_key}/private/full"
  },
  {
    "rel": "self",
    "type": "application/atom+xml",
    "href": "https://spreadsheets.google.com/feeds/worksheets/{unique_key}/private/full?alt=json"
  }

0 个答案:

没有答案
相关问题