非推奨。代わりに、People API アドバンスト サービスを使用してください。
このクラスを使用すると、ユーザーは自分の Google コンタクトにアクセスし、そこに表示されている連絡先を作成、削除、更新できます。
サポートが終了したプロパティ
プロパティ | タイプ | 説明 |
---|---|---|
Extended |
| |
Field |
| |
Gender |
| |
Month | Month | |
Priority |
| |
Sensitivity |
|
サポート終了のメソッド
メソッド | 戻り値の型 | 概要 |
---|---|---|
|
| 新しい連絡先を作成します。 |
|
| 指定された名前の連絡先グループを作成します。// The code below creates a new contact group named "Work Friends" const group = ContactsApp.createContactGroup('Work Friends'); |
| void | 連絡先を削除します。 |
| void | 連絡先グループを削除します
// The code below creates deletes the contact group named "Work Friends" const group = ContactsApp.getContactGroup('Work Friends'); ContactsApp.deleteContactGroup(group); |
|
| 指定したメールアドレスの連絡先を検索します。 |
|
| 指定した名前の連絡先グループを検索します。 |
|
| このユーザーに属するすべての連絡先を取得します。 |
|
| メールアドレスで連絡先を取得します。 |
|
| この ID の連絡先を取得します。 |
|
| 指定された名前の連絡先グループを取得します。そのような連絡先グループが見つからない場合、null を返します。 |
|
| 指定された ID の連絡先グループを取得します。そのような連絡先グループが見つからない場合、null を返します。 |
|
| ユーザーの連絡先グループの完全なリストを取得します。 |
|
| ユーザーの連絡先をすべて取得します。 |
|
| 住所に一致する連絡先を取得します。 |
|
| 住所と一致する連絡先を特定のフィールドに限定して取得します。 |
|
| 指定されたカスタム住所ラベルに限定して、住所に一致する連絡先を取得します。 |
|
| 会社フィールドに一致する連絡先を取得します。 |
|
| カスタム フィールドの特定の値に一致する連絡先を取得します。 |
|
| 特定の標準フィールドの特定の月と日に一致する連絡先を取得します。 |
|
| 特定の標準フィールドの指定された月、日、年と一致する連絡先を取得します。 |
|
| 特定のカスタム フィールドの指定した月、日、年と一致する連絡先を取得します。 |
|
| 特定のカスタム フィールドの特定の月と日に一致する連絡先を取得します。 |
|
| メールアドレスに一致する連絡先を取得します。 |
|
| メールアドレスに一致する連絡先を取得し、特定のフィールドに限定します。 |
|
| 指定されたカスタム メールアドレスラベルに限定して、メールアドレスに一致する連絡先を取得します。 |
|
| 指定した ContactGroup 内の連絡先を取得します。 |
|
| インスタント メッセージ アドレスに一致する連絡先を取得します。 |
|
| 特定のフィールドに限定して、インスタント メッセージ アドレスに一致する連絡先を取得します。 |
|
| インスタント メッセージ アドレスに一致する連絡先を取得します。取得する連絡先は、指定されたカスタム インスタント メッセージのラベルに限定されます。 |
|
| 役職フィールドに一致する連絡先を取得します。 |
|
| 名前に一致する連絡先を取得します。 |
|
| 名前に一致する連絡先を取得し、特定のフィールドに限定します。 |
|
| メモ フィールドに一致する連絡先を取得します。 |
|
| 電話番号に一致する連絡先を取得します。 |
|
| 電話番号に一致する連絡先を取得します。特定のフィールドに限定できます。 |
|
| 指定されたカスタム電話番号ラベルに限定して、電話番号に一致する連絡先を取得します。 |
|
| URL に一致する連絡先を取得します。 |
|
| URL に一致する連絡先を特定のフィールドに限定して取得します。 |
|
| 指定されたカスタム URL ラベルに限定して、URL に一致する連絡先を取得します。 |
サポート終了のメソッド
create Contact(givenName, familyName, email)
create Contact(givenName, familyName, email)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
新しい連絡先を作成します。
// The code below creates a new contact with the name "John Doe" and the email // address "john.doe@example.com". const contact = ContactsApp.createContact( 'John', 'Doe', 'john.doe@example.com', );
パラメータ
名前 | 型 | 説明 |
---|---|---|
given | String | 連絡先の名前(名) |
family | String | 連絡先の姓 |
email | String | 連絡先のメールアドレス |
戻る
- 新しく作成された Contact オブジェクトContact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
create Contact Group(name)
create Contact Group(name)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
指定された名前の連絡先グループを作成します。
// The code below creates a new contact group named "Work Friends" const group = ContactsApp.createContactGroup('Work Friends');
パラメータ
名前 | 型 | 説明 |
---|---|---|
name | String | 新しい連絡先グループの名前 |
戻る
- 新しく作成された連絡先グループContact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
delete Contact(contact)
delete Contact(contact)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
連絡先を削除します。
// The code below retrieves a contact with the email address // "john.doe@example.com" and then deletes that contact. const contact = ContactsApp.getContact('john.doe@example.com'); ContactsApp.deleteContact(contact);
パラメータ
名前 | 型 | 説明 |
---|---|---|
contact |
| 削除する連絡先 |
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
delete Contact Group(group)
delete Contact Group(group)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
連絡先グループを削除します
// The code below creates deletes the contact group named "Work Friends" const group = ContactsApp.getContactGroup('Work Friends'); ContactsApp.deleteContactGroup(group);
パラメータ
名前 | 型 | 説明 |
---|---|---|
group |
| 削除する連絡先グループ |
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
find By Email Address(email)
find By Email Address(email)
find Contact Group(name)
find Contact Group(name)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
指定した名前の連絡先グループを検索します。
パラメータ
名前 | 型 | 説明 |
---|---|---|
name | String | 検索する連絡先グループの名前 |
戻る
- 指定された名前に一致する連絡先グループContact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
get All Contacts()
get All Contacts()
get Contact(emailAddress)
get Contact(emailAddress)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
メールアドレスで連絡先を取得します。
複数の連絡先が同じメールアドレスを共有している場合、このメソッドは、そのメールアドレスをメインとしてマークしている連絡先を優先します。どの連絡先もメールアドレスをメインとしてマークしていない場合、または複数の連絡先がメールアドレスをメインとしてマークしている場合は、並べ替えられた連絡先の順序で最初の結果が返されます。
// The code below retrieves a contact with the email address // "john.doe@example.com". const contact = ContactsApp.getContact('john.doe@example.com');
パラメータ
名前 | 型 | 説明 |
---|---|---|
email | String | 連絡先のメールアドレス |
戻る
- そのメールアドレスを含む連絡先Contact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contact By Id(id)
get Contact By Id(id)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
この ID の連絡先を取得します。
// The code below retrieves the contact with the id // "http://www.google.com/m8/feeds/contacts/john.doe%40example.com/base/7c86afde08d34ca5" const id = 'http://www.google.com/m8/feeds/contacts/john.doe%40example.com/base/7c86afde08d34c'; const contact = ContactsApp.getContactById(id);
パラメータ
名前 | 型 | 説明 |
---|---|---|
id | String | 取得する連絡先の ID |
戻る
- 一致する連絡先、または nullContact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contact Group(name)
get Contact Group(name)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
指定された名前の連絡先グループを取得します。そのような連絡先グループが見つからない場合、null を返します。
// The code below returns the contact group with the name "Work Friends" const group = ContactsApp.getContactGroup('Work Friends');
パラメータ
名前 | 型 | 説明 |
---|---|---|
name | String | 一致する連絡先グループの名前 |
戻る
- 一致する連絡先グループ。一致する連絡先グループが見つからない場合、nullContact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contact Group By Id(id)
get Contact Group By Id(id)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
指定された ID の連絡先グループを取得します。そのような連絡先グループが見つからない場合、null を返します。
// The code below returns the contact group with the id // "http://www.google.com/m8/feeds/groups/john.doe%40example.com/base/54eefbb093fdecb" const id = 'http://www.google.com/m8/feeds/groups/john.doe%40example.com/base/54eefbb093fdecb'; const group = ContactsApp.getContactGroupById(id);
パラメータ
名前 | 型 | 説明 |
---|---|---|
id | String | 照合する連絡先グループの ID |
戻る
- 一致する連絡先グループ。一致する連絡先グループが見つからない場合、nullContact
関連情報
get Contact Groups()
get Contact Groups()
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
ユーザーの連絡先グループの完全なリストを取得します。
ユーザーは連絡先のリストだけでなく、連絡先グループのリストも持つことができます。各連絡先グループには連絡先を含めることができます。このメソッドは、すべての連絡先グループのリストを返します。
// The retrieves all the contract groups for the user and then logs the group // name of each contact group. const groups = ContactsApp.getContactGroups(); for (let i = 0; i < groups.length; i++) { Logger.log(groups[i].getName()); }
戻る
- ユーザーの連絡先グループの配列Contact
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts()
get Contacts()
get Contacts By Address(query)
get Contacts By Address(query)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
住所に一致する連絡先を取得します。
// The code below returns an array of contacts where the contact's address // contains "San Francisco'. const contacts = ContactsApp.getContactsByAddress('San Francisco');
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 連絡先の住所で検索する文字列 |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Address(query, label)
get Contacts By Address(query, label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
住所と一致する連絡先を取得し、特定のフィールドに限定します。
// The code below returns an array of contacts where the contact's address // contains "San Francisco" in the Home address field. const contacts = ContactsApp.getContactsByAddress( 'San Francisco', ContactsApp.Field.HOME_ADDRESS, );
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 連絡先の住所で検索する文字列 |
label |
| 検索するフィールド |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Address(query, label)
get Contacts By Address(query, label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
指定されたカスタム住所ラベルに限定して、住所に一致する連絡先を取得します。
// The code below returns an array of contacts where the contact's address // contains "San Francisco" in a custom address label (created by the user) // called "vacation". const contacts = ContactsApp.getContactsByAddress('San Francisco', 'vacation');
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 指定されたカスタム住所ラベルを使用して連絡先の住所で検索する文字列 |
label | String | 検索するカスタム住所ラベル |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Company(query)
get Contacts By Company(query)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
会社フィールドに一致する連絡先を取得します。
// The code below returns an array of contacts where the contact's company field // contains "Google". const contacts = ContactsApp.getContactsByCompany('Google');
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 連絡先の会社フィールドで検索する文字列 |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Custom Field(query, label)
get Contacts By Custom Field(query, label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
カスタム フィールドの特定の値に一致する連絡先を取得します。
カスタム フィールドは、文字列で指定することも、ContactsApp.ExtendedField 値のいずれかで指定することもできます。
// The code below returns an array of contacts where the contact's custom field // named "Favorite Sport" contains "tennis". const contacts = ContactsApp.getContactsByCustomField( 'tennis', 'Favorite Sport', );
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | Object | 連絡先のカスタム フィールドで検索する文字列 |
label |
| 検索するカスタム フィールド |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Date(month, day, label)
get Contacts By Date(month, day, label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
特定の標準フィールドの特定の月と日に一致する連絡先を取得します。
// The code below returns an array of contacts where the contact's "Birthday" // field contains April for the month and 19 for the day. const contacts = ContactsApp.getContactsByDate( ContactsApp.Month.APRIL, 19, ContactsApp.Field.BIRTHDAY, );
パラメータ
名前 | 型 | 説明 |
---|---|---|
month | Month | 一致させる月(ContactsApp.Month の値のいずれか) |
day | Integer | 一致する日 |
label |
| 検索するフィールド(ContactsApp.Field から取得) |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Date(month, day, year, label)
get Contacts By Date(month, day, year, label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
特定の標準フィールドの指定された月、日、年と一致する連絡先を取得します。
// The code below returns an array of contacts where the contact's "Birthday" // field contains April for the month, 19 for the day, and 1950 for the year. const contacts = ContactsApp.getContactsByDate( ContactsApp.Month.APRIL, 19, 1950, ContactsApp.Field.BIRTHDAY, );
パラメータ
名前 | 型 | 説明 |
---|---|---|
month | Month | 一致させる月(ContactsApp.Month の値のいずれか) |
day | Integer | 一致する日 |
year | Integer | 一致させる年(null にできます) |
label |
| 検索するフィールド(ContactsApp.Field から取得) |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Date(month, day, year, label)
get Contacts By Date(month, day, year, label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
特定のカスタム フィールドの指定した月、日、年と一致する連絡先を取得します。
// The code below returns an array of contacts where the contact's custom "Start // Date" field contains April for the month, 19 for the day, and 2011 for the // year. const contacts = ContactsApp.getContactsByDate( ContactsApp.Month.APRIL, 19, 2011, 'Start Date', );
パラメータ
名前 | 型 | 説明 |
---|---|---|
month | Month | 一致させる月(ContactsApp.Month の値のいずれか) |
day | Integer | 一致する日 |
year | Integer | 一致させる年(null にできます) |
label | String | 検索するカスタム フィールド |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Date(month, day, label)
get Contacts By Date(month, day, label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
特定のカスタム フィールドの特定の月と日に一致する連絡先を取得します。
// The code below returns an array of contacts where the contact's custom "Start // Date" field contains April for the month and 19 for the day. const contacts = ContactsApp.getContactsByDate( ContactsApp.Month.APRIL, 19, 'Start Date', );
パラメータ
名前 | 型 | 説明 |
---|---|---|
month | Month | 一致させる月(ContactsApp.Month の値のいずれか) |
day | Integer | 一致する日 |
label | String | 検索するカスタム フィールド |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Email Address(query)
get Contacts By Email Address(query)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
メールアドレスに一致する連絡先を取得します。
// The code below returns an array of contacts where the contact's email address // contains "john.doe@example.com'. const contacts = ContactsApp.getContactsByEmailAddress('john.doe@example.com');
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 連絡先のメールアドレスで検索する文字列 |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Email Address(query, label)
get Contacts By Email Address(query, label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
メールアドレスに一致する連絡先を取得し、特定のフィールドに限定します。
// The code below returns an array of contacts where the contact's email address // contains "john.doe@example.com" in the Home email field. const contacts = ContactsApp.getContactsByEmailAddress( 'john.doe@example.com', ContactsApp.Field.HOME_EMAIL, );
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 連絡先のメールアドレスで検索する文字列 |
label |
| 検索するフィールド |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Email Address(query, label)
get Contacts By Email Address(query, label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
指定されたカスタム メールアドレスラベルに限定して、メールアドレスに一致する連絡先を取得します。
// The code below returns an array of contacts where the contact's email address // contains "john.doe@example.com" in a custom email address label (created by // the user) called "alternate". const contacts = ContactsApp.getContactsByEmailAddress( 'john.doe@example.com', 'alternate', );
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 指定されたカスタム メールアドレスラベルを持つ連絡先のメールアドレスで検索する文字列 |
label | String | 検索対象のカスタム メールアドレスのラベル |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Group(group)
get Contacts By Group(group)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
指定した ContactGroup 内の連絡先を取得します。
// The code below returns an array of contacts in the ContactGroup with the name // "Work Friends". const group = ContactsApp.getContactGroup('Work Friends'); const contacts = ContactsApp.getContactsByGroup(group);
パラメータ
名前 | 型 | 説明 |
---|---|---|
group |
| 連絡先のグループ |
戻る
- 指定したグループ内の連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By IM(query)
get Contacts By IM(query)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
インスタント メッセージ アドレスに一致する連絡先を取得します。
// The code below returns an array of contacts where the contact's instant // messaging address contains "ChatWithJohnDoe" in any instant messaging field. const contacts = ContactsApp.getContactsByIM('ChatWithJohnDoe');
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 連絡先のインスタント メッセージ アドレスで検索する文字列 |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By IM(query, label)
get Contacts By IM(query, label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
特定のフィールドに限定して、インスタント メッセージ アドレスに一致する連絡先を取得します。
// The code below returns an array of contacts where the contact's instant // messaging address contains "ChatWithJohnDoe" in the AIM instant messaging // field. const contacts = ContactsApp.getContactsByIM( 'ChatWithJohnDoe', ContactsApp.Field.AIM, );
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 連絡先のインスタント メッセージ アドレスで検索する文字列 |
label |
| 検索するフィールド |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By IM(query, label)
get Contacts By IM(query, label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
インスタント メッセージ アドレスに一致する連絡先を取得します。取得する連絡先は、指定されたカスタム インスタント メッセージのラベルに限定されます。
// The code below returns an array of contacts where the contact's instant // messaging address contains "ChatWithJohnDoe" in a custom instant messaging // label (created by the user) called "eBuddy". const contacts = ContactsApp.getContactsByIM('ChatWithJohnDoe', 'eBuddy');
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 指定したカスタム インスタント メッセージ ラベルを使用して、連絡先のインスタント メッセージ アドレスで検索する文字列 |
label | String | 検索対象のカスタム インスタント メッセージ ラベル |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Job Title(query)
get Contacts By Job Title(query)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
役職フィールドに一致する連絡先を取得します。
// The code below returns an array of contacts where the contact's job title // field contains "Product Manager". const contacts = ContactsApp.getContactsByJobTitle('Product Manager');
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 連絡先の役職フィールドで検索する文字列 |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Name(query)
get Contacts By Name(query)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
名前に一致する連絡先を取得します。
// The code below returns an array of contacts where the contact name contains // "John" const contacts = ContactsApp.getContactsByName('John');
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 連絡先名で検索する文字列 |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Name(query, label)
get Contacts By Name(query, label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
名前に一致する連絡先を取得し、特定のフィールドに限定します。
// The code below returns an array of contacts where the contact name contains // "John" in the Given Name field. const contacts = ContactsApp.getContactsByName( 'John', ContactsApp.Field.GIVEN_NAME, );
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 連絡先名で検索する文字列 |
label |
| 検索するフィールド |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Notes(query)
get Contacts By Notes(query)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
メモ フィールドに一致する連絡先を取得します。
// The code below returns an array of contacts where the contact's notes field // contains "sent birthday card". const contacts = ContactsApp.getContactsByNotes('sent birthday card');
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 連絡先のメモ欄で検索する文字列 |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Phone(query)
get Contacts By Phone(query)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
電話番号に一致する連絡先を取得します。
この方法では、文字で表された電話番号が展開されます。たとえば、「212-555-CODE」を検索して、連絡先に「212-555-2633」が登録されている場合やその逆の場合、適切な連絡先が見つかります。
// The code below returns an array of contacts where the contact's phone number // contains "212-555-1234' in any phone number field. const contacts = ContactsApp.getContactsByPhone('212-555-1234');
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 連絡先の電話番号で検索する文字列 |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Phone(query, label)
get Contacts By Phone(query, label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
電話番号に一致する連絡先を取得します。特定のフィールドに限定できます。
この方法では、文字で表された電話番号が展開されます。たとえば、「212-555-CODE」を検索して、連絡先に「212-555-2633」が登録されている場合やその逆の場合、適切な連絡先が見つかります。
// The code below returns an array of contacts where the contact's phone number // contains "212-555-1234" in the Home phone number field. const contacts = ContactsApp.getContactsByPhone( '212-555-1234', ContactsApp.Field.HOME_PHONE, );
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 連絡先の電話番号で検索する文字列 |
label |
| 検索するフィールド |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Phone(query, label)
get Contacts By Phone(query, label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
指定されたカスタム電話番号ラベルに限定して、電話番号に一致する連絡先を取得します。
この方法では、文字で表された電話番号が展開されます。たとえば、「212-555-CODE」を検索して、連絡先に「212-555-2633」が登録されている場合やその逆の場合、適切な連絡先が見つかります。
// The code below returns an array of contacts where the contact's phone number // contains "212-555-1234" in a custom phone number label (created by the user) // called "alternate". const contacts = ContactsApp.getContactsByPhone('212-555-1234', 'alternate');
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 指定されたカスタム電話番号ラベルを使用して、連絡先の電話番号で検索する文字列 |
label | String | 検索するカスタム電話番号ラベル |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Url(query)
get Contacts By Url(query)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
URL に一致する連絡先を取得します。
// The code below returns an array of contacts where the contact's URL contains // "www.example.com' in any URL field. const contacts = ContactsApp.getContactsByUrl('www.example.com');
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 連絡先の URL で検索する文字列 |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Url(query, label)
get Contacts By Url(query, label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
URL に一致する連絡先を取得し、特定のフィールドに限定します。
// The code below returns an array of contacts where the contact's URL contains // "www.example.com" in the Work URL field. const contacts = ContactsApp.getContactsByUrl( 'www.example.com', ContactsApp.Field.WORK_WEBSITE, );
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 連絡先の URL で検索する文字列 |
label |
| 検索するフィールド |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds
関連情報
get Contacts By Url(query, label)
get Contacts By Url(query, label)
非推奨。この関数は非推奨のため、新しいスクリプトでは使用しないでください。
指定されたカスタム URL ラベルに限定して、URL に一致する連絡先を取得します。
// The code below returns an array of contacts where the contact's URL contains // "www.example.com" in a custom URL label (created by the user) called // "alternate work". const contacts = ContactsApp.getContactsByUrl( 'www.example.com', 'alternate work', );
パラメータ
名前 | 型 | 説明 |
---|---|---|
query | String | 指定したカスタム URL ラベルを持つ連絡先の URL で検索する文字列 |
label | String | 検索するカスタム URL ラベル |
戻る
- 一致する連絡先の配列Contact[]
承認
このメソッドを使用するスクリプトには、次のスコープの 1 つ以上による承認が必要です。
-
https://www.google.com/m8/feeds