API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Get Active subscription details of a specific product:version in a catalog

  • 1.  Get Active subscription details of a specific product:version in a catalog

    Posted Fri August 30, 2024 07:33 AM

    Dear Experts,

      I am trying to find out  away where I need to pull the active subscription details of a specific product:version in catalog through CLI.

     While I understand we can check this manually in apimanager, but my requirement is to pull this details programmatically using cli.

    Can you please guide me on this. I didnt find any cli commands that would cater to my requirement.

    Your response is highly appreciated. thanks in advance.

    Regards

    Rams



    ------------------------------
    Srinivas Poram
    ------------------------------


  • 2.  RE: Get Active subscription details of a specific product:version in a catalog

    Posted Mon September 02, 2024 02:03 AM

    Hi Rams..

    We looked into this earlier this year - and found that this is not possible with the commands in apic (or the REST interface for that matter)..

    If you look at the web console and how it works (press f12 - or whatever opens the developer mode in your favorite browser), look at what it fetches for the "Products" overview in the API managers UI catalog part..

    It will call these rest services (amongst others, he he):

    /products - list all products

    /subscriptions - list all subscriptions

    Now it has the data it needs, a full list of subscriptions for ALL products and all the products. Now it can show the UI you refer to, without calling the API manager again.

    We have scripted this for when we need it. Do the same, call and get a list of all subscriptions, and run through that - for each subscription in the list you will find this object:
                "product": {
                    "id": "fc23c633-5aea-4ed1-ab63-2db7b0c85dff",
                    "title": "Instrument Key Conversion API",
                    "name": "instrument-key-conversion-v1",
                    "version": "1.0.2",
                    "url": "https://<apim-url>/api/catalogs/78b13aee-7e8c-4ae5-94e5-07337474dbac/07a9c78c-8385-4baf-b471-beee3eebc11d/products/fc23c633-5aea-4ed1-ab63-2db7b0c85dff"
              },


    So looping through subscriptions and checking in the product sub object if it matches your input product.. And you will have your list..

    Not the simple answer you looked for - but the only way, we could make it work..



    ------------------------------
    Team API
    ------------------------------