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.  Not able to use the $(variable) in Invoke

    Posted 08/18/23 02:07 PM

    Hello All,

    I have written a gateway script to get the URL from Data Power based on certain conditions. I was able to read the URL into a variable called targeturl.
    Later, I passed the variable $(targeturl) in invoke. But when I test the API, it says the backside URL is invalid from SOAP UI.

    In the data power logs, it's showing like below:
     The target URL is invalid or cannot be resolved. '$(targeturl)'

    Code:

    var targeturl = json.endpoints[a].first[b].url;
    console.info('Target URL: ' + targeturl);

    Can't we use targeturl directly as $(targeturl) in the Invoke?

    It's working when I does statically. But here I am trying to set the url dynamically to a variable based on condition but however not able to use the variable in Invoke. Kindly assist me on this.



    ------------------------------
    Ravikumar
    ------------------------------


  • 2.  RE: Not able to use the $(variable) in Invoke

    Posted 08/18/23 02:20 PM

    Hello All,

    It's working after set the variable to a context.



    ------------------------------
    Ravikumar
    ------------------------------