非推奨。代わりに、People API アドバンスト サービスを使用してください。
連絡先のメールアドレス フィールド。
メソッド
| メソッド | 戻り値の型 | 概要 | 
|---|---|---|
| get | String | このフィールドのアドレスを取得します。 | 
| get | Object | このフィールドのラベルを取得します。 | 
| is | Boolean | これが主なフィールド値かどうかを取得します。 | 
| set |  | このフィールドのアドレスを設定します。 | 
| set |  | このフィールドをプライマリに設定します。 | 
| set |  | このフィールドのラベルを設定します。 | 
| set |  | このフィールドのラベルを設定します。 | 
詳細なドキュメント
get
このフィールドのアドレスを取得します。
// Logs the address for the 'Home Address' field for contact 'John Doe'. // Can be used similarly for other fields that contain addresses. const contacts = ContactsApp.getContactsByName('John Doe'); const homeAddress = contacts[0].getAddresses(ContactsApp.Field.HOME_ADDRESS); Logger.log(homeAddress[0].getAddress());
戻る
String - 住所(文字列)
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
- 
https://www.google.com/m8/feeds
get
このフィールドのラベルを取得します。これは、Field、ExtendedField、または String です。
// Logs the label for all the address fields associated with contact // 'John Doe'. This method can be similarly called for any field that has // a label. const contacts = ContactsApp.getContactsByName('John Doe'); const addressFields = contacts[0].getAddresses(); for (let i = 0; i < addressFields.length; i++) { Logger.log(addressFields[i].getLabel()); }
戻る
Object - このフィールドのラベル
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
- 
https://www.google.com/m8/feeds
is
これが主なフィールド値かどうかを取得します。
// Logs whether or not the first address field associated with contact // 'John Doe' is labeled as primary. This method can be similarly called // for any field. const contacts = ContactsApp.getContactsByName('John Doe'); const addressFields = contacts[0].getAddresses(); Logger.log(addressFields[0].isPrimary());
戻る
Boolean - プライマリかどうか
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
- 
https://www.google.com/m8/feeds
set
このフィールドのアドレスを設定します。
// Sets the address for the 'Home Address' field for contact 'John Doe'. // Can be used similarly for other fields that contain addresses. const contacts = ContactsApp.getContactsByName('John Doe'); const homeAddress = contacts[0].getAddresses(ContactsApp.Field.HOME_ADDRESS); homeAddress[0].setAddress('123 Main St, Raleigh, NC, 27601');
パラメータ
| 名前 | 型 | 説明 | 
|---|---|---|
| address | String | 新しい住所 | 
戻る
Email
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
- 
https://www.google.com/m8/feeds
set
このフィールドをプライマリに設定します。
// Sets the first address field associated with contact 'John Doe' // as primary. This method can be similarly called for any field. const contacts = ContactsApp.getContactsByName('John Doe'); const addressFields = contacts[0].getAddresses(); addressFields[0].setAsPrimary();
戻る
Email
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
- 
https://www.google.com/m8/feeds
set
このフィールドのラベルを設定します。
// Sets the label to 'Work' for the first address field associated // with contact 'John Doe'. This method can be similarly called for any // field that has a label. const contacts = ContactsApp.getContactsByName('John Doe'); const addressFields = contacts[0].getAddresses(); addressFields[0].setLabel(ContactsApp.Field.WORK_ADDRESS);
パラメータ
| 名前 | 型 | 説明 | 
|---|---|---|
| field |  | 新しい標準ラベル | 
戻る
Email
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
- 
https://www.google.com/m8/feeds
set
このフィールドのラベルを設定します。
// Sets the label to 'Apartment' for the first address field associated // with contact 'John Doe'. This method can be similarly called for any // field that has a label. const contacts = ContactsApp.getContactsByName('John Doe'); const addressFields = contacts[0].getAddresses(); addressFields[0].setLabel('Apartment');
パラメータ
| 名前 | 型 | 説明 | 
|---|---|---|
| label | String | このフィールドの新しいラベル | 
戻る
Email
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
- 
https://www.google.com/m8/feeds