Also, one last thing, if you want to use the above script to add your 
contact to a contact group that is already in existence (the group has to 
already be made in gmail, i dont know how to make a group on the fly), this 
is what you do:

1. go to gmail, click on contacts, then click on the group you want to add 
the contact to, and look at the url in the browser address bar and you will 
see something like this 

"http://........../mail/#contacts/group/75605522099e2b79/Group+Name";

2. Make a mental note of the string in the url above that 
resembles: 75605522099e2b79 - this is your group ID

3. Add the following lines to the contact function that justin provided: 

//   GROUP
if(!empty($contact['group'])) {
$grouper = $doc->createElement('gContact:groupMembershipInfo');
  
$grouper->setAttribute('href', $contact['group']);   


$entry->appendChild($grouper);
}


4. Add the following variable to the script I used above to call the 
function (the string after 'base' is your group ID from above):

$group="http://www.google.com/m8/feeds/groups/YourGmailUserName%40gmail.com/base/75605522099e2b79";;


5. Then make sure to add the new group variable that to your $contact array:

$contact = array("firstName" => $firstName, "middleName" => $middleName, 
"lastName" => $lastName, "dob" => $dob, "anniversary" => $anniversary, 
"emailWork" => $emailWork, "emailPersonal" => $emailPersonal, "homePhone" => 
$homePhone, "mobilePhone" => $mobilePhone, "workPhone" => $workPhone, 
"workPhone2" => $workPhone2, "fax" => $fax, "company" => $company, "title" 
=> $title, "workCity" => $workCity, "workAddress" => $workAddress, 
"workAddress2" => $workAddress2, "workProvince" => $workProvince, 
"workZipCode" => $workZipCode, "workCountry" => $workCountry, "homeCity" => 
$homeCity, "homeAddress" => $homeAddress, "homeAddress2" => $homeAddress2, 
"homeProvince" => $homeProvince, "homeZipCode" => $homeZipCode, 
"homeCountry" => $homeCountry, "website" => $website, "blog" => $blog, 
"group" => $group);





6. Now when you run the script, it should add whatever contact you make to a 
particular group.




-- 
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html

Reply via email to