Wycofany. Zamiast tego użyj zaawansowanego interfejsu People API.
Pole wiadomości czatu w kontaktach.
Metody
Metoda | Zwracany typ | Krótki opis |
---|---|---|
get | String | Uzyskaj adres tego pola. |
get | Object | Pobiera etykietę tego pola. |
is | Boolean | Określa, czy jest to wartość pola podstawowego. |
set |
| Określa adres tego pola. |
set |
| Ustawia to pole jako główne. |
set |
| Ustawia etykietę tego pola. |
set |
| Ustawia etykietę tego pola. |
Wycofane metody
Metoda | Zwracany typ | Krótki opis |
---|---|---|
| void | Usuwa to pole wiadomości czatu. |
Szczegółowa dokumentacja
getAddress()
Uzyskaj adres tego pola.
// 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());
Powrót
String
– adres w postaci ciągu znaków
Autoryzacja
Skrypty, które korzystają z tej metody, wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://www.google.com/m8/feeds
getLabel()
Pobiera etykietę tego pola. Może to być pole, rozszerzone pole lub ciąg znaków.
// 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());
}
Powrót
Object
– etykieta tego pola
Autoryzacja
Skrypty, które korzystają z tej metody, wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://www.google.com/m8/feeds
isPrimary()
Określa, czy jest to wartość pola podstawowego.
// 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());
Powrót
Boolean
– czy jest to element główny
Autoryzacja
Skrypty, które korzystają z tej metody, wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://www.google.com/m8/feeds
setAddress(address)
Określa adres tego pola.
// 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');
Parametry
Nazwa | Typ | Opis |
---|---|---|
address | String | nowy adres. |
Powrót
– to pole, przydatne do łańcuchowaniaIMField
Autoryzacja
Skrypty, które korzystają z tej metody, wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://www.google.com/m8/feeds
setAsPrimary()
Ustawia to pole jako główne.
// 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();
Powrót
– to pole wartości służy do łańcuchowania.IMField
Autoryzacja
Skrypty, które korzystają z tej metody, wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://www.google.com/m8/feeds
setLabel(field)
Ustawia etykietę tego pola.
// 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);
Parametry
Nazwa | Typ | Opis |
---|---|---|
field |
| nowa etykieta standardowa |
Powrót
– to pole wartości służy do łańcuchowania.IMField
Autoryzacja
Skrypty, które korzystają z tej metody, wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://www.google.com/m8/feeds
setLabel(label)
Ustawia etykietę tego pola.
// 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');
Parametry
Nazwa | Typ | Opis |
---|---|---|
label | String | nowa etykieta tego pola. |
Powrót
– to pole, przydatne do łańcuchowaniaIMField
Autoryzacja
Skrypty, które korzystają z tej metody, wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://www.google.com/m8/feeds
Wycofane metody
deleteIMField()
deleteIMField()
Wycofany. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Usuwa to pole wiadomości czatu.
// Retrieves and deletes the AIM instant messaging field for contact 'John
// Doe'
const contacts = ContactsApp.getContactsByName('John Doe');
const imFields = contacts[0].getIMs(ContactsApp.Field.AIM);
imFields[0].deleteIMField();
Autoryzacja
Skrypty, które korzystają z tej metody, wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://www.google.com/m8/feeds