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
  • 1.  Invoke URL

    Posted Fri March 10, 2023 05:26 AM

    Hi everyone,

    I am using the policy invoke but I need to use a custom url.

    Normally I use target-url and request path, but this time I need something different.

    So I set a variable by apim lib but I can't used it or I don't know to do it.

    Can someone help me out with this?

    Regards



    ------------------------------
    Filipe Ventura
    ------------------------------


  • 2.  RE: Invoke URL

    Posted Fri March 10, 2023 09:28 AM

    Hi Filipe,
    If you've set a variable into context that contains your url, the invoke target-url property should be specified as $(yourvariablename).  Any variable reference in the property will have its value substituted, and the property can have as many variable references as you need to meet your requirements.

    Best Regards,
    Steve



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------



  • 3.  RE: Invoke URL

    Posted Fri March 10, 2023 09:54 AM
    Edited by Filipe Ventura Fri March 10, 2023 09:53 AM

    Hi Steve,

    Thanks for your reply.

    Can you check.

    1. I create a variable at a gateway script
    2. I use at invoke like
    3. Have I failed something?

    Thanks in advance



    ------------------------------
    Filipe Ventura
    ------------------------------



  • 4.  RE: Invoke URL

    Posted Fri March 10, 2023 11:05 AM

    Hi Filipe,
    Which gateway are you using? v5 compatible versus api gateway?  I don't think what you have is incorrect.  Have you tried simply setting the variable to newPath?  

    Regards,
    Steve



    ------------------------------
    Steve Linn
    Senior Consulting I/T Specialist
    IBM
    ------------------------------



  • 5.  RE: Invoke URL

    Posted Sun March 12, 2023 11:56 AM

    Main question is as Steve indicates. Which gateway are you using? Depending on the answer use

    DataPower
    Gatewayvar name = require('local:///isp/policy/apim.custom.js');   // v5-Compatible Gateway
    DataPower API
    Gatewayvar name = require('apim');                                 // DataPower API Gateway


    ------------------------------
    Jeroen Willems
    Integration Architect - Managing Partner
    Integration Designers
    ------------------------------



  • 6.  RE: Invoke URL

    Posted Tue March 14, 2023 05:37 AM

    Hi Jeroen, 

    I am using DataPower API Gateway.

    Regards



    ------------------------------
    Filipe Ventura
    ------------------------------



  • 7.  RE: Invoke URL

    Posted Tue March 14, 2023 05:37 AM
    Edited by Filipe Ventura Tue March 14, 2023 05:37 AM

    Hi Steve, 

    I am using DataPower API Gateway.

    Regards



    ------------------------------
    Filipe Ventura
    ------------------------------