Agora o CPI pode instalar um dispositivo de serviço de rádio de banda larga dos cidadãos (CBSD, na sigla em inglês) com todos os parâmetros necessários.
Registro multietapa da CBSD
É possível realizar o registro em várias etapas do CBSD com parâmetros de dispositivo
assinados anteriormente por um CPI ou com uma conta de CPI.
Parâmetros do dispositivo assinados anteriormente por um CPI
Este exemplo mostra como criar uma configuração de dispositivo inativo com
parâmetros de instalação do CBSD codificados anteriormente por um CPI. Como
resultado, os usuários que não têm CPI também podem criar a configuração.
Use a chave privada do CPI para codificar os parâmetros do CBSD. Recomendamos
que você use o formato JSON Web Token.
Defina ${ENCODED_DEVICE} como a string JWT e ${CPI_ID} como
o ID do CPI.
O CBSD precisa enviar uma solicitação de registro à SAS para concluir o registro.
Conta do CPI
A identidade do CPI precisa ser validada antes de você validar
uma configuração do dispositivo. Depois disso, use o comando abaixo para criar uma configuração de dispositivo inativo:
Substitua ${DEVICE} pela representação JSON dos
parâmetros de registro do CSDB. Para mais informações sobre o
formato, consulte Recurso REST: customers.devices.
O CBSD precisa enviar uma solicitação de registro à SAS para concluir o registro.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 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)."]]