ERROR:Expected response code 200, got 400 Referenced group doesn't belong to the same user. Should be: 'xxx@gmail.com'. Is: 'default'

696 views
Skip to first unread message

Rubén Sánchez

unread,
Jan 11, 2012, 6:27:54 AM1/11/12
to google-co...@googlegroups.com
Hi people

Why do I get this error? I do the following code:

// add org name element
$group = $doc->createElement('gContact:groupMembershipInfo');
$group->setAttribute('deleted' ,'false');
$group->setAttribute('href' ,'http://www.google.com/m8/feeds/groups/default/base/6');
$entry->appendChild($group);

but I get this error:
ERROR:Expected response code 200, got 400 Referenced group doesn't belong to the same user. Should be: 'x...@gmail.com'. Is: 'default'

If I change default for an email, it works. According to the documentation setting as userEmail => default is totally valid.

I hope you can help me with this.

Thanks in advance!
Ruben



Alain Vongsouvanh

unread,
Jan 11, 2012, 6:20:21 PM1/11/12
to google-co...@googlegroups.com
Hello,

The groupMemberShipInfo "href" attribute must be set to a valid contact group Atom ID. This Atom ID is unfortunately linked to a user which is why the user's email must be set instead of "default".

Best,
Alain

--
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
google-co...@googlegroups.com
To unsubscribe from this group, send email to
google-contacts...@googlegroups.com
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html



--
Alain Vongsouvanh | Developer Programs Engineer

Rubén Sánchez

unread,
Jan 12, 2012, 10:20:05 AM1/12/12
to google-co...@googlegroups.com
Thanks Alain for the response. I did what you told me and it works.

$response = $gdata->performHttpRequest('GET', 'https://www.google.com/m8/feeds/groups/default/full');
   
    $xmlBody = strstr($response,'<?xml');

    $xml = simplexml_load_string($xmlBody);
    $groupId = $xml->entry[0]->id;
    // add group

    $group = $doc->createElement('gContact:groupMembershipInfo');
    $group->setAttribute('deleted' ,'false');
    $group->setAttribute('href' , $groupId);
    $entry->appendChild($group);
    // insert entry
    $entryResult = $gdata->insertEntry($doc->saveXML(), 'http://www.google.com/m8/feeds/contacts/default/full');

Chintan

unread,
Oct 22, 2012, 10:21:23 AM10/22/12
to google-co...@googlegroups.com
Hello,

I am trying to add contact in gmail account using Api V3 but i am getting same 400 response.

<entry><id>1</id><updated>2012-10-22T13:34:07.047Z</updated><title>Error</title><content>Supposed groupUri '/groups/chintan....@avinashi.com/base/' doesn't match template</content><batch:id>1</batch:id><batch:status code='400' reason='Supposed groupUri &apos;/groups/chintan....@avinashi.com/base/&apos; doesn&apos;t match template' content-type='text/plain'>Supposed groupUri '/groups/chintan....@avinashi.com/base/' doesn't match template</batch:status><batch:operation type='insert'/></entry>

Will you please help me to find the exact problem?
Thanks in advance.

Regards,
Chintan
Reply all
Reply to author
Forward
0 new messages