I try to fetch the content of certain google contacts via Google Apps Script. First I identified the ID of the contact via a getId Function. My Script is this:
var id = 'id';
var contact = ContactsApp.getContactById(id);
var address = contact.getAddresses();
GmailApp.sendEmail("email", address, "");
The return I get via mail is "AddressField", allthough the certain contact definitely has an address.
In Addition I also tried the following script from the official reference (which returns the same thing):
// Logs the address for the 'Home Address' field for contact 'John Doe'.
// Can be used similarly for other fields that contain addresses.
var contacts = ContactsApp.getContactsByName('John Doe');
var homeAddress = contacts[0].getAddresses(ContactsApp.Field.HOME_ADDRESS);
Logger.log(homeAddress[0].getAddress());
Can anyone help me?
Thanks a lot in advance.
Best, Phil