1
votes

I want to fetch Google contacts for users and create logs of new and updated contacts via a PHP script. Can someone please guide me on how to proceed?

I have implemented the same kind of service for calendar events using 0Auth2.0, but for contacts I didn't find any API in the Google PHP client libraries.

2
thanks for the link , i am able fetch all contacts using google.com/m8/feeds/contacts/default/full , but how do i get full details of contacts like emailid ,address , mobile number .In the Contact id as "google.com/m8/feeds/contacts/anrc.wipro%40gmail.com/base/…"Navi

2 Answers

0
votes

The problem is in the example, it seems that the json encoder does the mess. One of the developers wrote how to achive email address on this link http://pastebin.com/kAYT5Jng You can see part of the discusion right here

0
votes

Have you tried this project https://github.com/rapidwebltd/php-google-contacts-v3-api

Fetching all the contacts :

$contacts = rapidweb\googlecontacts\factories\ContactFactory::getAll();
var_dump($contacts);

create new contact

$name = "Frodo Baggins";
$phoneNumber = "06439111222";
$emailAddress = "[email protected]";
$note = "Note for example";

$newContact = rapidweb\googlecontacts\factories\ContactFactory::create($name, $phoneNumber, $emailAddress, $note);