توضّح أدلة البدء السريع كيفية إعداد وتشغيل تطبيق يستدعي إحدى واجهات Google Workspace API. يستخدم دليل البدء السريع هذا أسلوب مصادقة مبسطًا مناسبًا لبيئة اختبار. بالنسبة إلى بيئة التشغيل الفعلي، ننصحك بالتعرّف على المصادقة والتفويض قبل اختيار بيانات الاعتماد الخاصة بالوصول المناسبة لتطبيقك.
في Apps Script، تستخدم أدوات البدء السريع في Google Workspace خدمات Google المتقدّمة لاستدعاء واجهات برمجة التطبيقات في Google Workspace والتعامل مع بعض تفاصيل عملية المصادقة والتفويض.
/** * @typedef {Object} EmailAddress * @see https://developers.google.com/people/api/rest/v1/people#Person * @property {string} value * Note: This is a partial definition. *//** * @typedef {Object} Name * @see https://developers.google.com/people/api/rest/v1/people#Person * @property {string} displayName * Note: This is a partial definition. *//** * @typedef {Object} Person * @see https://developers.google.com/people/api/rest/v1/people#Person * @property {Name[]} names * @property {EmailAddress[]} [emailAddresses] * Note: This is a partial definition. *//** * @typedef {Object} Connection * @see https://developers.google.com/people/api/rest/v1/people.connections/list * @property {Person[]} connections * Note: This is a partial definition. *//** * Print the display name if available for 10 connections. */functionlistConnectionNames(){// Use the People API to list the connections of the logged in user.// See: https://developers.google.com/people/api/rest/v1/people.connections/listif(!People||!People.People||!People.People.Connections){thrownewError("People service not enabled.");}constconnections=People.People.Connections.list("people/me",{pageSize:10,personFields:"names,emailAddresses",});if(!connections.connections){console.log("No connections found.");return;}for(constpersonofconnections.connections){if(person.names&&
person.names.length > 0&&
person.names[0].displayName){console.log(person.names[0].displayName);}else{console.log("No display name found for connection.");}}}
انقر على "حفظ" .
انقر على مشروع بلا عنوان، واكتب البدء السريع، ثم انقر على إعادة التسمية.
ضبط النص البرمجي
تفعيل People API
افتح مشروع برمجة تطبيقات.
انقر على أداة التعديلcode.
بجانب الخدمات، انقر على "إضافة خدمة" add .
اختَر People API وانقر على إضافة.
تشغيل العيّنة
في محرِّر Apps Script، انقر على تشغيل.
في المرة الأولى التي تشغّل فيها النموذج، سيُطلب منك منح الإذن بالوصول:
تاريخ التعديل الأخير: 2026-09-15 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2026-09-15 (حسب التوقيت العالمي المتفَّق عليه)"],[],["This document guides users to create and run a Google Apps Script that interacts with the People API. It involves configuring a new script on `script.google.com`, replacing the script editor's content with provided code, saving, and renaming the project. Users must enable the People API as a service within the script and authorize access during the initial run. The script then lists the display names of 10 connections. Production environments need appropriate authentication credentials.\n"]]