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

গুগল অ্যাপস স্ক্রিপ্ট ২০২২ সালের ১৬ই ডিসেম্বর কন্টাক্টস পরিষেবাটিকে অপ্রচলিত ঘোষণা করে এবং ২০২৫ সালের ৩১শে জানুয়ারি পরিষেবাটি বন্ধ করে দেয়।

এর পরিবর্তে, পিপল এপিআই অ্যাডভান্সড সার্ভিসটি ব্যবহার করুন। পিপল এপিআই একটি নতুন JSON প্রোটোকল ব্যবহার করে এবং কন্ট্যাক্ট ও প্রোফাইল মার্জ করার মতো উন্নত ফিচার প্রদান করে।

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

People API সমতুল্য ছাড়া পদ্ধতিসমূহ

নিম্নলিখিত তালিকায় Contacts সার্ভিসের সেইসব getContacts মেথডগুলো উল্লেখ করা হলো, যেগুলোর সমতুল্য কোনো উপায় People API অ্যাডভান্সড সার্ভিসে নেই। People API অ্যাডভান্সড সার্ভিসের মাধ্যমে, আপনি CONTACT সোর্স থেকে প্রাপ্ত কোনো কন্ট্যাক্টের names , nickNames , emailAddresses , phoneNumbers এবং organizations ফিল্ড ব্যবহার করে অনুসন্ধান করতে পারেন।

সমতুল্যবিহীন পদ্ধতি
  • 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)

নিম্নলিখিত সারণীতে Contacts সার্ভিসের সেইসব getContacts মেথডের তালিকা দেওয়া হয়েছে যেগুলো একটি অতিরিক্ত label প্যারামিটার ব্যবহার করে। যদিও People API অ্যাডভান্সড সার্ভিস আপনাকে searchContacts ব্যবহার করে সমতুল্য ফিল্ডের মাধ্যমে কন্ট্যাক্ট পেতে দেয়, আপনি সার্চটিকে একটি নির্দিষ্ট লেবেলে সীমাবদ্ধ করতে পারবেন না।

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

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

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

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

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

নাম দিয়ে একটি কন্টাক্ট গ্রুপ খুঁজুন

নিম্নলিখিত কোড নমুনাটি দেখায় কিভাবে নামের মাধ্যমে একটি কন্টাক্ট গ্রুপ পাওয়া যায়, যা Contacts সার্ভিসের getContactGroup এর সমতুল্য।

উন্নত/মানুষ.জিএস
/**
 * 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,
    );
  }
}

ইমেল ঠিকানার মাধ্যমে যোগাযোগ করুন

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

উন্নত/মানুষ.জিএস
/**
 * 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);
  }
}

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

নিম্নলিখিত কোড নমুনাটি দেখায় কিভাবে একজন ব্যবহারকারীর সমস্ত পরিচিতি পাওয়া যায়, যা Contacts সার্ভিসের 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);
  }
}

পরিচিত ব্যক্তির পুরো নাম জানুন

নিম্নলিখিত কোড নমুনাটি দেখায় কিভাবে কোনো কন্ট্যাক্টের পুরো নাম পাওয়া যায়, যা Contacts সার্ভিসের 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);
  }
}

একজন পরিচিতির সমস্ত ফোন নম্বর পান

নিম্নলিখিত কোড নমুনাটি দেখায় কিভাবে একটি কন্ট্যাক্টের সমস্ত ফোন নম্বর পাওয়া যায়, যা Contacts সার্ভিসের 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);
  }
}

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

নিম্নলিখিত কোড নমুনাটি দেখায় কিভাবে কোনো কন্ট্যাক্টের জন্য একটি নির্দিষ্ট ফোন নম্বর পাওয়া যায়, যা Contacts সার্ভিসের 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);
  }
}