Pour utiliser un projet avec l'API SDM, vous devez spécifier un ID client OAuth pour le projet.
S'inscrire à Device Access
Avant de créer votre premier projet, vous devez vous inscrire à Device Access.
L'inscription consiste à accepter les conditions d'utilisation de l'API Google et du bac à sable Device Access, ainsi qu'à payer des frais uniques non remboursables (5 $) par compte.
Vous ne pourrez pas créer de projet tant que vous n'aurez pas accepté les conditions d'utilisation et payé les frais d'inscription. Cela s'applique à tous les utilisateurs, qu'il s'agisse de particuliers ou de personnes souhaitant créer une offre commerciale.
Si ce n'est pas déjà fait, inscrivez-vous dans la console Device Access :
Sur l'écran d'accueil de la console, sélectionnez add_circle_outlineCréer un projet. Si cette option ne s'affiche pas, cela signifie que vous avez déjà atteint la limite de votre compte et que vous ne pouvez pas créer d'autre projet.
Remplissez chaque écran du processus de création :
Saisissez le nom de votre projet.
Facultatif. Saisissez l'ID client OAuth 2.0 de votre projet Google Cloud. Vous pouvez ignorer cette étape et mettre à jour l'ID client ultérieurement si vous n'en avez pas encore. Pour savoir comment obtenir un ID client, consultez Configurer Google Cloud Platform.
Activez ou désactivez les événements. Les événements sont gérés par Google Cloud Pub/Sub et fournissent des mises à jour asynchrones pour tous les appareils et structures autorisés pour votre projet. Si vous souhaitez des événements, sélectionnez Activer les événements, puis Créer un projet. Modifiez ensuite le sujet Pub/Sub et indiquez un ID de sujet. En cas de doute, sélectionnez Désactiver.
Vous pourrez toujours les activer plus tard.
Une fois votre projet terminé, un ID de projet lui est attribué sous la forme d'un UUID, tel que 32c4c2bc-fe0d-461b-b51c-f3885afff2f0. Notez cet ID, car vous en aurez besoin pour tous les appels d'API SDM.
Cet ID de projet est utilisé dans les appels OAuth et d'API. Il est spécifique à votre projetDevice Access et n'est pas lié à un ID de projet Google Cloud.
Environnement du projet
Une fois votre projet créé, l'environnement est défini sur Bac à sable . Tous les projets commencent dans cet environnement.
Si vous prévoyez d'utiliser Device Access pour un usage personnel, vous n'avez rien d'autre à faire. Votre projet restera dans le bac à sable.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/29 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 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,["All 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\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\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\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."]]