เลิกใช้งานแล้ว แต่ให้ใช้บริการขั้นสูงของ People API แทน
ช่องหมายเลขโทรศัพท์ในรายชื่อติดต่อ
เมธอด
| วิธีการ | ประเภทการแสดงผล | รายละเอียดแบบย่อ | 
|---|---|---|
| get | Object | รับป้ายกำกับของช่องนี้ | 
| is | Boolean | รับว่านี่เป็นค่าช่องหลักหรือไม่ | 
| set |  | ตั้งค่าช่องนี้เป็นค่าหลัก | 
| set |  | ตั้งค่าป้ายกํากับของช่องนี้ | 
| set |  | ตั้งค่าป้ายกํากับของช่องนี้ | 
เอกสารประกอบโดยละเอียด
get
รับป้ายกำกับของช่องนี้ ซึ่งอาจเป็นฟิลด์ 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 — ป้ายกำกับของช่องนี้
การให้สิทธิ์
สคริปต์ที่ใช้วิธีการนี้ต้องได้รับอนุญาตด้วยขอบเขตต่อไปนี้อย่างน้อย 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 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();
รีเทิร์น
Phone
การให้สิทธิ์
สคริปต์ที่ใช้วิธีการนี้ต้องได้รับอนุญาตด้วยขอบเขตต่อไปนี้อย่างน้อย 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 |  | ป้ายกำกับมาตรฐานใหม่ | 
รีเทิร์น
Phone
การให้สิทธิ์
สคริปต์ที่ใช้วิธีการนี้ต้องได้รับอนุญาตด้วยขอบเขตต่อไปนี้อย่างน้อย 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 | ป้ายกำกับใหม่สำหรับช่องนี้ | 
รีเทิร์น
Phone
การให้สิทธิ์
สคริปต์ที่ใช้วิธีการนี้ต้องได้รับอนุญาตด้วยขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
- 
https://www.google.com/m8/feeds