简体   繁体   中英

Google Documents List API v3 - How to create a folder?

I tried to create a new folder following the instructions at https://developers.google.com/google-apps/documents-list/#creating_a_new_document_or_file_with_metadata_only

instead of term="http://schemas.google.com/docs/2007#document, I used term="http://schemas.google.com/docs/2007#folder.

However, I get a HTTP status 200 and no folder is created. Even if I use term="http://schemas.google.com/docs/2007#document the result is same.

I saw issues with this method in my search and I tried to post to https://docs.google.com/feeds/default/private/full/folder%3A Now, I get a 400 error.

Any help will be appreciated.

Best regards, Karthik

To create a folder, send a POST request to https://docs.google.com/feeds/default/private/full with the following xml body:

<?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>

For more details, check the specific section in the docs: https://developers.google.com/google-apps/documents-list/#creating_collections

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM