使用 PHP API 获取 Google Docs 公共链接
我有一个使用 Google 文档 API 将文件上传到 Google 文档的代码。该文件已上传到公共收藏,但是如何才能发布公共链接?
完成上传后,我得到:
SimpleXMLElement Object
(
[id] => https://docs.google.com/feeds/id/file%3A0B6yYgWS-CUJ2MDczZTRlY2YtZTRiMi00MWQ2LTliYjMtMDZiYWY0YjdjNjYw
[published] => 2011-11-21T18:39:10.316Z
[updated] => 2011-11-21T18:39:10.316Z
[category] => SimpleXMLElement Object
(
[@attributes] => Array
(
[scheme] => http://schemas.google.com/g/2005#kind
[term] => http://schemas.google.com/docs/2007#file
[label] => application/zip
)
)
[title] => 4eca9acc2c339-4ec3b7436bed4-test2docx.zip
[content] => SimpleXMLElement Object
(
[@attributes] => Array
(
[type] => application/zip
[src] => https://doc-14-88-docs.googleusercontent.com/docs/securesc/fcicpk40ckisatj1kultkrrcsbo6sba3/bnpt7i1b36sn91mta24etn98ou9ce2j0/1321900200000/11381682958832082931/11381682958832082931/0B6yYgWS-CUJ2MDczZTRlY2YtZTRiMi00MWQ2LTliYjMtMDZiYWY0YjdjNjYw?h=15825656760133770628&e=download&gd=true
)
)
[link] => Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[rel] => alternate
[type] => text/html
[href] => https://docs.google.com/a/agaco.es/leaf?id=0B6yYgWS-CUJ2MDczZTRlY2YtZTRiMi00MWQ2LTliYjMtMDZiYWY0YjdjNjYw&hl=en_US
)
)
)
)
但是这些链接中的任何一个都是要在我的网站上发布的公共链接。
从 API v3 如何获得类似 https://docs.google.com/open?id=0B6yYgWS-CUJ2ZTUxZGI4MGUtMWM0Yy00YzY0LWIxOTMtMDFlN2RjNDAxNGM2
问候, 利托。
I have a code to upload files to Google Docs using the Google Docs API. This files are uploaded to a public Collection, but, how can I get the public link to be published?
After the complete upload I get:
SimpleXMLElement Object
(
[id] => https://docs.google.com/feeds/id/file%3A0B6yYgWS-CUJ2MDczZTRlY2YtZTRiMi00MWQ2LTliYjMtMDZiYWY0YjdjNjYw
[published] => 2011-11-21T18:39:10.316Z
[updated] => 2011-11-21T18:39:10.316Z
[category] => SimpleXMLElement Object
(
[@attributes] => Array
(
[scheme] => http://schemas.google.com/g/2005#kind
[term] => http://schemas.google.com/docs/2007#file
[label] => application/zip
)
)
[title] => 4eca9acc2c339-4ec3b7436bed4-test2docx.zip
[content] => SimpleXMLElement Object
(
[@attributes] => Array
(
[type] => application/zip
[src] => https://doc-14-88-docs.googleusercontent.com/docs/securesc/fcicpk40ckisatj1kultkrrcsbo6sba3/bnpt7i1b36sn91mta24etn98ou9ce2j0/1321900200000/11381682958832082931/11381682958832082931/0B6yYgWS-CUJ2MDczZTRlY2YtZTRiMi00MWQ2LTliYjMtMDZiYWY0YjdjNjYw?h=15825656760133770628&e=download&gd=true
)
)
[link] => Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[rel] => alternate
[type] => text/html
[href] => https://docs.google.com/a/agaco.es/leaf?id=0B6yYgWS-CUJ2MDczZTRlY2YtZTRiMi00MWQ2LTliYjMtMDZiYWY0YjdjNjYw&hl=en_US
)
)
)
)
But any of this links are a public link to publish in my web.
From API v3 how can I get a link like https://docs.google.com/open?id=0B6yYgWS-CUJ2ZTUxZGI4MGUtMWM0Yy00YzY0LWIxOTMtMDFlN2RjNDAxNGM2
Regards,
Lito.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论