הוצא משימוש. במקום זאת, כדאי להשתמש בשירות המתקדם של People API
שדה של העברת הודעות מיידיות באיש קשר.
Methods
שיטה | סוג הערך המוחזר | תיאור קצר |
---|---|---|
get | String | אחזור הכתובת של השדה הזה. |
get | Object | הפונקציה מקבלת את התווית של השדה הזה. |
is | Boolean | הפונקציה מקבלת את הערך של השדה הראשי. |
set |
| מגדיר את הכתובת של השדה הזה. |
set |
| הגדרת השדה הזה כראשי. |
set |
| הגדרת התווית של השדה הזה. |
set |
| הגדרת התווית של השדה הזה. |
שיטות שהוצאו משימוש
שיטה | סוג הערך המוחזר | תיאור קצר |
---|---|---|
| void | מחיקה של שדה ההודעה המיידית. |
מסמכים מפורטים
getAddress()
אחזור הכתובת של השדה הזה.
// 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
– הכתובת כמחרוזת
אישור
סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:
-
https://www.google.com/m8/feeds
getLabel()
הפונקציה מקבלת את התווית של השדה הזה. זה יכול להיות שדה, ExtendedField או מחרוזת.
// 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
– התווית של השדה הזה
אישור
סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:
-
https://www.google.com/m8/feeds
isPrimary()
הפונקציה מקבלת את הערך של השדה הראשי.
// 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
— אם זהו החשבון הראשי
אישור
סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:
-
https://www.google.com/m8/feeds
setAddress(address)
מגדיר את הכתובת של השדה הזה.
// 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 | הכתובת החדשה |
חזרה
– השדה הזה שימושי לשרשורIMField
אישור
סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:
-
https://www.google.com/m8/feeds
setAsPrimary()
הגדרת השדה הזה כראשי.
// 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();
חזרה
– ערך השדה הזה לשרשורIMField
אישור
סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:
-
https://www.google.com/m8/feeds
setLabel(field)
הגדרת התווית של השדה הזה.
// 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 |
| התווית הרגילה החדשה |
חזרה
– ערך השדה הזה לשרשורIMField
אישור
סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:
-
https://www.google.com/m8/feeds
setLabel(label)
הגדרת התווית של השדה הזה.
// 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 | התווית החדשה לשדה הזה |
חזרה
– השדה הזה שימושי לשרשורIMField
אישור
סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:
-
https://www.google.com/m8/feeds
שיטות שהוצאו משימוש
deleteIMField()
deleteIMField()
הוצא משימוש. הפונקציה הזו הוצאה משימוש ואין להשתמש בה בסקריפטים חדשים.
מחיקה של שדה ההודעה המיידית.
// 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();
אישור
סקריפטים שמשתמשים בשיטה הזו דורשים הרשאה עם אחד או יותר מהיקפי הגישה הבאים:
-
https://www.google.com/m8/feeds