Google Gmail の連絡先と統合しようとしていますGoogle Contacts API バージョン 3.0の例に従いますこのエラーが発生しました リクエストの実行に失敗しました: https://www.google.com/m8/feeds/contacts/default/full
Google.Contacts.Contact createdEntry = cr.Insert(feedUri, newEntry);
内部期待:
{"リモート サーバーがエラーを返しました: (400) 不正な要求。"}
[12 行目、127 列目、要素 gd:im] 属性がありません: 'address'
完全なコード
using Google.Contacts;
using Google.GData.Contacts;
using Google.GData.Client;
using Google.GData.Extensions;
RequestSettings settings = new RequestSettings("OVI2GoogleContacts", "my email", "pass");
ContactsRequest cr = new ContactsRequest(settings);
Google.Contacts.Contact newEntry = new Google.Contacts.Contact();
// Set the contact's name.
newEntry.Name = new Name()
{
FullName = "Elizabeth Bennet",
GivenName = "Elizabeth",
FamilyName = "Bennet",
};
newEntry.Content = "Notes";
//Set the contact's e-mail addresses.
newEntry.Emails.Add(new EMail()
{
Primary = true,
Rel = ContactsRelationships.IsHome,
Address = "liz<at>gmail.com"
});
newEntry.Emails.Add(new EMail()
{
Rel = ContactsRelationships.IsWork,
Address = "liz<at>example.com"
});
//Set the contact's phone numbers.
newEntry.Phonenumbers.Add(new PhoneNumber()
{
Primary = true,
Rel = ContactsRelationships.IsWork,
Value = "(206)555-1212",
});
newEntry.Phonenumbers.Add(new PhoneNumber()
{
Rel = ContactsRelationships.IsHome,
Value = "(206)555-1213",
});
// Set the contact's IM information.
newEntry.IMs.Add(new IMAddress()
{
Primary = true,
Rel = ContactsRelationships.IsHome,
Protocol = ContactsProtocols.IsGoogleTalk,
});
// Set the contact's postal address.
newEntry.PostalAddresses.Add(new StructuredPostalAddress()
{
Rel = ContactsRelationships.IsWork,
Primary = true,
Street = "1600 Amphitheatre Pkwy",
City = "Mountain View",
Region = "CA",
Postcode = "94043",
Country = "United States",
FormattedAddress = "1600 Amphitheatre Pkwy Mountain View",
});
// Insert the contact.
Uri feedUri = new Uri(ContactsQuery.CreateContactsUri("default"));
Google.Contacts.Contact createdEntry = cr.Insert(feedUri, newEntry); // here the error