While adding contacts using google contacts api, I have been getting status code 400, with Invalid XML Document error.
If I remove the following line the add contact api succeeds. However, this behaviour is not what I want. I would like to add it to the base group 6.
<gContact:groupMembershipInfo deleted="false"
href="http://www.google.com/m8/feeds/groups/[email protected]/base/6"/>
The following is the body of the add new contact api post request:
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005">
<atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact" />
<gd:name>
<gd:givenName>1234567890</gd:givenName>
</gd:name>
<gd:phoneNumber rel="http://schemas.google.com/g/2005#mobile" primary="true">
${phone_number}
</gd:phoneNumber>
<gContact:groupMembershipInfo deleted="false" href="http://www.google.com/m8/feeds/groups/[email protected]/base/6" />
</atom:entry>
I solved the problem changing the tag <gContact:groupMembershipInfo>
in <gd:groupMembershipInfo>
, so any tag with <gContact
> no longer works but only with <gd:>
, this only when you create new contact if you update there isn't any problem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With