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" : [ ]
}

 

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.