เตรียมพร้อมใช้ People API
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ก่อนที่จะเริ่มเขียนโค้ดสำหรับแอปพลิเคชันไคลเอ็นต์รายการแรก คุณต้องทำ 3 สิ่งต่อไปนี้
- รับบัญชี Google
- สร้างโปรเจ็กต์
- ตั้งค่าแอป
คู่มือนี้จะแนะนำคุณเกี่ยวกับงานเหล่านั้น หากคุณยังไม่ได้ทำ
1. รับบัญชี Google
คุณต้องมีบัญชี Google เพื่อสร้างโปรเจ็กต์ในคอนโซล Google API หากคุณมีบัญชีอยู่แล้ว
แสดงว่าคุณพร้อมใช้งาน คุณอาจต้องการบัญชี Google แยก
เพื่อวัตถุประสงค์ในการทดสอบ
2. สร้างโปรเจ็กต์สำหรับไคลเอ็นต์
ก่อนที่จะส่งคำขอไปยัง People API ได้ คุณต้องแจ้งให้ Google ทราบเกี่ยวกับไคลเอ็นต์และเปิดใช้งานการเข้าถึง API ดังกล่าว โดยใช้คอนโซล Google API เพื่อสร้างโปรเจ็กต์ ซึ่งเป็นคอลเล็กชันการตั้งค่าและข้อมูลการเข้าถึง API ที่มีชื่อ แล้วลงทะเบียนแอปพลิเคชันของคุณ
หากต้องการเริ่มต้นใช้งาน People API ก่อนอื่นคุณต้องใช้เครื่องมือตั้งค่า ซึ่งจะแนะนำขั้นตอนการสร้างโปรเจ็กต์ในคอนโซล Google API เปิดใช้ API และสร้างข้อมูลเข้าสู่ระบบ
3. ตั้งค่าแอป
หากคุณใช้ภาษาที่รองรับ ให้พิจารณาใช้ไลบรารีของไคลเอ็นต์รายการใดรายการหนึ่ง คุณต้องตั้งค่าการให้สิทธิ์ก่อนจึงจะส่งคำขอไปยัง API ได้
ลองดูที่โค้ดตัวอย่างสำหรับการเริ่มใช้งานอย่างรวดเร็วซึ่งแสดงให้คุณเห็นวิธีดึงรายชื่อติดต่อในภาษาต่างๆ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-29 UTC
[null,null,["อัปเดตล่าสุด 2025-08-29 UTC"],[[["\u003cp\u003eTo begin coding your client application, you must first obtain a Google Account, create a project in the Google API Console, and set up your app.\u003c/p\u003e\n"],["\u003cp\u003eCreating a project involves informing Google about your client and activating API access using the Google API Console, where you can register your application and manage settings.\u003c/p\u003e\n"],["\u003cp\u003eBefore making requests to the API, ensure you've set up authorization and consider utilizing client libraries if your language is supported.\u003c/p\u003e\n"]]],["To start coding, you must first obtain a Google Account. Then, use the Google API Console to create a project, which involves registering your application and enabling API access via the setup tool. Finally, set up your application, potentially using a client library and ensuring proper authorization before making API requests. Sample code is available to demonstrate fetching a list of contacts in various languages.\n"],null,["# Get Ready to Use the People API\n\nBefore you can start coding your first client application, you need to do three\nthings:\n\n1. Get a Google Account\n2. Create a project\n3. Set up your app\n\nThis guide walks you through those tasks, if you haven't done them already.\n\n1. Get a Google Account\n-----------------------\n\nYou need a [Google Account](https://www.google.com/accounts/NewAccount) in order\nto [create a project](#project) in the Google API Console. If you already have\nan account, then you're all set. You may also want a separate Google Account for\ntesting purposes.\n\n2. Create a project for your client\n-----------------------------------\n\nBefore you can send requests to the People API, you need to tell Google\nabout your client and activate access to the API. You do this by using the Google API Console to create a project, which is a named collection of\nsettings and API access information, and register your application.\n\nTo get started using People API, you need to first\n[use\nthe setup tool](https://console.cloud.google.com/start/api?id=people.googleapis.com&credential=client_key), which guides you through creating a project in the\nGoogle API Console, enabling the API, and creating credentials.\n\n3. Set up your app\n------------------\n\nIf you are using one of the supported languages, consider using one of the\n[client libraries](/people/v1/libraries). Before you can make requests to the\nAPI, you must set up [authorization](/people/v1/how-tos/authorizing).\n\nTake a look at the\n[quick start sample code](https://developers.google.com/people/quickstart/js)\nwhich shows you how to fetch a list of contacts in a variety of languages."]]