Send Docs Feedback

Import existing consumer keys and secrets

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.

Keys and secrets must use alphanumeric characters, and can contain hyphens. Special characters other than hyphens aren't supported.

  1. Create the consumer keys and secrets in Edge with the management API, one at a time.
    See Create a consumer key and secret. 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 Add API Product to Key. 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 Delete Key for a Developer App.

Help or comments?