Was this helpful?

 

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

API Resource Path:

/companies/{company_name}/apps/{app_name}/keys/{consumer_key}

Description: Update existing app with an API product.

Verb: POST
Auth: Basic Auth
Media types:
application/json
text/xml

Overview: Adds an API product to a company app, enabling the company app to access the API resources (URIs) defined in the API product. Existing API products are merged with the API product added by this method.

Sample Request:
$ curl -H "Content-type:application/json" -X POST -d 
'{
  "apiProducts" : [ {
    "apiproduct" : "TestApiProduct1",
    "status" : "approved"
  }, {
    "apiproduct" : "TestApiProduct2",
    "status" : "approved"
  } ],
  "attributes" : [ {
    "name" : "region",
    "value" : "west"
  } ],
  "consumerKey" : "{consumerkey}",
  "consumerSecret" : "{consumerSecret}",
  "status" : "approved"
}' \
https://api.enterprise.apigee.com/v1/o/{org_name}/companies/{company_name}/apps/{app_name}/keys/{consumer_key} \
-u myname:mypass
Request Payload Elements:
Name Description Default Required?
apiProducts A list of API products to associate with the app N/A Yes
attributes Name/value formatted attributes used to extend the default API product profile N/A No
Sample Response:
{
  "apiProducts" : [ {
    "apiproduct" : "TestApiProduct1",
    "status" : "approved"
  }, {
    "apiproduct" : "TestApiProduct2",
    "status" : "approved"
  } ],
  "attributes" : [ {
    "name" : "region",
    "value" : "west"
  } ],
  "consumerKey" : "{consumerkey}",
  "consumerSecret" : "{consumerSecret}",
  "status" : "approved"
}
Response Payload Elements:
Name Description
apiProducts The list of API products associated with the app
apiproduct The name of one API product in the list of API products associated with the app
status The status of the app's association with the API product: 'approved' or 'unapproved'
attributes Name/value formatted attributes used to extend the default API product profile
consumerKey The value of the consumer key associated with the app
consumerSecret The name of the consumer secret associated with the consumer key
status The status of the consumer key: 'approved' or 'pending'
Errors:
{
  "code" : "keymanagement.service.InvalidClientIdForGivenApp",
  "message" : "Invalid consumer key for Given App",
  "contexts" : [ ]
}

 

Help or comments?

  • Something's not working: See Apigee Support
  • Something's wrong with the docs: Click Send Feedback in the lower right.
    (Incorrect? Unclear? Broken link? Typo?)