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.


#API Connect
#Applicationintegration
#APIConnect
 View Only
  • 1.  Trying to supersede a product using REST APIs of API Connect

    Posted Tue June 06, 2023 08:55 AM
    Edited by Stefen Salvatore Thu June 08, 2023 01:34 AM

    Hi @Steve Linn 
    I am working on REST MANAGEMENT APIs in API Connect but when I want to supersede a product then I am getting an error.
    and I am not aware of the body to be passed to it.
    I am taking references from API Explorer (ibmcloud.com).

    Since the request body is optional in the above link I have not sent it but then it is throwing the following error.

    Error:
    {
        "status"400,
        "message": [
            "Error validating the request body against definition '#/components/schemas/ProductPlanMapping'"
        ],
        "errors": [
            "(Request) must be object (line: 0, column: 0)"
        ]
    }

    So, what request body should I send to achieve my requirement?

    Thanks in advance!



    ------------------------------
    Stefen Salvatore
    ------------------------------



  • 2.  RE: Trying to supersede a product using REST APIs of API Connect

    Posted Wed June 07, 2023 01:44 AM

    I'm afraid the body payloads aren't very well documented. It's a known issue that hopefully will get sorted soon.

    In the meantime the easiest way to get an example is to use the api manager ui to perform the same operation and check your browser debugger for what was sent, then replicate that payload manually.

    Not ideal but effective.



    ------------------------------
    Chris Dudley
    ------------------------------



  • 3.  RE: Trying to supersede a product using REST APIs of API Connect
    Best Answer

    Posted Wed June 07, 2023 04:41 AM

    Agreed Chris.

    @Stefen Salvatore here is the body for the Supersede (and Replace) calls:

    --data-raw '{"product_url":"https://api-connect-mgmt.ibm.com/api/catalogs{catalog-id}products/{staged-product-id}","plans":[{"source":"default-plan","target":"default-plan"}]}'

    the plan listed is an example as is the URL-hostname in the product_url.

    As Chris suggested, I used the APIM UI to extract the detail, see my blog for more details on that process https://community.ibm.com/community/user/integration/blogs/nick-cawood/2023/02/22/some-advice-about-using-the-api-connect-v10-apic-t?CommunityKey=2106cca0-a9f9-45c6-9b28-01a28f4ce947



    ------------------------------
    Nick Cawood
    API Connect Consultant
    IBM Hybrid Cloud Integration Expert Labs
    IBM UK Ltd

    https://www.linkedin.com/in/nickcawood/
    ------------------------------



  • 4.  RE: Trying to supersede a product using REST APIs of API Connect

    Posted Wed June 07, 2023 05:00 AM
    Edited by Stefen Salvatore Thu June 08, 2023 01:36 AM

    Thanks, @Nick Cawood for this one. 

    And I have asked you about the yaml files issue also for publishing a product by bypassing.
    If possible please guide me in that as well.

    Thanks in advance!!



    ------------------------------
    Stefen Salvatore

    ------------------------------



  • 5.  RE: Trying to supersede a product using REST APIs of API Connect

    Posted Thu June 08, 2023 07:01 AM

    Hi @Nick Cawood 

    I have tried this also but the error is
    {
        "status": 400,
        "message": [
            "The operationId 'product_getByNameVersionCatalogScope' does not match the URL '/api/catalogs/bob-framework/products/token'."
        ]
    }

    Thanks in advance!!



    ------------------------------
    Stefen Salvatore
    ------------------------------



  • 6.  RE: Trying to supersede a product using REST APIs of API Connect

    Posted Thu June 08, 2023 07:26 AM

    @Stefen Salvatore

    I'm sorry that's not really enough information for me to assist, have you Staged a new product? What commands are you running?



    ------------------------------
    Nick Cawood
    API Connect Consultant
    IBM Hybrid Cloud Integration Expert Labs
    IBM UK Ltd

    https://www.linkedin.com/in/nickcawood/
    ------------------------------