I have written a script to create a shared contact in my G-Suite domain. I have done the OAuth work, and am able to create a contact.
However, when I have created the contact, it does not have all the data I submitted. For example, it does not have name data or title information.
I have tried using the example Google has here: https://developers.google.com/admin-sdk/domain-shared-contacts/#Creating
This is exactly what I am posting:
<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>Elizabeth</gd:givenName>
<gd:familyName>Bennet</gd:familyName>
<gd:fullName>Elizabeth Bennet</gd:fullName>
</gd:name>
<atom:content type='text'>Notes</atom:content>
<gd:email rel='http://schemas.google.com/g/2005#work' primary='true' address='liz@gmail.com' displayName='E. Bennet' />
<gd:email rel='http://schemas.google.com/g/2005#home' address='liz@example.org' />
<gd:phoneNumber rel='http://schemas.google.com/g/2005#work' primary='true'>(206)555-1212</gd:phoneNumber>
<gd:phoneNumber rel='http://schemas.google.com/g/2005#home'>(206)555-1213</gd:phoneNumber>
<gd:im address='liz@gmail.com' protocol='http://schemas.google.com/g/2005#GOOGLE_TALK' primary='true' rel='http://schemas.google.com/g/2005#home' />
<gd:structuredPostalAddress rel='http://schemas.google.com/g/2005#work' primary='true'>
<gd:city>Mountain View</gd:city>
<gd:street>1600 Amphitheatre Pkwy</gd:street>
<gd:region>CA</gd:region>
<gd:postcode>94043</gd:postcode>
<gd:country>United States</gd:country>
<gd:formattedAddress>1600 Amphitheatre Pkwy Mountain View</gd:formattedAddress>
</gd:structuredPostalAddress>
</atom:entry>
It creates the contact, but is missing the names, title, etc.
This is what is returned by the post:
<?xml version='1.0' encoding='UTF-8' ?>
<entry xmlns='http://www.w3.org/2005/Atom' xmlns:batch='http://schemas.google.com/gdata/batch' xmlns:gd='http://schemas.google.com/g/2005' xmlns:gContact='http://schemas.google.com/contact/2008'>
<id>http://www.google.com/m8/feeds/contacts/compcc.com/base/36b40df989628b57</id>
<updated>2017-01-17T15:42:32.736Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/contact/2008#contact' />
<title type='text'></title>
<content type='text'>Notes</content>
<link rel='http://schemas.google.com/contacts/2008/rel#edit-photo' type='image/*' href='https://www.google.com/m8/feeds/photos/media/compcc.com/36b40df989628b57/1B2M2Y8AsgTpgAmY7PhCfg' />
<link rel='self' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/compcc.com/full/36b40df989628b57' />
<link rel='edit' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/compcc.com/full/36b40df989628b57/1484667752736001' />
<gd:email rel='http://schemas.google.com/g/2005#work' address='liz@gmail.com' primary='true' />
<gd:email rel='http://schemas.google.com/g/2005#home' address='liz@example.org' />
<gd:im address='liz@gmail.com' primary='true' protocol='http://schemas.google.com/g/2005#GOOGLE_TALK' rel='http://schemas.google.com/g/2005#home' />
<gd:phoneNumber rel='http://schemas.google.com/g/2005#work' primary='true'>(206)555-1212</gd:phoneNumber>
<gd:phoneNumber rel='http://schemas.google.com/g/2005#home'>(206)555-1213</gd:phoneNumber>
</entry>"
Does anyone know what might cause this?
Thank you.