Google Documents List API v3 - 如何创建文件夹?

时间:2012-06-21 12:02:35

标签: google-docs-api

我尝试按照https://developers.google.com/google-apps/documents-list/#creating_a_new_document_or_file_with_metadata_only

上的说明创建一个新文件夹

而不是term =“http://schemas.google.com/docs/2007#document,我使用了term =”http://schemas.google.com/docs/2007#folder。

但是,我获得HTTP状态200并且没有创建文件夹。即使我使用term =“http://schemas.google.com/docs/2007#document,结果也一样。

我在搜索中看到了此方法的问题,我尝试发布到https://docs.google.com/feeds/default/private/full/folder%3A 现在,我收到400错误。

任何帮助将不胜感激。

祝你好运, KARTHIK

1 个答案:

答案 0 :(得分:0)

要创建文件夹,请使用以下xml正文向POST发送https://docs.google.com/feeds/default/private/full请求:

<?xml version='1.0' encoding='UTF-8'?>
  <entry xmlns="http://www.w3.org/2005/Atom">
  <category scheme="http://schemas.google.com/g/2005#kind"
    term="http://schemas.google.com/docs/2007#folder"/>
  <title>Example Collection</title>
</entry>

有关详细信息,请查看文档中的特定部分:https://developers.google.com/google-apps/documents-list/#creating_collections