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

  • Home
  • SEARCH
  • 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 6712379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:15:10+00:00 2026-05-26T08:15:10+00:00

I have an application using zend_gdata and create contact with the code below. $doc

  • 0

I have an application using zend_gdata and create contact with the code below.

$doc  = new DOMDocument();
$doc->formatOutput = true;
$entry = $doc->createElement('atom:entry');
$entry->setAttributeNS('http://www.w3.org/2000/xmlns/' ,'xmlns:atom', 'http://www.w3.org/2005/Atom');
$entry->setAttributeNS('http://www.w3.org/2000/xmlns/' , 'xmlns:gd', 'http://schemas.google.com/g/2005');
$doc->appendChild($entry);

// add name element
$name = $doc->createElement('gd:name');
$entry->appendChild($name);

$fullName = $doc->createElement('gd:fullName', htmlentities($data->firstname . ' ' . $data->lastname));
$name->appendChild($fullName);

// insert entry
$entryResult = $gdata->insertEntry($doc->saveXML(), 'http://www.google.com/m8/feeds/contacts/default/full');

Is there a possibility, a function to add a group to the contact just created?

  • 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-05-26T08:15:10+00:00Added an answer on May 26, 2026 at 8:15 am

    I have a big class and can’t paste it all, you need to put this together somehow

    step 1)

    get all groups ( http://raiyaraj.wordpress.com/2008/09/17/gmail-gdata-contacts-group-via-proxy/) and find the id of your group or create it ( you can do it with zend framework) if it doesn’t exist

    step 2)

    generate the xml

    // create new entry
            $doc  = new DOMDocument();
            $doc->formatOutput = true;
            $entry = $doc->createElement('atom:entry');
            $entry->setAttributeNS('http://www.w3.org/2000/xmlns/' , 'xmlns:atom', 'http://www.w3.org/2005/Atom');
            $entry->setAttributeNS('http://www.w3.org/2000/xmlns/' , 'xmlns:gd', 'http://schemas.google.com/g/2005');
            $entry->setAttributeNS('http://www.w3.org/2000/xmlns/' , 'xmlns:gContact', 'http://schemas.google.com/contact/2008');
            $doc->appendChild($entry);
    
    ...add various stuff....
        $name = $doc->createElement('gd:name');
                $entry->appendChild($name);
                $fullName = $doc->createElement('gd:fullName', $this->name);
                $name->appendChild($fullName);
    .....
    
            $group = $doc->createElement('gContact:groupMembershipInfo');
            $group->setAttribute('deleted' ,'false');
            $group->setAttribute('href' ,'http://www.google.com/m8/feeds/groups/' .urlencode($this->email) . '/base/'.$this->group_id);
            $entry->appendChild($group);
    

    step 3)

    connect to gmail and execute the query

    $service = $this->service;
    // perform login and set protocol version to 3.0
    $client = $service;
    $gdata = new Zend_Gdata($client);
    $gdata->setMajorProtocolVersion(3);
    $entryResult = $gdata->insertEntry($this->getXML(), 'https://www.google.com/m8/feeds/contacts/default/full');
    
    return $entryResult->getLink('edit');
    

    notice that you return the edit link so that if you save it, you can update the contact or or check for modifications

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

Sidebar

Related Questions

I have a PHP MVC application using Zend Framework. As presented in the quickstart,
All, I have a PHP Web application built using Zend Framework and MVC with
I'm building a web application using PHP5.3 and Zend Framework 1.9.4. i have an
I have an application using Core Data and bindings. I want to have an
We have an application using the IBM Informix driver. Whenever we try to open
I have a web application using ASP.NET 2.0 and I want to know if
I have a Php application using stream_socket_client(), to get data through tcp from a
I have a control application - using asp.net webservices. I have a timer which
I have a web application using JPA and JTA with Spring. I would like
I have a WPF application using Aero Glass. When using the application under a

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.