संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
People सेवा के ऐडवांस वर्शन की मदद से, Apps Script में People API का इस्तेमाल किया जा सकता है. इस एपीआई की मदद से स्क्रिप्ट, लॉग इन किए गए उपयोगकर्ता के संपर्क डेटा को बना सकती हैं, पढ़ सकती हैं, और अपडेट कर सकती हैं. साथ ही, Google उपयोगकर्ताओं के लिए प्रोफ़ाइल डेटा पढ़ सकती हैं.
रेफ़रंस
इस सेवा के बारे में ज़्यादा जानकारी के लिए, People API का रेफ़रंस दस्तावेज़ देखें.
Apps Script में उपलब्ध सभी ऐडवांस सेवाओं की तरह, People सेवा भी सार्वजनिक एपीआई के ऑब्जेक्ट, तरीकों, और पैरामीटर का इस्तेमाल करती है. ज़्यादा जानकारी के लिए, तरीके के सिग्नेचर कैसे तय किए जाते हैं लेख पढ़ें.
/** * Gets a list of people in the user's contacts. * @see https://developers.google.com/people/api/rest/v1/people.connections/list */functiongetConnections(){try{// Get the list of connections/contacts of user's profileconstpeople=People.People.Connections.list('people/me',{personFields:'names,emailAddresses'});// Print the connections/contactsconsole.log('Connections: %s',JSON.stringify(people,null,2));}catch(err){// TODO (developers) - Handle exception hereconsole.log('Failed to get the connection with an error %s',err.message);}}
उपयोगकर्ता के लिए व्यक्ति की जानकारी पाना
उपयोगकर्ता की प्रोफ़ाइल पाने के लिए, आपको https://www.googleapis.com/auth/userinfo.profile स्कोप का अनुरोध करना होगा. इसके लिए, अपनी appsscript.json मेनिफ़ेस्ट फ़ाइल में स्कोप जोड़ने के निर्देशों का पालन करें. स्कोप जोड़ने के बाद, इस कोड का इस्तेमाल किया जा सकता है:
/** * Gets the own user's profile. * @see https://developers.google.com/people/api/rest/v1/people/getBatchGet */functiongetSelf(){try{// Get own user's profile using People.getBatchGet() methodconstpeople=People.People.getBatchGet({resourceNames:['people/me'],personFields:'names,emailAddresses'// Use other query parameter here if needed});console.log('Myself: %s',JSON.stringify(people,null,2));}catch(err){// TODO (developer) -Handle exceptionconsole.log('Failed to get own profile with an error %s',err.message);}}
/** * Gets the person information for any Google Account. * @param {string} accountId The account ID. * @see https://developers.google.com/people/api/rest/v1/people/get */functiongetAccount(accountId){try{// Get the Account details using account ID.constpeople=People.People.get('people/'+accountId,{personFields:'names,emailAddresses'});// Print the profile details of Account.console.log('Public Profile: %s',JSON.stringify(people,null,2));}catch(err){// TODO (developer) - Handle exceptionconsole.log('Failed to get account with an error %s',err.message);}}
[[["समझने में आसान है","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"]],["आखिरी बार 2025-08-31 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eThe advanced People service in Apps Script utilizes the People API to manage contact data for the logged-in user and access Google user profiles.\u003c/p\u003e\n"],["\u003cp\u003eThis advanced service needs to be enabled before use and mirrors the functionality of the public People API.\u003c/p\u003e\n"],["\u003cp\u003eScripts can create, read, and update contact details for the current user, as well as retrieve profile information for other Google users.\u003c/p\u003e\n"],["\u003cp\u003eSample code snippets are provided to demonstrate functionalities like fetching user connections, retrieving the user's own profile, and getting information for any Google Account by ID.\u003c/p\u003e\n"]]],[],null,[]]