Apigee genera automaticamente chiavi utente e secret utente quando crei app sviluppatore e le associ ai prodotti API. Queste procedure sono descritte in
Controllo dell'accesso alle API mediante la registrazione delle app. Tuttavia, potresti avere chiavi utente e secret esistenti che vuoi importare in Apigee da un altro sistema. Tecnicamente, questa procedura non è un'importazione. Ricrea le chiavi esistenti in Apigee una alla volta.
Per una descrizione dei campi che puoi fornire nel corpo della richiesta,
consulta Risorsa: DeveloperAppKey.
Associa la chiave/il secret del consumer a uno o più prodotti API Apigee. In questo modo, la chiave consumer importata (chiamata anche chiave API) può essere utilizzata nelle chiamate ai proxy API in cui l'autorizzazione è controllata dai prodotti.
Consulta l'API
ReplaceDeveloperAppKey. Ecco il ricciolo:
(Facoltativo) Elimina la chiave/il secret consumer iniziale generato automaticamente da Apigee. Tuttavia, puoi
conservare la chiave generata automaticamente. Sia la chiave importata sia quella generata automaticamente funzionano nelle chiamate API e vengono visualizzate nella pagina Dettagli app sviluppatore nella UI di Apigee.
Consulta la
chiave API delete per l'API dell'app per sviluppatori.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eThis guide applies to both Apigee and Apigee hybrid platforms, focusing on managing consumer keys and secrets.\u003c/p\u003e\n"],["\u003cp\u003eWhile Apigee automatically creates consumer keys and secrets, users can recreate existing ones from external systems, up to the 2KB size limit for both keys and secrets.\u003c/p\u003e\n"],["\u003cp\u003eConsumer keys and secrets can be created using the Apigee API and should be associated with one or more API products to authorize API proxy calls.\u003c/p\u003e\n"],["\u003cp\u003eYou have the option to delete the initially auto-generated keys, but you can also retain them alongside your imported keys.\u003c/p\u003e\n"]]],[],null,["# Import existing consumer keys and secrets\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\nApigee automatically generates consumer keys and consumer secrets when you create\ndeveloper apps and associate them with API products. (Those procedures are covered in\n[Controlling access to your APIs by registering apps](/apigee/docs/api-platform/publish/creating-apps-surface-your-api).) However, you may have existing\nconsumer keys and secrets that you want to import into\nApigee from another system. Technically, this process isn't an import. It's recreating the\nexisting keys in Apigee one at a time.\n| **Caution:** Be aware of the following size limits on API keys. By staying within these limits, you help avoid service disruptions.\n\n| **Note:** Consumer keys and secrets can contain letters, numbers, underscores, and hyphens. No other special characters are allowed.\n\n1. **Create the consumer keys and secrets** using the Apigee API. \n See the [`create` a consumer key and secret API](/apigee/docs/reference/apis/apigee/rest/v1/organizations.developers.apps.keys/create). Here's the curl: \n\n ```\n curl https://apigee.googleapis.com/v1/organizations/{org}/developers/{developer_email}/apps/{app_name}/keys \\\n -X POST \\\n -H \"Authorization: Bearer $TOKEN\" \\\n -H 'Content-type:application/json' \\\n -d \\\n '{\n \"consumerKey\": \"key\",\n \"consumerSecret\": \"secret\",\n \"expiresInSeconds\": \"180\"\n }'\n ```\n\n Where `$TOKEN` is set to your OAuth 2.0 access token, as described in\n [Obtaining an OAuth 2.0 access token](/apigee/docs/api-platform/get-started/api-get-started#oauth20). For information about the `curl` options used in this example, see\n [Using curl](/apigee/docs/api-platform/get-started/api-get-started#curl). For a description of environment variables you can use, see\n [Setting\n environment variables for Apigee API requests](/apigee/docs/api-platform/get-started/api-get-started#api-environment-variables).\n\n\n For a description of the fields that you can provide in the request body,\n see [Resource: DeveloperAppKey](/apigee/docs/reference/apis/apigee/rest/v1/organizations.developers.apps.keys.create).\n2. **Associate the consumer key/secret with one or more Apigee API products** . Doing this allows the imported consumer key (also called the API key) to be used in calls to API proxies where authorization is controlled by products. \n See the [`ReplaceDeveloperAppKey` API](/apigee/docs/reference/apis/apigee/rest/v1/organizations.developers.apps.keys/replaceDeveloperAppKey). Here's the curl: \n\n ```\n curl https://apigee.googleapis.com/v1/organizations/{org}/developers/{developer_email}/apps/{app_name}/keys/{key} \\\n -X POST \\\n -H \"Authorization: Bearer $TOKEN\" \\\n -H 'Content-type:application/json' \\\n -d \\\n '{\n \"apiProducts\": [\"product_1\", \"product_2\"]\n }'\n ```\n\n Where `$TOKEN` is set to your OAuth 2.0 access token, as described in\n [Obtaining an OAuth 2.0 access token](/apigee/docs/api-platform/get-started/api-get-started#oauth20). For information about the `curl` options used in this example, see\n [Using curl](/apigee/docs/api-platform/get-started/api-get-started#curl). For a description of environment variables you can use, see\n [Setting\n environment variables for Apigee API requests](/apigee/docs/api-platform/get-started/api-get-started#api-environment-variables).\n3. Optionally delete the initial consumer key/secret that Apigee auto-generated. However, you can keep the auto-generated key. Both the imported key and the auto-generated key work in API calls, and both are displayed on the Developer App Details page in the Apigee UI. \n See the [`delete` API key for developer app API](/apigee/docs/reference/apis/apigee/rest/v1/organizations.developers.apps.keys/delete)."]]