使用PHP API获取Google Docs公共链接

时间:2011-11-21 19:21:07

标签: php google-api google-docs-api

我有一个代码可以使用Google Docs 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

之类的链接

此致 利托。

0 个答案:

没有答案