পরিচিতি পরিষেবা থেকে মানুষ API উন্নত পরিষেবাতে স্থানান্তর করুন৷

গুরুত্বপূর্ণ : Apps স্ক্রিপ্ট মার্চ, 2023 এ পরিচিতি পরিষেবা বন্ধ করার আগে আপনার স্ক্রিপ্টগুলি পরিচিতি পরিষেবা থেকে People API উন্নত পরিষেবাতে স্থানান্তর করুন৷

অ্যাপস স্ক্রিপ্ট 16,2022 সালের ডিসেম্বরে পরিচিতি পরিষেবাটি বাতিল করেছে৷ পরিবর্তে, People API উন্নত পরিষেবা ব্যবহার করুন। পিপল এপিআই একটি নতুন JSON প্রোটোকল ব্যবহার করে এবং প্রোফাইলের সাথে পরিচিতি মার্জ করার মতো উন্নত বৈশিষ্ট্য প্রদান করে।

পিপল এপিআই অ্যাডভান্স সার্ভিসে কোন পরিচিতি পরিষেবা পদ্ধতিগুলির সমতুল্য নেই তা জানতে এই নির্দেশিকাটি ব্যবহার করুন, এর পরিবর্তে আপনি কী ব্যবহার করতে পারেন তা শিখুন এবং সাধারণ কাজগুলি স্থানান্তর করার জন্য কোড নমুনাগুলি খুঁজুন৷ আরও তথ্যের জন্য, পরিচিতি API মাইগ্রেশন গাইড পড়ুন।

মানুষ API সমতুল্য ছাড়া পদ্ধতি

নিম্নলিখিত তালিকাগুলি পরিচিতি পরিষেবাতে getContacts পদ্ধতিগুলিকে তালিকাভুক্ত করে যেগুলিতে People API উন্নত পরিষেবাতে পরিচিতিগুলি অনুসন্ধান করার সমতুল্য উপায় নেই৷ পিপল এপিআই উন্নত পরিষেবার সাহায্যে, আপনি পরিচিতির names , nickNames , emailAddresses , phoneNumbers এবং organizations ক্ষেত্রগুলি দ্বারা অনুসন্ধান করতে পারেন যা CONTACT উত্স থেকে এসেছে৷

সমতুল্য ছাড়া পদ্ধতি
  • getContactsByAddress(query)
  • getContactsByAddress(query, label)
  • getContactsByAddress(query, label)
  • getContactsByCustomField(query, label)
  • getContactsByDate(month, day, label)
  • getContactsByDate(month, day, year, label)
  • getContactsByDate(month, day, year, label)
  • getContactsByIM(query)
  • getContactsByIM(query, label)
  • getContactsByJobTitle(query)
  • getContactsByNotes(query)
  • getContactsByUrl(query)
  • getContactsByUrl(query, label)
  • getContactsByGroup(group)

নিম্নলিখিত তালিকাগুলি পরিচিতি পরিষেবা থেকে getContacts পদ্ধতিগুলি যা একটি অতিরিক্ত label প্যারামিটার ব্যবহার করে৷ আপনি সমতুল্য ক্ষেত্র দ্বারা পরিচিতি পেতে People API উন্নত পরিষেবা থেকে searchContacts ব্যবহার করতে পারেন, কিন্তু আপনি একটি নির্দিষ্ট লেবেলে অনুসন্ধান সীমাবদ্ধ করতে পারবেন না।

আংশিক সমতুল্য সহ পদ্ধতি
  • getContactsByEmailAddress(query, label)
  • getContactsByName(query, label)
  • getContactsByPhone(query, label)

People API-এর সাথে অতিরিক্ত বৈশিষ্ট্য উপলব্ধ

আপনি যখন পিপল এপিআই অ্যাডভান্স সার্ভিসে মাইগ্রেট করেন, তখন আপনি নিম্নলিখিত পিপল এপিআই বৈশিষ্ট্যগুলি অ্যাক্সেস করতে পারেন যা পরিচিতি পরিষেবাতে উপলব্ধ নয়:

সাধারণ কাজের জন্য কোড নমুনা

এই বিভাগে পরিচিতি পরিষেবা থেকে সাধারণ কাজগুলি তালিকাভুক্ত করা হয়েছে৷ কোড নমুনাগুলি দেখায় কিভাবে পিপল এপিআই উন্নত পরিষেবা ব্যবহার করে কাজগুলি তৈরি করতে হয়।

নামে একটি পরিচিতি গ্রুপ পান

নিম্নলিখিত কোড নমুনা দেখায় কিভাবে একটি পরিচিতি গোষ্ঠীকে তার নামের দ্বারা পেতে হয়, যা পরিচিতি পরিষেবাতে getContactGroup(name) এর সমতুল্য।

উন্নত/মানুষ.জিএস
/**
 * Gets a contact group with the given name
 * @param {string} name The group name.
 * @see https://developers.google.com/people/api/rest/v1/contactGroups/list
 */
function getContactGroup(name) {
  try {
    const people = People.ContactGroups.list();
    // Finds the contact group for the person where the name matches.
    const group = people['contactGroups'].find((group) => group['name'] === name);
    // Prints the contact group
    console.log('Group: %s', JSON.stringify(group, null, 2));
  } catch (err) {
    // TODO (developers) - Handle exception
    console.log('Failed to get the contact group with an error %s', err.message);
  }
}

ইমেল ঠিকানা দ্বারা একটি পরিচিতি পান

নিম্নলিখিত কোড নমুনা দেখায় কিভাবে একটি পরিচিতি তাদের ইমেল ঠিকানা দ্বারা পেতে হয়, যা পরিচিতি পরিষেবাতে getContact(emailAddress) এর সমতুল্য।

উন্নত/মানুষ.জিএস
/**
 * Gets a contact by the email address.
 * @param {string} email The email address.
 * @see https://developers.google.com/people/api/rest/v1/people.connections/list
 */
function getContactByEmail(email) {
  try {
    // Gets the person with that email address by iterating over all contacts.
    const people = People.People.Connections.list('people/me', {
      personFields: 'names,emailAddresses'
    });
    const contact = people['connections'].find((connection) => {
      return connection['emailAddresses'].some((emailAddress) => emailAddress['value'] === email);
    });
    // Prints the contact.
    console.log('Contact: %s', JSON.stringify(contact, null, 2));
  } catch (err) {
    // TODO (developers) - Handle exception
    console.log('Failed to get the connection with an error %s', err.message);
  }
}

সমস্ত পরিচিতি পান

নিম্নলিখিত কোড নমুনা দেখায় কিভাবে একজন ব্যবহারকারীর সমস্ত পরিচিতি পেতে হয়, যা পরিচিতি পরিষেবাতে getContacts() এর সমতুল্য।

উন্নত/মানুষ.জিএস
/**
 * Gets a list of people in the user's contacts.
 * @see https://developers.google.com/people/api/rest/v1/people.connections/list
 */
function getConnections() {
  try {
    // Get the list of connections/contacts of user's profile
    const people = People.People.Connections.list('people/me', {
      personFields: 'names,emailAddresses'
    });
    // Print the connections/contacts
    console.log('Connections: %s', JSON.stringify(people, null, 2));
  } catch (err) {
    // TODO (developers) - Handle exception here
    console.log('Failed to get the connection with an error %s', err.message);
  }
}

পরিচিতির পুরো নাম পান

নিম্নলিখিত কোড নমুনা দেখায় কিভাবে একটি পরিচিতির পুরো নাম পেতে হয়, যা পরিচিতি পরিষেবাতে getFullName() এর সমতুল্য।

উন্নত/মানুষ.জিএস
/**
 * Gets the full name (given name and last name) of the contact as a string.
 * @see https://developers.google.com/people/api/rest/v1/people/get
 */
function getFullName() {
  try {
    // Gets the person by specifying resource name/account ID
    // in the first parameter of People.People.get.
    // This example gets the person for the user running the script.
    const people = People.People.get('people/me', {personFields: 'names'});
    // Prints the full name (given name + family name)
    console.log(`${people['names'][0]['givenName']} ${people['names'][0]['familyName']}`);
  } catch (err) {
    // TODO (developers) - Handle exception
    console.log('Failed to get the connection with an error %s', err.message);
  }
}

যোগাযোগের জন্য সমস্ত ফোন নম্বর পান

নিম্নলিখিত কোড নমুনা দেখায় কিভাবে একটি পরিচিতির জন্য সমস্ত ফোন নম্বর পেতে হয়, যা পরিচিতি পরিষেবাতে getPhones() এর সমতুল্য।

উন্নত/মানুষ.জিএস
/**
 * Gets all the phone numbers for this contact.
 * @see https://developers.google.com/people/api/rest/v1/people/get
 */
function getPhoneNumbers() {
  try {
    // Gets the person by specifying resource name/account ID
    // in the first parameter of People.People.get.
    // This example gets the person for the user running the script.
    const people = People.People.get('people/me', {personFields: 'phoneNumbers'});
    // Prints the phone numbers.
    console.log(people['phoneNumbers']);
  } catch (err) {
    // TODO (developers) - Handle exception
    console.log('Failed to get the connection with an error %s', err.message);
  }
}

একটি পরিচিতির জন্য একটি নির্দিষ্ট ফোন নম্বর পান

নিম্নলিখিত কোড নমুনা দেখায় কিভাবে একটি পরিচিতির জন্য একটি নির্দিষ্ট ফোন নম্বর পেতে হয়, যা পরিচিতি পরিষেবাতে getPhoneNumber() এর সমতুল্য।

উন্নত/মানুষ.জিএস
/**
 * Gets a phone number by type, such as work or home.
 * @see https://developers.google.com/people/api/rest/v1/people/get
 */
function getPhone() {
  try {
    // Gets the person by specifying resource name/account ID
    // in the first parameter of People.People.get.
    // This example gets the person for the user running the script.
    const people = People.People.get('people/me', {personFields: 'phoneNumbers'});
    // Gets phone number by type, such as home or work.
    const phoneNumber = people['phoneNumbers'].find((phone) => phone['type'] === 'home')['value'];
    // Prints the phone numbers.
    console.log(phoneNumber);
  } catch (err) {
    // TODO (developers) - Handle exception
    console.log('Failed to get the connection with an error %s', err.message);
  }
}