Để sử dụng một dự án có SDM API, bạn phải chỉ định một Mã ứng dụng OAuth cho dự án đó.
Đăng ký sử dụng Device Access
Trước khi tạo dự án đầu tiên, bạn phải đăng ký Device Access.
Việc đăng ký bao gồm việc chấp nhận Điều khoản dịch vụ của Google API và Device Access Sandbox, cùng với khoản phí một lần không hoàn lại (5 USD) cho mỗi tài khoản.
Bạn sẽ không thể tạo dự án cho đến khi chấp nhận cả Điều khoản dịch vụ và thanh toán phí đăng ký. Quy định này áp dụng cho tất cả người dùng, cả người dùng cá nhân và những người muốn tạo sản phẩm thương mại.
Trên màn hình chính của Console, hãy chọn add_circle_outlineTạo dự án. Nếu không thấy lựa chọn này, tức là bạn đã đạt đến giới hạn tài khoản và không thể tạo dự án khác.
Điền thông tin vào từng màn hình trong quy trình tạo:
Nhập tên cho dự án của bạn.
Không bắt buộc. Nhập Mã ứng dụng OAuth 2.0 từ dự án trên Google Cloud. Bạn có thể bỏ qua bước này và cập nhật sau nếu chưa có Client ID. Hãy xem phần Thiết lập Google Cloud Platform để biết hướng dẫn về cách lấy Mã ứng dụng.
Bật hoặc tắt sự kiện. Các sự kiện được quản lý bằng Google Cloud Pub/Sub và cung cấp thông tin cập nhật không đồng bộ cho tất cả các thiết bị và cấu trúc được uỷ quyền cho dự án của bạn. Nếu bạn muốn có sự kiện, hãy chọn Bật sự kiện, sau đó chọn Tạo dự án, rồi chỉnh sửa chủ đề Pub/Sub và cung cấp một mã nhận dạng chủ đề. Nếu bạn không chắc chắn, hãy chọn Tắt.
Bạn luôn có thể bật các tính năng này sau.
Sau khi hoàn tất, dự án của bạn sẽ được chỉ định một mã dự án dưới dạng UUID, chẳng hạn như 32c4c2bc-fe0d-461b-b51c-f3885afff2f0. Hãy ghi lại mã nhận dạng này, bạn cần mã nhận dạng này cho tất cả các lệnh gọi SDM API.
Mã dự án này được dùng trong OAuth và các lệnh gọi API. Khoá này dành riêng choDevice Access dự án của bạn và không liên quan đến mã dự án trên Google Cloud.
Môi trường dự án
Sau khi dự án được tạo, môi trường sẽ được đặt thành Hộp cát . Tất cả các dự án đều bắt đầu trong môi trường này.
Nếu dự định sử dụng Device Access cho mục đích cá nhân, bạn không cần làm gì khác. Dự án của bạn sẽ vẫn nằm trong Hộp cát.
Nếu bạn dự định sử dụng Device Access trong một sản phẩm Nhà thông minh thương mại, hãy xem phần Đăng ký phát triển thương mại để biết các bước tiếp theo.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-29 UTC."],[[["\u003cp\u003eDevice Access projects are created within the Sandbox environment and require a one-time registration fee of US$5 per Google Account.\u003c/p\u003e\n"],["\u003cp\u003eEach Google Account can have up to 3 projects, with each project needing a unique OAuth 2.0 Client ID for SDM API usage.\u003c/p\u003e\n"],["\u003cp\u003eProjects can be used for personal use in the Sandbox environment indefinitely or transitioned to commercial use by applying through a separate process.\u003c/p\u003e\n"],["\u003cp\u003eDuring project creation, you can optionally enable Google Cloud Pub/Sub for asynchronous device and structure updates, but it can also be enabled later.\u003c/p\u003e\n"],["\u003cp\u003eWhen registering for Device Access, ensure you use a consumer Google Account and understand it cannot be changed once associated with a project.\u003c/p\u003e\n"]]],[],null,["# Create a Project\n\nAll new projects created have access to the Device Access Sandbox\nenvironment by default.\n\n- You can create up to 3 projects for a single account.\n- Multiple projects can use the same Project Name, which is displayed during the [Authorization process](/nest/device-access/authorize).\n- Each account is subject to [rate and user\n limits](/nest/device-access/project/limits).\n\nTo use a project with the SDM API, you must specify an OAuth\nClient ID for the project.\n\nRegister for Device Access\n--------------------------\n\nBefore creating your first project, you must register for Device Access.\nRegistration consists of the acceptance of the [Google API](/terms) and [Device\nAccess Sandbox](/nest/device-access/tos) Terms of Service, along with a one-time,\nnon-refundable fee (US$5) per account.\n\nYou will not be able to create a project until you have accepted both Terms of\nService and paid the registration fee. This applies to all users, both\nindividual users and those looking to create a commercial\noffering.\n\nRegister in the Device Access Console, if you haven't already:\n\n[Go to the Device Access Console](https://console.nest.google.com/device-access)\n| **Warning:** You must use a [consumer Google Account](https://support.google.com/work/android/answer/6371476) (for example, a gmail.com account) to register for Device Access. You cannot use a Google Workspace account. If you work for an organization, we suggest registering for Device Access using an account for your team.\n| **Warning:** Once a Google Account is associated with your Device Access Project **it cannot be changed**, be sure you are signed into the correct Google Account before continuing.\n\nCreate your project\n-------------------\n\nOnce registered, create a project:\n\n1. At the Console home screen, select **add_circle_outline Create\n project**. If you don't see this option, you're already at your account's limit and cannot create another project.\n2. Fill out each screen in the creation process:\n 1. Enter a name for your project.\n 2. *Optional.* Enter the OAuth 2.0 Client ID from your Google Cloud project. You can skip this and update it later if you don't have a Client ID yet. See [Set up Google Cloud Platform](/nest/device-access/get-started#set_up_google_cloud_platform) for instructions on how to obtain a Client ID. **Note:** To use a project with the SDM API:\n | - You must specify a valid OAuth Client ID for the project.\n | - An OAuth Client ID must be valid and unique to a project, and cannot be shared with other projects.\n 3. Enable or disable events. Events are managed by Google Cloud Pub/Sub and provide asynchronous updates for all devices and structures authorized for your project. If you want events, select **Enable events** , then **Create Project** , and then edit the Pub/Sub topic and provide a Topic ID. If you're not sure, select **Disable**. They can always be enabled later.\n3. Upon completion, your project is assigned a Project ID, in the form of a UUID, such as `32c4c2bc-fe0d-461b-b51c-f3885afff2f0`. Make note of this ID, you need it for all SDM API calls.\n\nThis Project ID is used in OAuth and API calls. It is specific to your\nDevice Access project, and is not related to a Google Cloud\nProject ID.\n| **Caution:** Exiting the project creation flow at any time during the process will discard all data you have entered.\n\nProject environment\n-------------------\n\nOnce your project is created, the environment is set to Sandbox . All\nprojects start in this environment.\n\nIf you plan to use Device Access for personal use, you don't need to do anything\nelse. Your project will remain in the Sandbox.\n\nIf you plan to use Device Access as part of a Commercial smart home\noffering, see [Apply for Commercial Development](/nest/device-access/project/apply) for next\nsteps."]]