I re-read you message, and think problem is default example in
"google-api-php-client".
Just downloaded it and run examples/contacts/simple.php.
I see this part of code:
$response = json_encode(simplexml_load_string($val->getResponseBody()));
print "<pre>" . print_r(json_decode($response, true), true) . "</pre>";
In this json_encode/json_decode lost needed info for you.
Instead of this please make:
print_r($val->getResponseBody())
You will see original XML from google, which include
gContact:groupMembershipInfo...
and much more information
On Tuesday, July 31, 2012 9:11:34 AM UTC+7, Tfurrows wrote:
>
> Sergey, this is why I specifically requested help from someone who had
> tried and succeeded. Of course I read, and re-read, the documentation. If
> it worked as described, I wouldn't be here. The issue is, when you get all
> contacts, the group ID is not returned. There is no association to use. My
> question was specifically for the "My Contacts" group, which is a
> system-level group ID.
>
> So the question remains: has ANYONE succeeded here?
>
> On Monday, July 30, 2012 7:03:26 PM UTC-7, Sergey Zonov wrote:
>>
>> Hello,
>>
>> Did you read documentation
>> https://developers.google.com/google-apps/contacts/v3/<https://developers.google.com/google-apps/contacts/v3/#working_with_contacts>
>> ?
>> I suppose no, since see this "Each contact entry does NOT seem to have
>> group information associated with it."
>>
>> The algorithm is quite easy:
>>
>> 1. You should grab your groups by url
>> https://www.google.com/m8/feeds/groups/{userEmail}/full
>> Every group in resulting XML have <id>{groupId}</id>
>>
>> 2. Then get all contacts:
>> https://www.google.com/m8/feeds/contacts/{userEmail}/full
>> Contacts assigned to any group have <gContact:groupMembershipInfo
>> href="{groupId}">
>> By these {groupId} you can understand to which groups this contact
>> assigned.
>>
>> 3. Then, by php you can do any sorting or reduce results to needed groups
>> only..
>>
>> --
>> Regards
>> Sergey
>>
>> On Tuesday, July 24, 2012 1:16:31 AM UTC+7, Tfurrows wrote:
>>>
>>> What I am trying to do:
>>>
>>> 1. Using the Google-provided example code provided in the
>>> "google-api-php-client" for retrieving contacts using OAuth 2....
>>> 2. I am trying to retrieve all contacts in the "My Contacts" group
>>> only
>>> 3. The end result I'm seeking is the ability to get contacts sorted
>>> by groups, starting with "My Contacts"
>>>
>>> Currently, the mechanism itself is working fine, but I am only about to
>>> grab ALL contacts, not contacts "by group". Each contact entry does NOT
>>> seem to have group information associated with it. I have read literally
>>> HUNDREDS of web pages in trying to figure this out, and maybe I don't know
>>> what to look for, but I can't find a solution anywhere.
>>>
>>> My question for you is:
>>>
>>> 1. How does one properly use the "group" parameter (and yes, I've
>>> read every scrap of documentation I could find on this, and tried many
>>> things... I'm looking for someone who has experience, if anyone)
>>> 2. If the group parameter is the wrong method, can you help identify
>>> another method to get contacts by group?
>>>
>>> Any help would be appreciated, thank you.
>>>
>>>
>>>
--
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