Import existing consumer keys and secrets

You're viewing Apigee Edge documentation.
Go to the Apigee X documentation.
info

Apigee Edge automatically generates consumer keys and consumer secrets when you create developer apps and associate them with API products. (Those procedures are covered in Register apps and manage API keys.) However, you may have existing consumer keys and secrets that you want to import into Apigee Edge from another system. Technically, this process isn't an import. It's recreating the existing keys in Edge one at a time.

Consumer key (API key) size 2 KB
Consumer secret size 2 KB
  1. Create the consumer keys and secrets in Edge with the management API, one at a time.
    See the create a consumer key and secret API. Here's the cURL:
    curl -H 'Content-type:application/json' -u email:password https://api.enterprise.apigee.com/v1/organizations/{organization}/developers/{developer_email_or_id}/apps/{app_name}/keys/create -X POST -d \
    '{
      "consumerKey": "key",
      "consumerSecret": "secret"
      }'
    
  2. Associate the consumer key/secret with one or more Edge 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.
    See the add (post) API product to key API. Here's the cURL:
    curl -H 'Content-type:application/json' -u email:password https://api.enterprise.apigee.com/v1/organizations/{organization}/developers/{developer_email_or_id}/apps/{app_name}/keys/{consumer_key_name} -X POST -d \
    '{
     "apiProducts": ["product_1", "product_2"]
    }'
    
  3. Optionally delete the initial consumer key/secret that Edge 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 management UI.
    See the delete key for a developer app API.