Management API call to delete a product associated to an app

Hi,

The developer portal on our OPDK is configured to associate all apps to a default product ( for some reason our developer portal is not allowing us to change this association ie if we had initially configured product 1 as default product we are now unable to change the default product from product 1 to product 2 ), for certain apps ( company apps) we associate another product ( through http rules module) and then save the changes.

However when one edits a company app, the default product is automatically associated with the company app along with the existing product that was associated with it through http rules module as mentioned above. How do we over-ride this setting.

I have tried multiple management api calls with no success like below

curl -X POST \
 -H content-type:application/octet-stream \
 "${mgmtserver}/v1/o/${orgname}/developers/${developerid}/apps/${appname}/keys/${consumerkey}/apiproducts/${productname}?action=${action}"

and


curl -X POST \
 -H content-type:application/octet-stream \
"${mgmtserver}/v1/o/${orgname}/apps/${appid}/keys/${consumerkey}/apiproducts/${productname}?action=${action}"

and


curl -X POST \
 -H content-type:application/octet-stream \
"${mgmtserver}/v1/o/${orgname}/companies/${companyname}/apps/${app_id}/keys/${consumer_key}/apiproducts/${product_name}?action=revoke"

which all gave me a 404 response.

I also tried

curl -X PUT \ ${mgmtserver}/v1/o/${orgname}/companies/${companyname}/apps/${appname}/attributes

'{ "apiProducts": ["{productname}"]}'

which gave me a 200 but no update was done

I also tried

curl -X PUT \ ${mgmtserver}/v1/o/${orgname}/companies/${companyname}/apps/${appname}

'{ "apiProducts": ["{productname}"]}'

which gave me a 200 and created a new key and associated the only product i wanted to associate.

All the above approaches do not help me in removing/revoking a product. Please suggest.

ps: this problem doesnt arise for developer apps as developer apps consist of only default product

Thanks,

Vednath

0 1 326
1 REPLY 1

Just in case anyone else runs into this issue, the correct API call is:

curl -X DELETE ${mgmtserver}/v1/o/${orgname}/companies/${companyname}/apps/${app}/keys/${key}/apiproducts/${product}