Was this helpful?

 

Base Path: https://api.enterprise.apigee.com/v1/o/{org_name}

API Resource Path:

/developers/{developer_email}/apps/{app_name}/keys/{consumer_key}

Description: Adds an API product to a developer app key

Verb: POST
Auth: Basic Auth
Media types:
application/octet-stream

Overview: Updates an existing developer app key with the specified API product, enabling the developer app that holds the key to access the URIs bundled in the API product. The API product(s) specified in request payload will be merged with existing API product(s) for this key.

Sample Request:
$ curl -H "Content-type:application/octet-stream' -X POST -d \
'{
  " apiProducts": [ " ApiProduct_qa " ],
  " attributes " : [{
  " name " : " region ",
  " value " :  " south "
  },{
  " name " : " country " ,
  " value " : " norway "
  }]
}' \
https://api.enterprise.apigee.com/v1/o/{org_name}/developers/{developer_email}/apps/{app_name}/keys/{consumer_key} \
-u myname:mypass 
Request Payload Elements:
Name Description Default Required?
apiProducts The name of the API product to added to the developer app key   Yes
attributes Arbitrary name/value attributes added to the profile for the developer app key, usually used for app specific processing or metadata/analytics   No
Sample Response:
{
  "apiProducts" : [ {
    "apiproduct" : "ApiProduct",
    "status" : "approved"
  }, {
    "apiproduct" : "ApiProduct_qa",
    "status" : "approved"
  } ],
  "attributes" : [ {
    "name" : "region",
    "value" : "south"
  }, {
    "name" : "country",
    "value" : "norway"
  } ],
  "consumerKey" : "0F2S7iCWcQ4mDQVGXwS5tgPAGWnNxo0q",
  "consumerSecret" : "CciaOUKFPXVgBIGk",
  "status" : "approved"
}
Response Payload Elements:
Name Description
apiproduct The name of the API product added to the developer app key
status The status of the API product
attributes Arbitrary name/value pairs added by the client
consumerKey The value of the developer app key to which the API product was attached
consumerSecret The value of the developer app key secret to which the API product was attached
status The status of the consumer app key (approved or pending). For API products whose approval type is set to "Manual", keys are returned in pending state and must be explicitly approved.
Errors:
{
  "code" : "keymanagement.service.InvalidClientIdForGivenApp",
  "message" : "Invalid consumer key for Given App",
  "contexts" : [ ]
}

 

Add new comment

Provide your email address if you wish to be contacted offline about your comment.
We will not display your email address as part of your comment.

We'd love your feedback and perspective! Please be as specific as possible.
Type the characters you see in this picture. (verify using audio)

Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.