Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8229219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:43:37+00:00 2026-06-07T16:43:37+00:00

Im trying to simply create a new document using the Zend Google Docs API’s

  • 0

Im trying to simply create a new document using the Zend Google Docs API’s insertEntry() function, but even though I am correctly setting the content, it always results in a blank document being added to my Google docs account.

I have followed the documentation found here http://framework.zend.com/manual/en/zend.gdata.introduction.html#zend.gdata.introduction.post (it might help to take a look at that the “Posting Entries to Google Servers” code example).

And I am using this code which is called within my class:

    public function insertData() {

    $gData = new Zend_Gdata($this->client);
    $gCategory = new Zend_Gdata_App_Extension_Category('http://schemas.google.com/docs/2007#document', Zend_Gdata_Docs::DOCUMENTS_CATEGORY_SCHEMA);

    $newEntry = $gData->newEntry();
    $newEntry->category = (array($gCategory));

    $newTitle = $gData->newTitle('Test');
    $newContent = $gData->newContent('Testing new entry');
    $newContent->setType('text');

    $newEntry->title = $newTitle;
    $newEntry->content = $newContent;

    return $gData->insertEntry($newEntry, Zend_Gdata_Docs::DOCUMENTS_LIST_FEED_URI);
}

The title is correctly set, and shows correctly as “Test” in Google Docs, however the content is always blank.

I have tryed everything.. anyone have any ideas where the problem is?

Thanks.

UPDATE:
It might help to know that the code posted on that documentation does not work as is (it is probably outdated). If you run that code it gives a “category required” error, revising the code to add a category requires a “category schema” from Google, which is a URL like “http://schemas.google.com/docs/2007#document”.

On the Google docs API page https://developers.google.com/google-apps/documents-list/#creating_or_uploading_text_documents it states that this schema is: “To create a new, empty text document”.. So this may be the issue.. however, I could not find a schema URL for creating a document from existing content (ie. not a empty document).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T16:43:39+00:00Added an answer on June 7, 2026 at 4:43 pm

    Could you use the uploadFile method in Zend_Gdata_Docs? You could upload a txt file that contains the default content you would like to see in the google doc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a function that will simply allow me to pass an
I am trying to create a WordCloud through the Google Visualization API . You
I am trying to create the word document using the HWPFDocument . I am
This is just a simple question. I was trying to create a new object
I'm new to php and I'm trying to create a simple example for calling
I am new to ASP.NET-MVC and I am trying to create a simple blog
I'm new to the CKEditor and I'm trying to create a simple plugin. What
I'm new in games development, am trying to create a simple game in flash-cs5.
what i'm trying to do this this. Simply create a C# windows app that
This is quite frustrating. I am simply trying to create a dynamic text and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.