API Connect

 View Only
  • 1.  Unable to consume PATH for a REST API

    Posted Mon November 21, 2022 09:48 AM
    Hi

    I created a REST API from  URL httpbin.org and its sandbox endpoint is created as a.apiconnect.ibmappdomain.cloud/ibmapiconnectuseast1/sandbox/httpbinall/ So far it is good 

    I want to use the paths   get and post  for this this API as a.apiconnect.ibmappdomain.cloud/ibmapiconnectuseast1/sandbox/httpbinall/get and a.apiconnect.ibmappdomain.cloud/ibmapiconnectuseast1/sandbox/httpbinall/post  that should point to httpbin.org/get and httpbin.org/post respectively . I added get and post as paths in API Design and published the API. 

    The issue I have is that the The Sandbox endpoint  a.apiconnect.ibmappdomain.cloud/ibmapiconnectuseast1/sandbox/httpbinall/, a.apiconnect.ibmappdomain.cloud/ibmapiconnectuseast1/sandbox/httpbinall/get , a.apiconnect.ibmappdomain.cloud/ibmapiconnectuseast1/sandbox/httpbinall/post  all takes me to only API that points to a.apiconnect.ibmappdomain.cloud/ibmapiconnectuseast1/sandbox/httpbinall/. 

    Could some one please help e to fix the issue. The Sandbox API do not consider the path for resolving the actual target URL

    thanks in advance
    Rajeev


    ------------------------------
    Rajeev Chandrasekharan
    ------------------------------


  • 2.  RE: Unable to consume PATH for a REST API

    Posted Mon November 21, 2022 10:21 AM

    Hi Rajeev,

    If you want to have a single invoke policy to cover all the different paths, you will need to add the path parameters on the end of the URL - e.g.
    $(target-url)$(request.path)

    Hope this helps

    Ricky



    ------------------------------
    Ricky Moorhouse
    IBM API Connect Cloud Architect
    ------------------------------



  • 3.  RE: Unable to consume PATH for a REST API

    Posted Mon November 21, 2022 10:49 AM
      |   view attached
    Hi  Ricky Moorhouse,

    Thank you for you help. I made the change like that however I am getting 404 error. Please find the screenshots in the attached document. 

    Once again thanks a lot for your help.

    --

    Rajeev Chandrasekharan, Sr. Architect,
    Phone: +91 (944) 781-1644
    AOT Technologies Pvt. Ltd. Module No: 341 & 342, 3rd Floor, Nila Building, Technopark, Kazhakkoottam, Thiruvananthapuram, Kerala, India - 695581



    Attachment(s)

    pdf
    IBM API Connect Error.pdf   300 KB 1 version


  • 4.  RE: Unable to consume PATH for a REST API
    Best Answer

    Posted Tue November 22, 2022 04:30 AM
    Hi Ricky

    That helped.  It worked when I used $(target-url)$(api.operation.path).

    Thanks a ton for pointing to the right direction.

    regards
    Rajeev

    ------------------------------
    Rajeev Chandrasekharan
    ------------------------------



  • 5.  RE: Unable to consume PATH for a REST API

    Posted Tue November 22, 2022 07:36 AM

    That's great news - thanks for letting me know!

    That makes sense as api.operation.path will be from the basePath onwards, where as the request.path would have included the basePath.

    Thanks



    ------------------------------
    Ricky Moorhouse
    IBM API Connect Cloud Architect
    ------------------------------



  • 6.  RE: Unable to consume PATH for a REST API

    Posted Wed November 23, 2022 03:08 AM
    Hi 

    Can someone help me to know the correct documents to create a custom policy for API connect. All the documents I see are pointing to IBM DataPower.

    I wish to create a custom policy that can extract the request and response body + headers of an incoming request and send that to a third server through an HTTP API call with minimal IBM API Connect  resource usage.on a trial account.

    regards

    --

    Rajeev Chandrasekharan, Sr. Architect,
    Phone: +91 (944) 781-1644
    AOT Technologies Pvt. Ltd. Module No: 341 & 342, 3rd Floor, Nila Building, Technopark, Kazhakkoottam, Thiruvananthapuram, Kerala, India - 695581