Le CPI peut désormais installer un appareil CBSD (Citizens Broadband Radio Service) doté de tous les paramètres requis.
Enregistrement CBSD en plusieurs étapes
Vous pouvez effectuer un enregistrement CBSD en plusieurs étapes avec des paramètres d'appareil précédemment signés par un CPI ou avec un compte CPI.
Paramètres de l'appareil précédemment signés par un CPI
Cet exemple montre comment créer une configuration d'appareil inactive avec des paramètres d'installation CBSD précédemment encodés par un CPI. Par conséquent, les utilisateurs non-CPI peuvent également créer la configuration.
Utilisez la clé privée du CPI pour encoder les paramètres CBSD. Nous vous recommandons d'utiliser le format de jeton Web JSON.
Définissez ${ENCODED_DEVICE} sur la chaîne JWT et ${CPI_ID} sur l'ID du CPI.
Le CBSD doit ensuite envoyer une demande d'enregistrement à SAS pour finaliser son enregistrement.
Compte CPI
L'identité du CPI doit être validée avant de valider une configuration d'appareil. Une fois cette opération effectuée, utilisez la commande suivante pour créer une configuration d'appareil inactive:
Remplacez ${DEVICE} par la représentation JSON des paramètres d'enregistrement du CBSD. Pour en savoir plus sur le format, consultez la section Ressource REST: customers.devices.
Le CBSD doit ensuite envoyer une demande d'enregistrement à SAS pour finaliser son enregistrement.
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/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[],[],null,["# API code samples\n\nThis page contains code samples for the Google Spectrum Access System (SAS) Portal API.\n\nBefore you begin\n----------------\n\nFor the following examples, ensure that you complete the following prerequisites:\n\n- [Obtain a token with your service account](/spectrum-access-system/docs/authorization-and-authentication) `TOKEN=$(gcloud auth print-access-token)`.\n- Set \u003cvar translate=\"no\"\u003e${CLIENT_PROJECT}\u003c/var\u003e to the project ID of the Google Cloud project.\n\nList current customers\n----------------------\n\n1. Return all of the customers that the caller has access to:\n\n ```\n curl -X GET -H \"X-Goog-User-Project: ${CLIENT_PROJECT}\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer ${TOKEN}\" \\\"https://sasportal.googleapis.com/v1alpha1/customers\"\n ```\n2. Save the customer name that is returned as a variable:\n\n ```\n CUSTOMER_NAME=customers/...\n ```\n\nCreate a new device configuration\n---------------------------------\n\n1. Set the \u003cvar translate=\"no\"\u003e${FCCID}\u003c/var\u003e and \u003cvar translate=\"no\"\u003e${SN}\u003c/var\u003e of the device\n that you want to create:\n\n ```\n FCCID=f1\n SN=sn1\n ```\n2. Create the device configuration:\n\n ```\n curl -X POST -H \"X-Goog-User-Project: ${CLIENT_PROJECT}\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer ${TOKEN}\" \\ \"https://sasportal.googleapis.com/v1alpha1/${CUSTOMER_NAME}/devices\" \\\n -d \"{ \\\"fcc_id\\\": \\\"$FCCID\\\", \\\"serial_number\\\": \\\"$SN\\\", \\\"preloaded_config\\\": { \\\"call_sign\\\": \\\"cs1\\\", \\\"category\\\": \\\"DEVICE_CATEGORY_A\\\"}}\"\n ```\n\n The command returns a newly created device configuration.\n3. Save the device name as a variable:\n\n ```\n DEVICE_NAME=customers/.../devices/...\n ```\n\nList current devices\n--------------------\n\n```\ncurl -X GET -H \"X-Goog-User-Project: ${CLIENT_PROJECT}\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $TOKEN\" \\ \"https://sasportal.googleapis.com/v1alpha1/${CUSTOMER_NAME}/devices\"\n```\n\nRetrieve devices by name\n------------------------\n\n```\ncurl -X GET -H \"X-Goog-User-Project: ${CLIENT_PROJECT}\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $TOKEN\" \\\n \"https://sasportal.googleapis.com/v1alpha1/${DEVICE_NAME}\"\n```\n\nUpdate an existing device\n-------------------------\n\n```\ncurl -X PATCH -H \"X-Goog-User-Project: ${CLIENT_PROJECT}\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $TOKEN\" \\\n \"https://sasportal.googleapis.com/v1alpha1/${DEVICE_NAME}\" \\\n```\n\nValidate your Certified Professional Installer (CPI) identity and certification\n-------------------------------------------------------------------------------\n\n1. Generate the secret string:\n\n ```\n curl -X POST -H \"X-Goog-User-Project: ${CLIENT_PROJECT}\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $TOKEN\" \\ \"https://sasportal.googleapis.com/v1alpha1/installer:generateSecret\" \\\n -d \"{}\"\n ```\n\n The output is similar to the following: \n\n ```\n {\n \"secret\": \"\u003cgenerated secret\u003e\"\n }\n ```\n2. Use the [JSON Web Token format](/spectrum-access-system/docs/json-web-token-format)\n to encode the secret string into a JWT.\n\n3. Set the following:\n\n 1. \u003cvar translate=\"no\"\u003e${SECRET}\u003c/var\u003e to the secret string\n 2. \u003cvar translate=\"no\"\u003e${ENCODED_SECRET}\u003c/var\u003e to the JWT string\n 3. \u003cvar translate=\"no\"\u003e${CPI_ID}\u003c/var\u003e to the ID of the CPI\n4. Validate the identity and certification of the CPI:\n\n ```\n curl -X POST -H \"X-Goog-User-Project: ${CLIENT_PROJECT}\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $TOKEN\" \\ \"https://sasportal.googleapis.com/v1alpha1/installer:validate\" \\\n -d \"{ \\\"installer_id\\\": \\\"${CPI_ID}\\\", \\\"secret\\\": \\\"${SECRET}\\\", \\\"encoded_secret\\\": \\\"${ENCODED_SECRET}\\\" }\"\n ```\n\nNow the CPI can install a Citizens Broadband Radio Service Device (CBSD) that has all the required parameters.\n\nMultistep CBSD registration\n---------------------------\n\nYou can perform multistep CBSD registration with device parameters\npreviously signed by a CPI or with a CPI account.\n\n### Device parameters previously signed by a CPI\n\nThis sample shows how to create an inactive device configuration with\nCBSD installation parameters previously encoded by a CPI. As a\nresult, the non-CPI users can also create the configuration.\n\n1. Use the CPI's private key to encode the CBSD parameters. We recommend that you use the [JSON Web Token format](/spectrum-access-system/docs/json-web-token-format).\n2. Set \u003cvar translate=\"no\"\u003e${ENCODED_DEVICE}\u003c/var\u003e to the JWT string and \u003cvar translate=\"no\"\u003e${CPI_ID}\u003c/var\u003e to the ID of the CPI.\n3. Create the inactive device configuration:\n\n ```\n curl -X POST -H \"X-Goog-User-Project: ${CLIENT_PROJECT}\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer ${TOKEN}\" \\ \"https://sasportal.googleapis.com/v1alpha1/${CUSTOMER_NAME}/devices:createSigned\" \\\n -d \"{ \\\"installer_id\\\": \\\"${CPI_ID}\\\", \\\"encoded_device\\\": \\\"${ENCODED_DEVICE}\\\", \\\"parent\\\": \\\"${CUSTOMER_NAME}\\\" }\"\n ```\n\nThe CBSD must then send a registration request to SAS to complete its registration.\n\n### CPI account\n\nThe CPI's identity must be validated *before* you [validate](/spectrum-access-system/docs/validate-cpi-identity)\na device configuration. When that is done, use the following command to create an inactive device configuration: \n\n```\n curl -X POST -H \"X-Goog-User-Project: ${CLIENT_PROJECT}\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Authorization: Bearer $TOKEN\" \\ \"https://sasportal.googleapis.com/v1alpha1/${DEVICE_NAME}:signDevice\" \\\n -d \"${DEVICE}\"\n```\n\nReplace \u003cvar translate=\"no\"\u003e${DEVICE}\u003c/var\u003e with the JSON representation of the\nCBSD registration parameters. For more information about the\nformat, see [REST Resource: customers.devices](/spectrum-access-system/docs/reference/rest/customers.devices).\n\nThe CBSD must then send a registration request to SAS to complete its registration.\n\nWhat's next\n-----------\n\n- To get an overview of the SAS Portal API, see [Google SAS Portal API overview](/spectrum-access-system/docs/overview-api).\n- For information about each API, see [Customers API](/spectrum-access-system/docs/customers-api) and [Device Manager API](/spectrum-access-system/docs/device-manager-api).\n- For reference documentation, see [APIs and reference](/spectrum-access-system/docs/apis)."]]